From 0a6154aff983cc23abac47e7b34c1936eb512350 Mon Sep 17 00:00:00 2001 From: Sachin Prabhu Date: Thu, 22 Mar 2012 16:46:28 +0000 Subject: [PATCH] Fix length of buffer copied in __nfs4_get_acl_uncached Bug-db: 14798 CVE: CVE-2012-2375 (mainline commit 785d76dbd877fb3e631a26f67d86a2dd0c862f8e) _copy_from_pages() used to copy data from the temporary buffer to the user passed buffer is passed the wrong size parameter when copying data. res.acl_len contains both the bitmap and acl lenghts while acl_len contains the acl length after adjusting for the bitmap size. Signed-off-by: Sachin Prabhu Signed-off-by: Trond Myklebust --- 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 05ab3b66f38d..97cb3fca8901 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3623,7 +3623,7 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu if (acl_len > buflen) goto out_free; _copy_from_pages(buf, pages, res.acl_data_offset, - res.acl_len); + acl_len); } ret = acl_len; out_free: -- 2.50.1