linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3]posix acl:Add an acl check
@ 2009-12-17 14:15 Liuweni
  2009-12-17 14:19 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Liuweni @ 2009-12-17 14:15 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, viro
  Cc: Xiao Guangrong, strongzgy, Liu Hui, qingshenlwy

In this function, the parameter of acl will be called by FOREACH_ACL_ENTRY(macro) 
without null point check. I add a null point check to it. 

---
Signed-off-by: Liuwenyi <qingshenlwy@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 39df95a..956df14 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -76,6 +76,9 @@ posix_acl_valid(const struct posix_acl *acl)
 	unsigned int id = 0;  /* keep gcc happy */
 	int needs_mask = 0;
 
+	if (!acl)
+		return -EINVAL;
+
 	FOREACH_ACL_ENTRY(pa, acl, pe) {
 		if (pa->e_perm & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE))
 			return -EINVAL;

 				
--------------
Best Regards,
Liuweni
2009-12-17


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-12-17 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-17 14:15 [PATCH 1/3]posix acl:Add an acl check Liuweni
2009-12-17 14:19 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).