From: James Morris <jmorris@namei.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Stephen Smalley <sds@tycho.nsa.gov>,
Chris Wright <chrisw@sous-sol.org>,
David Quigley <dpquigl@tycho.nsa.gov>
Subject: [PATCH 2/3] SELinux: Add security hook call to kill_proc_info_as_uid
Date: Wed, 28 Jun 2006 19:46:48 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0606281945560.17159@d.namei> (raw)
In-Reply-To: <Pine.LNX.4.64.0606281943240.17149@d.namei>
From: David Quigley <dpquigl@tycho.nsa.gov>
This patch adds a call to the extended security_task_kill hook introduced
by the prior patch to the kill_proc_info_as_uid function so that these
signals can be properly mediated by security modules. It also updates the
existing hook call in check_kill_permission.
Signed-Off-By: David Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Please apply.
---
include/linux/sched.h | 2 +-
kernel/signal.c | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/include/linux/sched.h linux-2.6.17-mm3-kill/include/linux/sched.h
--- linux-2.6.17-mm3/include/linux/sched.h 2006-06-28 13:58:59.000000000 -0400
+++ linux-2.6.17-mm3-kill/include/linux/sched.h 2006-06-27 14:46:36.000000000 -0400
@@ -1249,7 +1249,7 @@ extern int force_sig_info(int, struct si
extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp);
extern int kill_pg_info(int, struct siginfo *, pid_t);
extern int kill_proc_info(int, struct siginfo *, pid_t);
-extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t);
+extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32);
extern void do_notify_parent(struct task_struct *, int);
extern void force_sig(int, struct task_struct *);
extern void force_sig_specific(int, struct task_struct *);
diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/kernel/signal.c linux-2.6.17-mm3-kill/kernel/signal.c
--- linux-2.6.17-mm3/kernel/signal.c 2006-06-28 13:58:59.000000000 -0400
+++ linux-2.6.17-mm3-kill/kernel/signal.c 2006-06-28 14:34:26.000000000 -0400
@@ -584,7 +584,7 @@ static int check_kill_permission(int sig
&& !capable(CAP_KILL))
return error;
- error = security_task_kill(t, info, sig);
+ error = security_task_kill(t, info, sig, 0);
if (!error)
audit_signal_info(sig, t); /* Let audit system see the signal */
return error;
@@ -1107,7 +1107,7 @@ kill_proc_info(int sig, struct siginfo *
/* like kill_proc_info(), but doesn't use uid/euid of "current" */
int kill_proc_info_as_uid(int sig, struct siginfo *info, pid_t pid,
- uid_t uid, uid_t euid)
+ uid_t uid, uid_t euid, u32 secid)
{
int ret = -EINVAL;
struct task_struct *p;
@@ -1127,6 +1127,9 @@ int kill_proc_info_as_uid(int sig, struc
ret = -EPERM;
goto out_unlock;
}
+ ret = security_task_kill(p, info, sig, secid);
+ if (ret)
+ goto out_unlock;
if (sig && p->sighand) {
unsigned long flags;
spin_lock_irqsave(&p->sighand->siglock, flags);
next prev parent reply other threads:[~2006-06-28 23:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-28 23:45 [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion James Morris
2006-06-28 23:46 ` James Morris [this message]
2006-06-28 23:49 ` [PATCH 3/3] SELinux: Update USB code with new kill_proc_info_as_uid James Morris
2006-06-29 23:57 ` Greg KH
2006-06-29 0:16 ` [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion Chris Wright
2006-06-29 0:37 ` James Morris
2006-06-29 0:52 ` Chris Wright
2006-06-29 0:55 ` Andrew Morton
2006-06-29 1:45 ` James Morris
2006-06-29 15:31 ` Stephen Smalley
2006-06-29 15:43 ` James Morris
2006-06-29 15:54 ` Stephen Smalley
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=Pine.LNX.4.64.0606281945560.17159@d.namei \
--to=jmorris@namei.org \
--cc=akpm@osdl.org \
--cc=chrisw@sous-sol.org \
--cc=dpquigl@tycho.nsa.gov \
--cc=linux-kernel@vger.kernel.org \
--cc=sds@tycho.nsa.gov \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®