Prevent oopsing in posix_acl_valid()
PATCH 1/1 Prevent oopsing in posix_acl_valid()
If posix_acl_from_xattr() returns an error code, a negative address is dereferenced causing an oops; fix by checking for error code first.
--- fs/btrfs/acl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
fs/btrfs/acl.c +3 -2
@@ -178,12 +178,13 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,if (value) { acl =posix_acl_from_xattr (value, size); + if (IS_ERR(acl) +return PTR_ERR (acl); +if (acl) { ret =posix_acl_valid (acl);if (ret) goto out; - }else if (IS_ERR (acl)) { -return PTR_ERR (acl); } }
Signature · 1 line
1.7.4.1
Quoted 18 lines · Daniel J Blueman
If
posix_acl_from_xattr()returns an error code, a negative address is dereferenced causing an oops; fix by checking for error code first.Signed-off-by Daniel J Blueman<[email protected]>--- fs/btrfs/acl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)fs/btrfs/acl.c +2
-0@@ -178,12 +178,13 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,if (value) { acl =posix_acl_from_xattr (value, size); + if (IS_ERR(acl) +return PTR_ERR (acl);
fs/btrfs/acl.c static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, · line 190
Quoted 10 lines
fs/btrfs/acl.c +1
-2+if (acl) { ret =posix_acl_valid (acl);if (ret) goto out; - }else if (IS_ERR (acl)) { -return PTR_ERR (acl); } }
Thanks,
Josef
2011/5/3 Josef Bacik <[email protected]>:
Quoted 3 lines · Daniel J Blueman
Quoted 2 lines
If
posix_acl_from_xattr()returns an error code, a negative address =
is
Quoted 14 lines
Quoted 14 lines
dereferenced causing an oops; fix by checking for error code first.
Signed-off-by Daniel J Blueman<[email protected]>---
=A0fs/btrfs/acl.c | =A0 =A05 +++--
=A01 files changed, 3 insertions(+), 2 deletions(-)fs/btrfs/acl.c +0
-0@@ -178,12 +178,13 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,
Quoted 2 lines
Quoted 2 lines
fs/btrfs/acl.c +0
-0=A0 =A0 =A0 =A0if (value) {=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0acl =3D posix_acl_from_xattr(value, s=
ize);
Quoted 1 line
Quoted 1 line
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (
IS_ERR(acl)
A small typo: The right parenthesis is missing.
Christian
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" = in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html