OSDN Git Service

virtiofsd: fix libfuse information leaks
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 22 Nov 2019 11:31:30 +0000 (11:31 +0000)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 23 Jan 2020 16:41:37 +0000 (16:41 +0000)
commit3db2876a0153ac7103c077c53090e020faffb3ea
treebf03ec47c978c6d6dbe639079bd75d05097b242d
parent01a6dc95ec7f71eeff9963fe3cb03d85225fba3e
virtiofsd: fix libfuse information leaks

Some FUSE message replies contain padding fields that are not
initialized by libfuse.  This is fine in traditional FUSE applications
because the kernel is trusted.  virtiofsd does not trust the guest and
must not expose uninitialized memory.

Use C struct initializers to automatically zero out memory.  Not all of
these code changes are strictly necessary but they will prevent future
information leaks if the structs are extended.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
tools/virtiofsd/fuse_lowlevel.c