Skip to content
Commit 85bcfab4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

staging: lustre: validate size in lustre_posix_acl_xattr_filter()



This is mostly to silence static checker complaints.

In theory the problem here is that if size is in the 1-3 range then we
don't allocate enough memory for the posix_acl_xattr_header struct and
it results in memory corruption.  But in reality kmalloc() return values
are aligned at sizeof(long) so corrupting this small amount of data is
not harmful.

The "size" variable should be type size_t.  The value of size is checked
in setxattr() so we know it is a number between "0 - XATTR_SIZE_MAX".
There is no need to check for negative sizes.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 31e7213a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment