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 857555 - nfs: fix potential slabcache leaks when cache allocations fail
Summary: nfs: fix potential slabcache leaks when cache allocations fail
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Petr Beňas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-14 19:57 UTC by Jeff Layton
Modified: 2015-01-04 23:03 UTC (History)
8 users (show)

Fixed In Version: kernel-2.6.32-335.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 06:37:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0496 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 6 kernel update 2013-02-20 21:40:54 UTC

Description Jeff Layton 2012-09-14 19:57:07 UTC
I recently pushed this patch upstream:

commit 3dd4765fce04c0b4af1e0bc4c0b10f906f95fabc
Author: Jeff Layton <jlayton>
Date:   Thu Aug 2 14:30:56 2012 -0400

    nfs: tear down caches in nfs_init_writepagecache when allocation fails

...which I think we'll want in rhel6. Ideally Steve D can just pull it in as part of his pnfs DIO backport, but opening this bug to make sure it doesn't fall through the cracks.

Comment 2 RHEL Program Management 2012-09-14 20:30:48 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 4 yanfu,wang 2012-09-17 02:41:50 UTC
hi Jeff,
Do you know any test steps/reproducer QE could use to test the patch?
Thanks in advance.

Comment 5 Jeff Layton 2012-09-17 13:13:48 UTC
No. There are 2 bugs at play here and only one is easily reproducible...

The first problem is that when allocating any of the caches fails, the nfs code doesn't clean up any that were already allocated. That's a long standing bug that we ought to fix, but that will be hard to reproduce without adding some sort of fault injection.

The second problem is that we don't ever clean up the nfs_commit_data cache. This is easier to reproduce, but that bug is introduced in one of steved's pnfs "waves". No released kernel contains that bug (yet).

Most likely steve should just take the patch I sent upstream into his pnfs waves and close this bug as a dup.

Comment 6 yanfu,wang 2012-09-18 05:48:03 UTC
(In reply to comment #5)
> No. There are 2 bugs at play here and only one is easily reproducible...
> 
> The first problem is that when allocating any of the caches fails, the nfs
> code doesn't clean up any that were already allocated. That's a long
> standing bug that we ought to fix, but that will be hard to reproduce
> without adding some sort of fault injection.
> 
> The second problem is that we don't ever clean up the nfs_commit_data cache.
> This is easier to reproduce, but that bug is introduced in one of steved's
> pnfs "waves". No released kernel contains that bug (yet).
hi Jeff,
Thanks for your useful info.
As per the second problem you mentioned above, could you tell me how do I know the nfs_commit_data cache cleaned up when uploading nfs module? QE could cover this at least, thanks.

Comment 7 yanfu,wang 2012-09-18 05:49:52 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > No. There are 2 bugs at play here and only one is easily reproducible...
> > 
> > The first problem is that when allocating any of the caches fails, the nfs
> > code doesn't clean up any that were already allocated. That's a long
> > standing bug that we ought to fix, but that will be hard to reproduce
> > without adding some sort of fault injection.
> > 
> > The second problem is that we don't ever clean up the nfs_commit_data cache.
> > This is easier to reproduce, but that bug is introduced in one of steved's
> > pnfs "waves". No released kernel contains that bug (yet).
> hi Jeff,
> Thanks for your useful info.
> As per the second problem you mentioned above, could you tell me how do I
> know the nfs_commit_data cache cleaned up when uploading nfs module? QE
> could cover this at least, thanks.
sorry, s/uploading/unloading/

Comment 8 Jeff Layton 2012-09-18 12:51:25 UTC
$ grep nfs_commit_data /proc/slabinfo

If that cache no longer exists after unloading the module then things are working correctly.

Comment 9 yanfu,wang 2012-09-19 02:57:33 UTC
(In reply to comment #8)
> $ grep nfs_commit_data /proc/slabinfo
> 
> If that cache no longer exists after unloading the module then things are
> working correctly.

Thank you, Jeff!
QE could write test case to cover this.

Comment 10 Jeff Layton 2012-09-25 18:22:30 UTC
Actually...I found that I could oops the kernel pretty trivially with steved's backport that didn't have this patch:

# modprobe nfs
# rmmod nfs
# cat /proc/slabinfo

...and boom, it oopses because the string describing the slabcache lives inside of nfs.ko. Once you rmmod, that pointer is no longer good. Adding the above patch fixes the issue.

Comment 12 Jarod Wilson 2012-10-19 20:51:33 UTC
Patch(es) available on kernel-2.6.32-335.el6

Comment 16 Petr Beňas 2012-10-24 13:58:00 UTC
Reproduced in 2.6.32-330.el6.x86_64 and verified in 2.6.32-331.el6.x86_64.

Comment 18 errata-xmlrpc 2013-02-21 06:37:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0496.html


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