Message ID | 20220322021326.20162-1-tcs.kernel@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fhandle: add __GFP_ZERO flag for kmalloc in function do_sys_name_to_handle | expand |
On Tue, Mar 22, 2022 at 10:13:26AM +0800, Haimin Zhang wrote: > From: Haimin Zhang <tcs_kernel@tencent.com> > > Add __GFP_ZERO flag for kmalloc in function do_sys_name_to_handle to > initialize the buffer of a file_handle variable. > > Reported-by: TCS Robot <tcs_robot@tencent.com> > Signed-off-by: Haimin Zhang <tcs_kernel@tencent.com> That's called kzalloc()... Care to resend?
diff --git a/fs/fhandle.c b/fs/fhandle.c index 6630c69c23a2..be6b9ed12dfd 100644 --- a/fs/fhandle.c +++ b/fs/fhandle.c @@ -38,7 +38,7 @@ static long do_sys_name_to_handle(struct path *path, return -EINVAL; handle = kmalloc(sizeof(struct file_handle) + f_handle.handle_bytes, - GFP_KERNEL); + GFP_KERNEL | __GFP_ZERO); if (!handle) return -ENOMEM;