Bug 683568 - Credentials leak in 2.6.35.11 stable kernel
Summary: Credentials leak in 2.6.35.11 stable kernel
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 14
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 682324 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-09 18:02 UTC by David Howells
Modified: 2011-04-28 02:02 UTC (History)
6 users (show)

Fixed In Version: kernel-2.6.35.12-90.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-28 02:02:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Howells 2011-03-09 18:02:04 UTC
Description of problem:

The 2.6.35.11 stable kernel has a credentials leak in it due to one of the following patches:

cab9e9848b9a8283b0504a2d7c435a9f5ba026de scm: Capture the full credentials of the scm sender.
76319701efb717e4a159f4cdb159646c6862e6a0 af_unix: Allow credentials to work across user and pid namespaces.
7d77e1c063cba215c6217e0fca3bbd4f53ec7f4d user_ns: Introduce user_nsmap_uid and user_ns_map_gid.
afa01a2cc021a5f03f02364bb867af3114395304 sock: Introduce cred_to_ucred

Only the fourth patch is confirmed bad by bisection; the other three patches don't build.  The patch preceding all of those is good.

Version-Release number of selected component (if applicable):

kernel-2.6.35.11-83.fc14.x86_64

How reproducible:

100%

Steps to Reproduce:

Run the following script:
#!/bin/bash
for ((i=0; i<100; i++))
do
        su - -c /bin/true
        #cut -d: -f1 /proc/slabinfo | grep 'cred\|key\|task_struct'
        cat /proc/keys | wc -l
done

Note the number of keys going up and up.

If the kernel is built with SLAB rather than SLUB, the outstanding cred count is huge and increases rapidly rather than staying roughly constant.

The bug does not appear to be in the upstream head or F-15 kernels.

Comment 1 David Howells 2011-03-09 20:50:18 UTC
After rearranging the four patches mentioned in the opening comment, I've isolated it to the patch ensubjected:

    scm: Capture the full credentials of the scm sender.

Comment 2 David Howells 2011-03-09 22:44:45 UTC
The following commit from Linus's kernel is needed in 2.6.35.11 to fix this bug:

commit b47030c71dfd6c8cd5cb6e551b6f7f7cfc96f6a6
Author: Eric W. Biederman <ebiederm>
Date:   Sun Jun 13 03:31:06 2010 +0000

    af_netlink: Add needed scm_destroy after scm_send.
    
    scm_send occasionally allocates state in the scm_cookie, so I have
    modified netlink_sendmsg to guarantee that when scm_send succeeds
    scm_destory will be called to free that state.
    
    Signed-off-by: Eric W. Biederman <ebiederm>
    Reviewed-by: Daniel Lezcano <daniel.lezcano>
    Acked-by: Pavel Emelyanov <xemul>
    Signed-off-by: David S. Miller <davem>

Comment 3 Chuck Ebbert 2011-04-18 17:53:46 UTC
*** Bug 682324 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Update System 2011-04-22 19:01:08 UTC
kernel-2.6.35.12-90.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/kernel-2.6.35.12-90.fc14

Comment 6 Fedora Update System 2011-04-23 20:51:11 UTC
Package kernel-2.6.35.12-90.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kernel-2.6.35.12-90.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/kernel-2.6.35.12-90.fc14
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-04-28 02:02:05 UTC
kernel-2.6.35.12-90.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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