]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: fix some uninitialized memory references
authorasomers <asomers@FreeBSD.org>
Thu, 4 Apr 2019 20:24:58 +0000 (20:24 +0000)
committerasomers <asomers@FreeBSD.org>
Thu, 4 Apr 2019 20:24:58 +0000 (20:24 +0000)
commitd78a5392521530e5c298bb19072c42416cd42b26
tree4f2b8e3e14fa3a0075e301b1b5619441271c5b93
parent5feef0e4922f65465177765bf2a504c4de1f524e
fusefs: fix some uninitialized memory references

This bug was long present, but was exacerbated by r345876.

The problem is that fiov_refresh was bzero()ing a buffer _before_ it
reallocated that buffer.  That's obviously the wrong order.  I fixed the
order in r345876, which exposed the main problem.  Previously, the first 160
bytes of the buffer were getting bzero()ed when it was first allocated in
fiov_init.  Subsequently, as that buffer got recycled between callers, the
portion used by the _previous_ caller was getting bzero()ed by the current
caller in fiov_refresh.  The problem was never visible simply because no
caller was trying to use more than 160 bytes.

Now the buffer gets properly bzero()ed both at initialization time and any
time it gets enlarged or reallocated.

Sponsored by: The FreeBSD Foundation
sys/fs/fuse/fuse_ipc.c