mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
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>
This commit is contained in:
parent
f295920bc4
commit
b5597347a5
@ -517,7 +517,7 @@ static long bch2_ioctl_data(struct bch_fs *c,
|
||||
static long bch2_ioctl_fs_usage(struct bch_fs *c,
|
||||
struct bch_ioctl_fs_usage __user *user_arg)
|
||||
{
|
||||
struct bch_ioctl_fs_usage arg;
|
||||
struct bch_ioctl_fs_usage arg = {};
|
||||
darray_char replicas = {};
|
||||
u32 replica_entries_bytes;
|
||||
int ret = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user