From: Alex Chiang <achiang@hp.com>
To: dhowells@redhat.com, jmorris@namei.org, serue@us.ibm.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] CRED: Fixup credentials build breakage
Date: Tue, 12 Aug 2008 23:34:27 -0600 [thread overview]
Message-ID: <20080813053427.GA5248@ldl.fc.hp.com> (raw)
A recent patch titled:
CRED: Separate task security context from task_struct
removed task security context from task_struct, but did not
update all locations to use the new struct cred that was
introduced.
The change to task_struct broke perfmon and ia32 syscalls on
ia64. This patch fixes the build.
---
All things considered, I'd prefer to see this patch folded into
7931c65268777ed10cab22486de149d742a1f269 so we can keep
bisectability. Would that be possible, given that these changes
are "only" in linux-next and haven't hit Linus's tree yet?
My hope for folding in this patch into the bigger patch is the
reason why I didn't refer to the commit by SHA1 in the
changelog...
Also, I'm not exactly sure why wrappers were provided for
task_gid, but then later removed. Additionally, I wasn't sure why
no wrapper was provided for task_suid and friends. But I admit
that I didn't read the patch series in depth; only enough to fix
the build.
arch/ia64/ia32/sys_ia32.c | 8 ++++----
arch/ia64/kernel/perfmon.c | 24 ++++++++++++------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 465116a..950b63a 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -2089,20 +2089,20 @@ sys32_getgroups16 (int gidsetsize, short __user *grouplist)
if (gidsetsize < 0)
return -EINVAL;
- get_group_info(current->group_info);
- i = current->group_info->ngroups;
+ get_group_info(current->cred->group_info);
+ i = current->cred->group_info->ngroups;
if (gidsetsize) {
if (i > gidsetsize) {
i = -EINVAL;
goto out;
}
- if (groups16_to_user(grouplist, current->group_info)) {
+ if (groups16_to_user(grouplist, current->cred->group_info)) {
i = -EFAULT;
goto out;
}
}
out:
- put_group_info(current->group_info);
+ put_group_info(current->cred->group_info);
return i;
}
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index ffe6de0..7df49bc 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2410,18 +2410,18 @@ pfm_bad_permissions(struct task_struct *task)
DPRINT(("cur: uid=%d gid=%d task: euid=%d suid=%d uid=%d egid=%d sgid=%d\n",
uid,
gid,
- task->euid,
- task->suid,
- task->uid,
- task->egid,
- task->sgid));
-
- return (uid != task->euid)
- || (uid != task->suid)
- || (uid != task->uid)
- || (gid != task->egid)
- || (gid != task->sgid)
- || (gid != task->gid)) && !capable(CAP_SYS_PTRACE);
+ task_euid(task),
+ task->cred->suid,
+ task_uid(task),
+ task->cred->egid,
+ task->cred->sgid));
+
+ return ((uid != task_euid(task))
+ || (uid != task->cred->suid)
+ || (uid != task_uid(task))
+ || (gid != task->cred->egid)
+ || (gid != task->cred->sgid)
+ || (gid != task->cred->gid)) && !capable(CAP_SYS_PTRACE);
}
static int
--
1.5.3.1.gbed62
next reply other threads:[~2008-08-13 5:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 5:34 Alex Chiang [this message]
2008-08-13 11:26 ` [PATCH] CRED: Fixup credentials build breakage David Howells
2008-08-13 13:26 ` Alex Chiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080813053427.GA5248@ldl.fc.hp.com \
--to=achiang@hp.com \
--cc=dhowells@redhat.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=serue@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.