Commit 7a01955f99b65622a00ba5c8b39202ddc6fa65f8
Committed by
Linus Torvalds
1 parent
8f95dc58d0
Exists in
master
and in
7 other branches
[PATCH] SELinux: update USB code with new kill_proc_info_as_uid
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> Cc: Stephen Smalley <sds@tycho.nsa.gov> Cc: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 3 changed files with 7 additions and 2 deletions Side-by-side Diff
drivers/usb/core/devio.c
... | ... | @@ -47,6 +47,7 @@ |
47 | 47 | #include <linux/usbdevice_fs.h> |
48 | 48 | #include <linux/cdev.h> |
49 | 49 | #include <linux/notifier.h> |
50 | +#include <linux/security.h> | |
50 | 51 | #include <asm/uaccess.h> |
51 | 52 | #include <asm/byteorder.h> |
52 | 53 | #include <linux/moduleparam.h> |
... | ... | @@ -68,6 +69,7 @@ |
68 | 69 | void __user *userbuffer; |
69 | 70 | void __user *userurb; |
70 | 71 | struct urb *urb; |
72 | + u32 secid; | |
71 | 73 | }; |
72 | 74 | |
73 | 75 | static int usbfs_snoop = 0; |
... | ... | @@ -312,7 +314,7 @@ |
312 | 314 | sinfo.si_code = SI_ASYNCIO; |
313 | 315 | sinfo.si_addr = as->userurb; |
314 | 316 | kill_proc_info_as_uid(as->signr, &sinfo, as->pid, as->uid, |
315 | - as->euid); | |
317 | + as->euid, as->secid); | |
316 | 318 | } |
317 | 319 | snoop(&urb->dev->dev, "urb complete\n"); |
318 | 320 | snoop_urb(urb, as->userurb); |
... | ... | @@ -572,6 +574,7 @@ |
572 | 574 | ps->disc_euid = current->euid; |
573 | 575 | ps->disccontext = NULL; |
574 | 576 | ps->ifclaimed = 0; |
577 | + security_task_getsecid(current, &ps->secid); | |
575 | 578 | wmb(); |
576 | 579 | list_add_tail(&ps->list, &dev->filelist); |
577 | 580 | file->private_data = ps; |
... | ... | @@ -1053,6 +1056,7 @@ |
1053 | 1056 | as->pid = current->pid; |
1054 | 1057 | as->uid = current->uid; |
1055 | 1058 | as->euid = current->euid; |
1059 | + security_task_getsecid(current, &as->secid); | |
1056 | 1060 | if (!(uurb->endpoint & USB_DIR_IN)) { |
1057 | 1061 | if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, as->urb->transfer_buffer_length)) { |
1058 | 1062 | free_async(as); |
drivers/usb/core/inode.c
... | ... | @@ -700,7 +700,7 @@ |
700 | 700 | sinfo.si_errno = EPIPE; |
701 | 701 | sinfo.si_code = SI_ASYNCIO; |
702 | 702 | sinfo.si_addr = ds->disccontext; |
703 | - kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid); | |
703 | + kill_proc_info_as_uid(ds->discsignr, &sinfo, ds->disc_pid, ds->disc_uid, ds->disc_euid, ds->secid); | |
704 | 704 | } |
705 | 705 | } |
706 | 706 | } |