linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Avoid array overflow in __nfs4_get_acl_uncached
@ 2012-08-24 14:16 Sachin Prabhu
  2012-08-24 15:07 ` Myklebust, Trond
  0 siblings, 1 reply; 13+ messages in thread
From: Sachin Prabhu @ 2012-08-24 14:16 UTC (permalink / raw)
  To: Linux NFS mailing list; +Cc: Trond Myklebust

This fixes a bug introduced by commit
5a00689930ab975fdd1b37b034475017e460cf2a
The patch adds an extra page to npages to hold the bitmap returned by
the server.

Bruce Fields pointed out that the changes introduced by the patch will
cause the array npages to overflow if a buffer of size greater than or
equal to XATTR_SIZE_MAX is passed to __nfs4_get_acl_uncached()

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
---
 fs/nfs/nfs4proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 6352741..86333b8 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3768,7 +3768,7 @@ out:
  */
 static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t buflen)
 {
-	struct page *pages[NFS4ACL_MAXPAGES] = {NULL, };
+	struct page *pages[NFS4ACL_MAXPAGES+1] = {NULL, };
 	struct nfs_getaclargs args = {
 		.fh = NFS_FH(inode),
 		.acl_pages = pages,
-- 
1.7.11.4


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

end of thread, other threads:[~2012-09-06 15:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 14:16 [PATCH] Avoid array overflow in __nfs4_get_acl_uncached Sachin Prabhu
2012-08-24 15:07 ` Myklebust, Trond
2012-08-24 21:31   ` Sachin Prabhu
2012-08-24 21:38     ` Myklebust, Trond
2012-08-24 21:51       ` Sachin Prabhu
2012-08-24 22:02         ` Myklebust, Trond
2012-08-25 23:31           ` Sachin Prabhu
2012-08-26 18:57             ` Myklebust, Trond
2012-08-28 14:09               ` Sachin Prabhu
2012-09-03 19:11                 ` Myklebust, Trond
2012-09-06 14:46                   ` Sachin Prabhu
2012-09-06 14:53                     ` Myklebust, Trond
2012-09-06 15:05                       ` Sachin Prabhu

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).