* [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
@ 2006-06-28 23:45 James Morris
2006-06-28 23:46 ` [PATCH 2/3] SELinux: Add security hook call to kill_proc_info_as_uid James Morris
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: James Morris @ 2006-06-28 23:45 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, Stephen Smalley, Chris Wright, David Quigley
From: David Quigley <dpquigl@tycho.nsa.gov>
This patch extends the security_task_kill hook to handle signals sent by
AIO completion. In this case, the secid of the task responsible for the
signal needs to be obtained and saved earlier, so a
security_task_getsecid() hook is added, and then this saved value is
passed subsequently to the extended task_kill hook for use in checking.
Signed-Off-By: David Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Please apply.
---
include/linux/security.h | 23 +++++++++++++++++++----
security/dummy.c | 6 +++++-
security/selinux/hooks.c | 21 +++++++++++++++++----
3 files changed, 41 insertions(+), 9 deletions(-)
diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/include/linux/security.h linux-2.6.17-mm3-kill/include/linux/security.h
--- linux-2.6.17-mm3/include/linux/security.h 2006-06-28 13:58:59.000000000 -0400
+++ linux-2.6.17-mm3-kill/include/linux/security.h 2006-06-28 15:24:54.000000000 -0400
@@ -567,6 +567,9 @@ struct swap_info_struct;
* @p.
* @p contains the task_struct for the process.
* Return 0 if permission is granted.
+ * @task_getsecid:
+ * Retrieve the security identifier of the process @p.
+ * @p contains the task_struct for the process and place is into @secid.
* @task_setgroups:
* Check permission before setting the supplementary group set of the
* current process.
@@ -615,6 +618,7 @@ struct swap_info_struct;
* @p contains the task_struct for process.
* @info contains the signal information.
* @sig contains the signal value.
+ * @secid contains the sid of the process where the signal originated
* Return 0 if permission is granted.
* @task_wait:
* Check permission before allowing a process to reap a child process @p
@@ -1218,6 +1222,7 @@ struct security_operations {
int (*task_setpgid) (struct task_struct * p, pid_t pgid);
int (*task_getpgid) (struct task_struct * p);
int (*task_getsid) (struct task_struct * p);
+ void (*task_getsecid) (struct task_struct * p, u32 * secid);
int (*task_setgroups) (struct group_info *group_info);
int (*task_setnice) (struct task_struct * p, int nice);
int (*task_setioprio) (struct task_struct * p, int ioprio);
@@ -1227,7 +1232,7 @@ struct security_operations {
int (*task_getscheduler) (struct task_struct * p);
int (*task_movememory) (struct task_struct * p);
int (*task_kill) (struct task_struct * p,
- struct siginfo * info, int sig);
+ struct siginfo * info, int sig, u32 secid);
int (*task_wait) (struct task_struct * p);
int (*task_prctl) (int option, unsigned long arg2,
unsigned long arg3, unsigned long arg4,
@@ -1838,6 +1843,11 @@ static inline int security_task_getsid (
return security_ops->task_getsid (p);
}
+static inline void security_task_getsecid (struct task_struct *p, u32 *secid)
+{
+ security_ops->task_getsecid (p, secid);
+}
+
static inline int security_task_setgroups (struct group_info *group_info)
{
return security_ops->task_setgroups (group_info);
@@ -1877,9 +1887,10 @@ static inline int security_task_movememo
}
static inline int security_task_kill (struct task_struct *p,
- struct siginfo *info, int sig)
+ struct siginfo *info, int sig,
+ u32 secid)
{
- return security_ops->task_kill (p, info, sig);
+ return security_ops->task_kill (p, info, sig, secid);
}
static inline int security_task_wait (struct task_struct *p)
@@ -2490,6 +2501,9 @@ static inline int security_task_getsid (
return 0;
}
+static inline void security_task_getsecid (struct task_struct *p, u32 *secid)
+{ }
+
static inline int security_task_setgroups (struct group_info *group_info)
{
return 0;
@@ -2529,7 +2543,8 @@ static inline int security_task_movememo
}
static inline int security_task_kill (struct task_struct *p,
- struct siginfo *info, int sig)
+ struct siginfo *info, int sig,
+ u32 secid)
{
return 0;
}
diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/security/dummy.c linux-2.6.17-mm3-kill/security/dummy.c
--- linux-2.6.17-mm3/security/dummy.c 2006-06-28 13:58:59.000000000 -0400
+++ linux-2.6.17-mm3-kill/security/dummy.c 2006-06-28 14:25:52.000000000 -0400
@@ -506,6 +506,9 @@ static int dummy_task_getsid (struct tas
return 0;
}
+static void dummy_task_getsecid (struct task_struct *p, u32 *secid)
+{ }
+
static int dummy_task_setgroups (struct group_info *group_info)
{
return 0;
@@ -548,7 +551,7 @@ static int dummy_task_wait (struct task_
}
static int dummy_task_kill (struct task_struct *p, struct siginfo *info,
- int sig)
+ int sig, u32 secid)
{
return 0;
}
@@ -981,6 +984,7 @@ void security_fixup_ops (struct security
set_to_dummy_if_null(ops, task_setpgid);
set_to_dummy_if_null(ops, task_getpgid);
set_to_dummy_if_null(ops, task_getsid);
+ set_to_dummy_if_null(ops, task_getsecid);
set_to_dummy_if_null(ops, task_setgroups);
set_to_dummy_if_null(ops, task_setnice);
set_to_dummy_if_null(ops, task_setioprio);
diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/security/selinux/hooks.c linux-2.6.17-mm3-kill/security/selinux/hooks.c
--- linux-2.6.17-mm3/security/selinux/hooks.c 2006-06-28 13:58:59.000000000 -0400
+++ linux-2.6.17-mm3-kill/security/selinux/hooks.c 2006-06-28 14:40:00.000000000 -0400
@@ -45,6 +45,7 @@
#include <linux/kd.h>
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter_ipv6.h>
+#include <linux/selinux.h>
#include <linux/tty.h>
#include <net/icmp.h>
#include <net/ip.h> /* for sysctl_local_port_range[] */
@@ -2643,6 +2644,11 @@ static int selinux_task_getsid(struct ta
return task_has_perm(current, p, PROCESS__GETSESSION);
}
+static void selinux_task_getsecid(struct task_struct *p, u32 *secid)
+{
+ selinux_get_task_sid(p, secid);
+}
+
static int selinux_task_setgroups(struct group_info *group_info)
{
/* See the comment for setuid above. */
@@ -2699,12 +2705,14 @@ static int selinux_task_movememory(struc
return task_has_perm(current, p, PROCESS__SETSCHED);
}
-static int selinux_task_kill(struct task_struct *p, struct siginfo *info, int sig)
+static int selinux_task_kill(struct task_struct *p, struct siginfo *info,
+ int sig, u32 secid)
{
u32 perm;
int rc;
+ struct task_security_struct *tsec;
- rc = secondary_ops->task_kill(p, info, sig);
+ rc = secondary_ops->task_kill(p, info, sig, secid);
if (rc)
return rc;
@@ -2715,8 +2723,12 @@ static int selinux_task_kill(struct task
perm = PROCESS__SIGNULL; /* null signal; existence test */
else
perm = signal_to_av(sig);
-
- return task_has_perm(current, p, perm);
+ tsec = p->security;
+ if (secid)
+ rc = avc_has_perm(secid, tsec->sid, SECCLASS_PROCESS, perm, NULL);
+ else
+ rc = task_has_perm(current, p, perm);
+ return rc;
}
static int selinux_task_prctl(int option,
@@ -4429,6 +4441,7 @@ static struct security_operations selinu
.task_setpgid = selinux_task_setpgid,
.task_getpgid = selinux_task_getpgid,
.task_getsid = selinux_task_getsid,
+ .task_getsecid = selinux_task_getsecid,
.task_setgroups = selinux_task_setgroups,
.task_setnice = selinux_task_setnice,
.task_setioprio = selinux_task_setioprio,
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH 2/3] SELinux: Add security hook call to kill_proc_info_as_uid
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
2006-06-28 23:49 ` [PATCH 3/3] SELinux: Update USB code with new kill_proc_info_as_uid James Morris
2006-06-29 0:16 ` [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion Chris Wright
2 siblings, 0 replies; 12+ messages in thread
From: James Morris @ 2006-06-28 23:46 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, Stephen Smalley, Chris Wright, David Quigley
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);
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH 3/3] SELinux: Update USB code with new kill_proc_info_as_uid
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 ` [PATCH 2/3] SELinux: Add security hook call to kill_proc_info_as_uid James Morris
@ 2006-06-28 23:49 ` 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
2 siblings, 1 reply; 12+ messages in thread
From: James Morris @ 2006-06-28 23:49 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, Stephen Smalley, Chris Wright, David Quigley, gregkh
From: David Quigley <dpquigl@tycho.nsa.gov>
This patch updates the USB core to save and pass the sending task secid
when sending signals upon AIO completion so that proper security checking
can be applied by security modules.
Signed-Off-By: David Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Please apply.
---
drivers/usb/core/devio.c | 6 +++++-
drivers/usb/core/inode.c | 2 +-
drivers/usb/core/usb.h | 1 +
3 files changed, 7 insertions(+), 2 deletions(-)
diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/drivers/usb/core/devio.c linux-2.6.17-mm3-kill/drivers/usb/core/devio.c
--- linux-2.6.17-mm3/drivers/usb/core/devio.c 2006-06-28 13:58:55.000000000 -0400
+++ linux-2.6.17-mm3-kill/drivers/usb/core/devio.c 2006-06-28 14:32:30.000000000 -0400
@@ -47,6 +47,7 @@
#include <linux/usbdevice_fs.h>
#include <linux/cdev.h>
#include <linux/notifier.h>
+#include <linux/security.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#include <linux/moduleparam.h>
@@ -68,6 +69,7 @@ struct async {
void __user *userbuffer;
void __user *userurb;
struct urb *urb;
+ u32 secid;
};
static int usbfs_snoop = 0;
@@ -312,7 +314,7 @@ static void async_completed(struct urb *
sinfo.si_code = SI_ASYNCIO;
sinfo.si_addr = as->userurb;
kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid,
- as->euid);
+ as->euid, as->secid);
}
snoop(&urb->dev->dev, "urb complete\n");
snoop_urb(urb, as->userurb);
@@ -572,6 +574,7 @@ static int usbdev_open(struct inode *ino
ps->disc_euid = current->euid;
ps->disccontext = NULL;
ps->ifclaimed = 0;
+ security_task_getsecid(current, &ps->secid);
wmb();
list_add_tail(&ps->list, &dev->filelist);
file->private_data = ps;
@@ -1053,6 +1056,7 @@ static int proc_do_submiturb(struct dev_
as->pid = current->pid;
as->uid = current->uid;
as->euid = current->euid;
+ security_task_getsecid(current, &as->secid);
if (!(uurb->endpoint & USB_DIR_IN)) {
if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) {
free_async(as);
diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/drivers/usb/core/inode.c linux-2.6.17-mm3-kill/drivers/usb/core/inode.c
--- linux-2.6.17-mm3/drivers/usb/core/inode.c 2006-06-28 13:58:55.000000000 -0400
+++ linux-2.6.17-mm3-kill/drivers/usb/core/inode.c 2006-06-28 14:33:00.000000000 -0400
@@ -700,7 +700,7 @@ static void usbfs_remove_device(struct u
sinfo.si_errno = EPIPE;
sinfo.si_code = SI_ASYNCIO;
sinfo.si_addr = ds->disccontext;
- kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid);
+ kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid, ds->secid);
}
}
}
diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/drivers/usb/core/usb.h linux-2.6.17-mm3-kill/drivers/usb/core/usb.h
--- linux-2.6.17-mm3/drivers/usb/core/usb.h 2006-06-28 13:58:55.000000000 -0400
+++ linux-2.6.17-mm3-kill/drivers/usb/core/usb.h 2006-06-28 14:33:46.000000000 -0400
@@ -80,6 +80,7 @@ struct dev_state {
uid_t disc_uid, disc_euid;
void __user *disccontext;
unsigned long ifclaimed;
+ u32 secid;
};
/* internal notify stuff */
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 3/3] SELinux: Update USB code with new kill_proc_info_as_uid
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
0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2006-06-29 23:57 UTC (permalink / raw)
To: James Morris
Cc: Andrew Morton, linux-kernel, Stephen Smalley, Chris Wright,
David Quigley
On Wed, Jun 28, 2006 at 07:49:09PM -0400, James Morris wrote:
> From: David Quigley <dpquigl@tycho.nsa.gov>
>
> This patch updates the USB core to save and pass the sending task secid
> when sending signals upon AIO completion so that proper security checking
> can be applied by security modules.
>
> Signed-Off-By: David Quigley <dpquigl@tycho.nsa.gov>
> Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
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 ` [PATCH 2/3] SELinux: Add security hook call to kill_proc_info_as_uid James Morris
2006-06-28 23:49 ` [PATCH 3/3] SELinux: Update USB code with new kill_proc_info_as_uid James Morris
@ 2006-06-29 0:16 ` Chris Wright
2006-06-29 0:37 ` James Morris
2006-06-29 15:31 ` Stephen Smalley
2 siblings, 2 replies; 12+ messages in thread
From: Chris Wright @ 2006-06-29 0:16 UTC (permalink / raw)
To: James Morris
Cc: Andrew Morton, linux-kernel, Stephen Smalley, Chris Wright,
David Quigley
* James Morris (jmorris@namei.org) wrote:
> From: David Quigley <dpquigl@tycho.nsa.gov>
>
> This patch extends the security_task_kill hook to handle signals sent by
> AIO completion. In this case, the secid of the task responsible for the
> signal needs to be obtained and saved earlier, so a
> security_task_getsecid() hook is added, and then this saved value is
> passed subsequently to the extended task_kill hook for use in checking.
>
> Signed-Off-By: David Quigley <dpquigl@tycho.nsa.gov>
> Signed-off-by: James Morris <jmorris@namei.org>
>
>
> Please apply.
>
> ---
>
> include/linux/security.h | 23 +++++++++++++++++++----
> security/dummy.c | 6 +++++-
> security/selinux/hooks.c | 21 +++++++++++++++++----
> 3 files changed, 41 insertions(+), 9 deletions(-)
>
> diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/include/linux/security.h linux-2.6.17-mm3-kill/include/linux/security.h
> --- linux-2.6.17-mm3/include/linux/security.h 2006-06-28 13:58:59.000000000 -0400
> +++ linux-2.6.17-mm3-kill/include/linux/security.h 2006-06-28 15:24:54.000000000 -0400
> @@ -567,6 +567,9 @@ struct swap_info_struct;
> * @p.
> * @p contains the task_struct for the process.
> * Return 0 if permission is granted.
> + * @task_getsecid:
> + * Retrieve the security identifier of the process @p.
> + * @p contains the task_struct for the process and place is into @secid.
> * @task_setgroups:
> * Check permission before setting the supplementary group set of the
> * current process.
> @@ -615,6 +618,7 @@ struct swap_info_struct;
> * @p contains the task_struct for process.
> * @info contains the signal information.
> * @sig contains the signal value.
> + * @secid contains the sid of the process where the signal originated
> * Return 0 if permission is granted.
> * @task_wait:
> * Check permission before allowing a process to reap a child process @p
> @@ -1218,6 +1222,7 @@ struct security_operations {
> int (*task_setpgid) (struct task_struct * p, pid_t pgid);
> int (*task_getpgid) (struct task_struct * p);
> int (*task_getsid) (struct task_struct * p);
> + void (*task_getsecid) (struct task_struct * p, u32 * secid);
Why not just:
u32 (*task_getsecid) (struct task_struct *p);
> int (*task_setgroups) (struct group_info *group_info);
> int (*task_setnice) (struct task_struct * p, int nice);
> int (*task_setioprio) (struct task_struct * p, int ioprio);
> @@ -1227,7 +1232,7 @@ struct security_operations {
> int (*task_getscheduler) (struct task_struct * p);
> int (*task_movememory) (struct task_struct * p);
> int (*task_kill) (struct task_struct * p,
> - struct siginfo * info, int sig);
> + struct siginfo * info, int sig, u32 secid);
This breaks the build, which breaks bisection. Be nice to avoid that
since there's no reason the patches couldn't split that way.
> diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/security/selinux/hooks.c linux-2.6.17-mm3-kill/security/selinux/hooks.c
> --- linux-2.6.17-mm3/security/selinux/hooks.c 2006-06-28 13:58:59.000000000 -0400
> +++ linux-2.6.17-mm3-kill/security/selinux/hooks.c 2006-06-28 14:40:00.000000000 -0400
> @@ -45,6 +45,7 @@
> #include <linux/kd.h>
> #include <linux/netfilter_ipv4.h>
> #include <linux/netfilter_ipv6.h>
> +#include <linux/selinux.h>
It's already included.
thanks,
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
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 15:31 ` Stephen Smalley
1 sibling, 2 replies; 12+ messages in thread
From: James Morris @ 2006-06-29 0:37 UTC (permalink / raw)
To: Chris Wright; +Cc: Andrew Morton, linux-kernel, Stephen Smalley, David Quigley
On Wed, 28 Jun 2006, Chris Wright wrote:
> > diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/security/selinux/hooks.c linux-2.6.17-mm3-kill/security/selinux/hooks.c
> > --- linux-2.6.17-mm3/security/selinux/hooks.c 2006-06-28 13:58:59.000000000 -0400
> > +++ linux-2.6.17-mm3-kill/security/selinux/hooks.c 2006-06-28 14:40:00.000000000 -0400
> > @@ -45,6 +45,7 @@
> > #include <linux/kd.h>
> > #include <linux/netfilter_ipv4.h>
> > #include <linux/netfilter_ipv6.h>
> > +#include <linux/selinux.h>
>
> It's already included.
Not in the current Linus git tree.
$ cat .git/refs/heads/master
27d68a36c4f1ca2fc6be82620843493462c08c51
$ grep selinux\\.h security/selinux/hooks.c
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
2006-06-29 0:37 ` James Morris
@ 2006-06-29 0:52 ` Chris Wright
2006-06-29 0:55 ` Andrew Morton
1 sibling, 0 replies; 12+ messages in thread
From: Chris Wright @ 2006-06-29 0:52 UTC (permalink / raw)
To: James Morris
Cc: Chris Wright, Andrew Morton, linux-kernel, Stephen Smalley,
David Quigley
* James Morris (jmorris@namei.org) wrote:
> On Wed, 28 Jun 2006, Chris Wright wrote:
>
> > > diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/security/selinux/hooks.c linux-2.6.17-mm3-kill/security/selinux/hooks.c
> > > --- linux-2.6.17-mm3/security/selinux/hooks.c 2006-06-28 13:58:59.000000000 -0400
> > > +++ linux-2.6.17-mm3-kill/security/selinux/hooks.c 2006-06-28 14:40:00.000000000 -0400
> > > @@ -45,6 +45,7 @@
> > > #include <linux/kd.h>
> > > #include <linux/netfilter_ipv4.h>
> > > #include <linux/netfilter_ipv6.h>
> > > +#include <linux/selinux.h>
> >
> > It's already included.
>
> Not in the current Linus git tree.
>
> $ cat .git/refs/heads/master
> 27d68a36c4f1ca2fc6be82620843493462c08c51
>
> $ grep selinux\\.h security/selinux/hooks.c
Sorry, you're right, my tree is still patched with Catherine's AF_UNIX
getpeersec patch.
thanks,
-chris
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
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
1 sibling, 1 reply; 12+ messages in thread
From: Andrew Morton @ 2006-06-29 0:55 UTC (permalink / raw)
To: James Morris; +Cc: chrisw, linux-kernel, sds, dpquigl
James Morris <jmorris@namei.org> wrote:
>
> On Wed, 28 Jun 2006, Chris Wright wrote:
>
> > > diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/security/selinux/hooks.c linux-2.6.17-mm3-kill/security/selinux/hooks.c
> > > --- linux-2.6.17-mm3/security/selinux/hooks.c 2006-06-28 13:58:59.000000000 -0400
> > > +++ linux-2.6.17-mm3-kill/security/selinux/hooks.c 2006-06-28 14:40:00.000000000 -0400
> > > @@ -45,6 +45,7 @@
> > > #include <linux/kd.h>
> > > #include <linux/netfilter_ipv4.h>
> > > #include <linux/netfilter_ipv6.h>
> > > +#include <linux/selinux.h>
> >
> > It's already included.
>
> Not in the current Linus git tree.
>
> $ cat .git/refs/heads/master
> 27d68a36c4f1ca2fc6be82620843493462c08c51
>
> $ grep selinux\\.h security/selinux/hooks.c
>
Catherine's AF_UNIX patch adds the same include.
What's the relative importance/safety on all of these patches, btw? Does
Catherine go first?
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
2006-06-29 0:55 ` Andrew Morton
@ 2006-06-29 1:45 ` James Morris
0 siblings, 0 replies; 12+ messages in thread
From: James Morris @ 2006-06-29 1:45 UTC (permalink / raw)
To: Andrew Morton; +Cc: chrisw, linux-kernel, sds, dpquigl
On Wed, 28 Jun 2006, Andrew Morton wrote:
> James Morris <jmorris@namei.org> wrote:
> >
> > On Wed, 28 Jun 2006, Chris Wright wrote:
> >
> > > > diff -uprN -X /home/dpquigl/dontdiff linux-2.6.17-mm3/security/selinux/hooks.c linux-2.6.17-mm3-kill/security/selinux/hooks.c
> > > > --- linux-2.6.17-mm3/security/selinux/hooks.c 2006-06-28 13:58:59.000000000 -0400
> > > > +++ linux-2.6.17-mm3-kill/security/selinux/hooks.c 2006-06-28 14:40:00.000000000 -0400
> > > > @@ -45,6 +45,7 @@
> > > > #include <linux/kd.h>
> > > > #include <linux/netfilter_ipv4.h>
> > > > #include <linux/netfilter_ipv6.h>
> > > > +#include <linux/selinux.h>
> > >
> > > It's already included.
> >
> > Not in the current Linus git tree.
> >
> > $ cat .git/refs/heads/master
> > 27d68a36c4f1ca2fc6be82620843493462c08c51
> >
> > $ grep selinux\\.h security/selinux/hooks.c
> >
>
> Catherine's AF_UNIX patch adds the same include.
>
> What's the relative importance/safety on all of these patches, btw? Does
> Catherine go first?
I'd say Catherine's should go first.
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
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 15:31 ` Stephen Smalley
2006-06-29 15:43 ` James Morris
1 sibling, 1 reply; 12+ messages in thread
From: Stephen Smalley @ 2006-06-29 15:31 UTC (permalink / raw)
To: Chris Wright; +Cc: James Morris, Andrew Morton, linux-kernel, David Quigley
On Wed, 2006-06-28 at 17:16 -0700, Chris Wright wrote:
> > + void (*task_getsecid) (struct task_struct * p, u32 * secid);
>
> Why not just:
> u32 (*task_getsecid) (struct task_struct *p);
That's fine, although we should then change the SELinux exports as well
to be consistent (and convert them all to secid rather than sid or
ctxid, and eliminate duplication there that has crept in). That can be
done by later patch.
> > int (*task_kill) (struct task_struct * p,
> > - struct siginfo * info, int sig);
> > + struct siginfo * info, int sig, u32 secid);
>
> This breaks the build, which breaks bisection. Be nice to avoid that
> since there's no reason the patches couldn't split that way.
Not sure how one would split them - they are logically all one change
(change interface and all callers, propagating up the call chain). The
original split up was just for review purposes, by subsystem. We can
submit it as a single patch if that is preferable.
--
Stephen Smalley
National Security Agency
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
2006-06-29 15:31 ` Stephen Smalley
@ 2006-06-29 15:43 ` James Morris
2006-06-29 15:54 ` Stephen Smalley
0 siblings, 1 reply; 12+ messages in thread
From: James Morris @ 2006-06-29 15:43 UTC (permalink / raw)
To: Stephen Smalley; +Cc: Chris Wright, Andrew Morton, linux-kernel, David Quigley
On Thu, 29 Jun 2006, Stephen Smalley wrote:
> On Wed, 2006-06-28 at 17:16 -0700, Chris Wright wrote:
> > > + void (*task_getsecid) (struct task_struct * p, u32 * secid);
> >
> > Why not just:
> > u32 (*task_getsecid) (struct task_struct *p);
>
> That's fine, although we should then change the SELinux exports as well
> to be consistent (and convert them all to secid rather than sid or
> ctxid, and eliminate duplication there that has crept in). That can be
> done by later patch.
My preference is to leave it as-is, because these interfaces generally
return only error values. IMHO, it's always much clearer that way in any
case, for APIs like this.
- James
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] SELinux: Extend task_kill hook to handle signals sent by AIO completion
2006-06-29 15:43 ` James Morris
@ 2006-06-29 15:54 ` Stephen Smalley
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Smalley @ 2006-06-29 15:54 UTC (permalink / raw)
To: James Morris; +Cc: Chris Wright, Andrew Morton, linux-kernel, David Quigley
On Thu, 2006-06-29 at 11:43 -0400, James Morris wrote:
> On Thu, 29 Jun 2006, Stephen Smalley wrote:
>
> > On Wed, 2006-06-28 at 17:16 -0700, Chris Wright wrote:
> > > > + void (*task_getsecid) (struct task_struct * p, u32 * secid);
> > >
> > > Why not just:
> > > u32 (*task_getsecid) (struct task_struct *p);
> >
> > That's fine, although we should then change the SELinux exports as well
> > to be consistent (and convert them all to secid rather than sid or
> > ctxid, and eliminate duplication there that has crept in). That can be
> > done by later patch.
>
> My preference is to leave it as-is, because these interfaces generally
> return only error values. IMHO, it's always much clearer that way in any
> case, for APIs like this.
Ok, fine with me.
--
Stephen Smalley
National Security Agency
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-06-30 0:03 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/3] SELinux: Add security hook call to kill_proc_info_as_uid James Morris
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
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®