]> www.infradead.org Git - users/willy/xarray.git/commit
bcachefs: fix smatch data leak warning in fs usage ioctl
authorBrian Foster <bfoster@redhat.com>
Thu, 6 Jun 2024 13:58:26 +0000 (09:58 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 14 Jul 2024 23:00:15 +0000 (19:00 -0400)
commitb5597347a5c7182dba80f9fb561c404abb3cead8
tree72a27bde785c5b75eac8d0fb1f0f5d8d50d7b90a
parentf295920bc4a0f34f7c4182f53c8f0c929e4358a2
bcachefs: fix smatch data leak warning in fs usage ioctl

smatch warns that the copy of arg to userspace is a potential data
leak by virtue of arg.pad not being checked or zeroed. This was
introduced by the commit referenced below that switched arg from
being a zeroed runtime allocation to living on the stack. Fix by
simply zero initializing the structure.

Fixes: cde738a61e65 ("bcachefs: Convert bch2_ioctl_fs_usage() to new accounting")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/chardev.c