posix_acl: Add the check items
Subsystems (2)
PATCH v2 1/12 posix_acl: Add the check items
Add the acl validation check-items
to fix the null pointer error and PTR_ERR error.
Thanks for Matthew Wilcox's sguuestion.
---
Signed-off-by Liuwenyi <[email protected]>
Cc Chris Mason <[email protected]>
Cc Al Viro <[email protected]>
Cc Joel Becker <[email protected]>
Cc Chris Ball <[email protected]>
Cc James Morris <[email protected]>
Cc Serge Hallyn <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Andreas Dilger <[email protected]>
Cc Jan Kara <[email protected]>
Cc "Theodore Ts'o" <[email protected]>
Cc David Woodhouse <[email protected]>
Cc Steven Whitehouse <[email protected]>
Cc J. Bruce Fields <[email protected]>
Cc Neil Brown <[email protected]>
Cc Frank Filz <[email protected]>
Cc Boaz Harrosh <[email protected]>
Cc Mark Fasheh <[email protected]>
Cc Tiger Yang <[email protected]>
Cc Jeff Mahoney <[email protected]>
Cc Alex Elder <[email protected]>
Cc Eric Sandeen <[email protected]>
--
fs/posix_acl.c +0 -0
@@ -76,6 +76,12 @@ posix_acl_valid(const struct posix_acl *acl)
unsigned int id = 0; /* keep gcc happy */ int needs_mask = 0;
+ if (!acl)
+ return -EINVAL;
+
+ if (IS_ERR(acl))
+ return PTR_ERR(acl);
+FOREACH_ACL_ENTRY(pa, acl, pe) {
if (pa->e_perm & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE)) return -EINVAL;
Signature · 7 lines
Best Regards, Liuwenyi _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs