diff options
author | Andy Adamson <andros@netapp.com> | 2012-05-01 18:49:49 -0400 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2012-05-25 12:24:32 -0400 |
commit | 8223459567bdb07db4d50c5dcf02c7f8dd3c9433 (patch) | |
tree | 870a6b942a34bb90382636e2e34942311bbaf3d9 /net | |
parent | 2864b16894a2413e3f425b99d41fd7bb2bec58af (diff) |
NFSv4: include bitmap in nfsv4 get acl data
CVE-2011-4131
BugLink: http://bugs.launchpad.net/bugs/893147
The NFSv4 bitmap size is unbounded: a server can return an arbitrary
sized bitmap in an FATTR4_WORD0_ACL request. Replace using the
nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server
with the inclusion of the bitmap (xdr length plus bitmasks) and the acl data
xdr length to the (cached) acl page data.
This is a general solution to commit e5012d1f "NFSv4.1: update
nfs4_fattr_bitmap_maxsz" and fixes hitting a BUG_ON in xdr_shrink_bufhead
when getting ACLs.
Fix a bug in decode_getacl that returned -EINVAL on ACLs > page when getxattr
was called with a NULL buffer, preventing ACL > PAGE_SIZE from being retrieved.
Cc: stable@kernel.org
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(backported from commit bf118a342f10dafe44b14451a1392c3254629a1f upstream)
Signed-off-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xdr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index f008c14ad34..671e4825c7c 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c | |||
@@ -296,7 +296,7 @@ _copy_to_pages(struct page **pages, size_t pgbase, const char *p, size_t len) | |||
296 | * Copies data into an arbitrary memory location from an array of pages | 296 | * Copies data into an arbitrary memory location from an array of pages |
297 | * The copy is assumed to be non-overlapping. | 297 | * The copy is assumed to be non-overlapping. |
298 | */ | 298 | */ |
299 | static void | 299 | void |
300 | _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len) | 300 | _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len) |
301 | { | 301 | { |
302 | struct page **pgfrom; | 302 | struct page **pgfrom; |
@@ -324,6 +324,7 @@ _copy_from_pages(char *p, struct page **pages, size_t pgbase, size_t len) | |||
324 | 324 | ||
325 | } while ((len -= copy) != 0); | 325 | } while ((len -= copy) != 0); |
326 | } | 326 | } |
327 | EXPORT_SYMBOL_GPL(_copy_from_pages); | ||
327 | 328 | ||
328 | /* | 329 | /* |
329 | * xdr_shrink_bufhead | 330 | * xdr_shrink_bufhead |