RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 843830 - NFSv4 ACL bug fixes
Summary: NFSv4 ACL bug fixes
Keywords:
Status: CLOSED DUPLICATE of bug 822871
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.4
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: nfs-maint
QA Contact: Filesystem QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-27 13:36 UTC by Andy Adamson
Modified: 2013-03-04 00:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-27 14:18:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
tar ball with patches back ported to 2.6.32-285 (10.00 KB, application/x-tar)
2012-07-27 13:36 UTC, Andy Adamson
no flags Details

Description Andy Adamson 2012-07-27 13:36:58 UTC
Created attachment 600774 [details]
tar ball with patches back ported to 2.6.32-285

Description of problem:
bugzilla 767288 added a fix to enable the NFS client to process an ACL greater than a page. There are two bug fixes to this code upstream in the Linux 3.x kernels that fix Oops due to buffer overflows in corner cases.

1) When calling GETACL, if the size of the bitmap array, the length
attribute and the acl returned by the server is greater than the
allocated buffer(args.acl_len), we can Oops with a General Protection
fault at _copy_from_pages() when we attempt to read past the pages
allocated.

2) When attempting to cache ACLs returned from the server, if the bitmap
size + the ACL size is greater than a PAGE_SIZE but the ACL size itself
is smaller than a PAGE_SIZE, we can read past the buffer page boundary.

Version-Release number of selected component (if applicable):
RHEL 6.2, 6.3, and pre-release RHEL6.4 (2.6.32-285)


How reproducible:
100%


Steps to Reproduce:
1.Construct an ACL to be returned as per #1 or #2 above in the description section.
2.Call nfs4_getfacl
3.
  
Actual results:

Buffer overflow resulting in Oops or no ACL being displayed.


Expected results:
ACL displayed.


Additional info:

I've attached these two patches that fix the issue back ported to 2.6.32-285:

From 5794d21ef4639f0e33440927bb903f9598c21e92 Mon Sep 17 00:00:00 2001
From: Sachin Prabhu <sprabhu>
Date: Tue, 17 Apr 2012 14:36:40 +0100
Subject: [PATCH 1/1] Avoid beyond bounds copy while caching ACL

When attempting to cache ACLs returned from the server, if the bitmap
size + the ACL size is greater than a PAGE_SIZE but the ACL size itself
is smaller than a PAGE_SIZE, we can read past the buffer page boundary.

Signed-off-by: Sachin Prabhu <sprabhu>
Reported-by: Jian Li <jiali>
Signed-off-by: Trond Myklebust <Trond.Myklebust>


From 5a00689930ab975fdd1b37b034475017e460cf2a Mon Sep 17 00:00:00 2001
From: Sachin Prabhu <sprabhu>
Date: Tue, 17 Apr 2012 14:35:39 +0100
Subject: [PATCH 1/1] Avoid reading past buffer when calling GETACL

Bug noticed in commit
bf118a342f10dafe44b14451a1392c3254629a1f

When calling GETACL, if the size of the bitmap array, the length
attribute and the acl returned by the server is greater than the
allocated buffer(args.acl_len), we can Oops with a General Protection
fault at _copy_from_pages() when we attempt to read past the pages
allocated.

This patch allocates an extra PAGE for the bitmap and checks to see that
the bitmap + attribute_length + ACLs don't exceed the buffer space
allocated to it.

Signed-off-by: Sachin Prabhu <sprabhu>
Reported-by: Jian Li <jiali>
[Trond: Fixed a size_t vs unsigned int printk() warning]
Signed-off-by: Trond Myklebust <Trond.Myklebust>

Comment 2 RHEL Program Management 2012-07-27 14:00:13 UTC
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.

Comment 3 Sachin Prabhu 2012-07-27 14:16:21 UTC
Hello Andy,

We discovered another bug introduced by the patch above when pulling those patches in for RHEL 6.  I have sent a separate patch in for the new bug.
http://www.spinics.net/lists/linux-nfs/msg31564.html

I'll mark this bz as duplicate of the bz already open for those patches. I will be resubmitting these patches to the internal list once the new patch has been accepted.

Sachin Prabhu

Comment 4 Sachin Prabhu 2012-07-27 14:18:13 UTC

*** This bug has been marked as a duplicate of bug 822871 ***


Note You need to log in before you can comment on or make changes to this bug.