Skip to contentSkip to conversation

posix_acl: Add the check items

PATCH In review Liuwenyi 1 participant 1 message Dec 21, 2009

Subsystems (2)
lore
Share & tools
lore

Liuwenyi

author
#0 lore raw

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.

---

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
index 39df95a..d4bacb9 100644
@@ -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