lkml.org 
[lkml]   [2011]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[135/165] Set cred->user_ns in key_replace_session_keyring
    2.6.39-stable review patch.  If anyone has any objections, please let us know.

    ------------------
    Content-Length: 1072
    Lines: 31

    From: "Serge E. Hallyn" <serge@hallyn.com>

    commit f7285b5d631fd6096b11c6af0058ed3a2b30ef4e upstream.

    Since this cred was not created with copy_creds(), it needs to get
    initialized. Otherwise use of syscall(__NR_keyctl, KEYCTL_SESSION_TO_PARENT);
    can lead to a NULL deref. Thanks to Robert for finding this.

    But introduced by commit 47a150edc2a ("Cache user_ns in struct cred").

    Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
    Reported-by: Robert Święcki <robert@swiecki.net>
    Cc: David Howells <dhowells@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    security/keys/process_keys.c | 1 +
    1 file changed, 1 insertion(+)

    --- a/security/keys/process_keys.c
    +++ b/security/keys/process_keys.c
    @@ -845,6 +845,7 @@ void key_replace_session_keyring(void)
    new-> sgid = old-> sgid;
    new->fsgid = old->fsgid;
    new->user = get_uid(old->user);
    + new->user_ns = new->user->user_ns;
    new->group_info = get_group_info(old->group_info);

    new->securebits = old->securebits;

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2011-06-01 10:29    [W:0.025 / U:0.072 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site