summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lustre/include/lustre_eacl.h
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-10-22 11:11:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-29 16:33:11 +0800
commit85bcfab46955e6f4bcfd08ffb989f941e003da2a (patch)
treed7f0a4de0d323ebb6860f6e03dcc20af92b725c4 /drivers/staging/lustre/lustre/include/lustre_eacl.h
parent31e7213ab21e2c251a61a13fca4c9548f1f875fd (diff)
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/include/lustre_eacl.h')
-rw-r--r--drivers/staging/lustre/lustre/include/lustre_eacl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/include/lustre_eacl.h b/drivers/staging/lustre/lustre/include/lustre_eacl.h
index b94f76a3301b..0f8f76c43ee1 100644
--- a/drivers/staging/lustre/lustre/include/lustre_eacl.h
+++ b/drivers/staging/lustre/lustre/include/lustre_eacl.h
@@ -74,7 +74,7 @@ typedef struct {
extern ext_acl_xattr_header *
lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size);
extern int
-lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
+lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, size_t size,
posix_acl_xattr_header **out);
extern void
lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);