From: Russ Allbery Date: Tue, 26 May 2009 23:34:35 +0000 (-0700) Subject: Apply STABLE14-linux26-defer-cred-changing-20090511 X-Git-Tag: debian/1.4.10+dfsg1-2~8 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=b8e0318b12beb9d641d9bac7c32133946ec4cb6e;p=packages%2Fo%2Fopenafs.git Apply STABLE14-linux26-defer-cred-changing-20090511 * Apply upstream CVS deltas: - STABLE14-linux26-defer-cred-changing-20090511: defer changing groups when the real and effective credentials of a process differ to avoid running afoul of checks in newer Linux kernels that cause oops. (Closes: #528785) --- diff --git a/debian/changelog b/debian/changelog index 0402ba9d2..0428a8f1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,10 @@ openafs (1.4.10+dfsg1-2) UNRELEASED; urgency=low + * Apply upstream CVS deltas: + - STABLE14-linux26-defer-cred-changing-20090511: defer changing groups + when the real and effective credentials of a process differ to avoid + running afoul of checks in newer Linux kernels that cause oops. + (Closes: #528785) * Provide an openafs-modules-dkms package that uses DKMS to dynamically build kernel modules for the local kernel and document this option in README.modules. This is an alternative to installing diff --git a/src/afs/LINUX/osi_cred.c b/src/afs/LINUX/osi_cred.c index bf4845d6d..4ee31abd1 100644 --- a/src/afs/LINUX/osi_cred.c +++ b/src/afs/LINUX/osi_cred.c @@ -15,7 +15,7 @@ #include "afs/param.h" RCSID - ("$Header: /cvs/openafs/src/afs/LINUX/osi_cred.c,v 1.10.2.4 2009/01/15 13:27:43 shadow Exp $"); + ("$Header: /cvs/openafs/src/afs/LINUX/osi_cred.c,v 1.10.2.6 2009/05/11 14:55:40 shadow Exp $"); #include "afs/sysincludes.h" #include "afsincludes.h" @@ -104,6 +104,12 @@ crset(cred_t * cr) #if defined(STRUCT_TASK_HAS_CRED) struct cred *new_creds; + /* If our current task doesn't have identical real and effective + * credentials, commit_cred won't let us change them, so we just + * bail here. + */ + if (current->cred != current->real_cred) + return; new_creds = prepare_creds(); new_creds->fsuid = cr->cr_uid; new_creds->uid = cr->cr_ruid;