diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 14:43:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-28 14:43:54 -0500 |
commit | bb26c6c29b7cc9f39e491b074b09f3c284738d36 (patch) | |
tree | c7867af2bb4ff0feae889183efcd4d79b0f9a325 /drivers/usb | |
parent | e14e61e967f2b3bdf23f05e4ae5b9aa830151a44 (diff) | |
parent | cbacc2c7f066a1e01b33b0e27ae5efbf534bc2db (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (105 commits)
SELinux: don't check permissions for kernel mounts
security: pass mount flags to security_sb_kern_mount()
SELinux: correctly detect proc filesystems of the form "proc/foo"
Audit: Log TIOCSTI
user namespaces: document CFS behavior
user namespaces: require cap_set{ug}id for CLONE_NEWUSER
user namespaces: let user_ns be cloned with fairsched
CRED: fix sparse warnings
User namespaces: use the current_user_ns() macro
User namespaces: set of cleanups (v2)
nfsctl: add headers for credentials
coda: fix creds reference
capabilities: define get_vfs_caps_from_disk when file caps are not enabled
CRED: Allow kernel services to override LSM settings for task actions
CRED: Add a kernel_service object class to SELinux
CRED: Differentiate objective and effective subjective credentials on a task
CRED: Documentation
CRED: Use creds in file structs
CRED: Prettify commoncap.c
CRED: Make execve() take advantage of copy-on-write credentials
...
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/devio.c | 10 | ||||
-rw-r--r-- | drivers/usb/core/inode.c | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 2bccefebff1b..aa79280df15d 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -574,6 +574,7 @@ static int usbdev_open(struct inode *inode, struct file *file) | |||
574 | { | 574 | { |
575 | struct usb_device *dev = NULL; | 575 | struct usb_device *dev = NULL; |
576 | struct dev_state *ps; | 576 | struct dev_state *ps; |
577 | const struct cred *cred = current_cred(); | ||
577 | int ret; | 578 | int ret; |
578 | 579 | ||
579 | lock_kernel(); | 580 | lock_kernel(); |
@@ -617,8 +618,8 @@ static int usbdev_open(struct inode *inode, struct file *file) | |||
617 | init_waitqueue_head(&ps->wait); | 618 | init_waitqueue_head(&ps->wait); |
618 | ps->discsignr = 0; | 619 | ps->discsignr = 0; |
619 | ps->disc_pid = get_pid(task_pid(current)); | 620 | ps->disc_pid = get_pid(task_pid(current)); |
620 | ps->disc_uid = current->uid; | 621 | ps->disc_uid = cred->uid; |
621 | ps->disc_euid = current->euid; | 622 | ps->disc_euid = cred->euid; |
622 | ps->disccontext = NULL; | 623 | ps->disccontext = NULL; |
623 | ps->ifclaimed = 0; | 624 | ps->ifclaimed = 0; |
624 | security_task_getsecid(current, &ps->secid); | 625 | security_task_getsecid(current, &ps->secid); |
@@ -967,6 +968,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
967 | struct usb_host_endpoint *ep; | 968 | struct usb_host_endpoint *ep; |
968 | struct async *as; | 969 | struct async *as; |
969 | struct usb_ctrlrequest *dr = NULL; | 970 | struct usb_ctrlrequest *dr = NULL; |
971 | const struct cred *cred = current_cred(); | ||
970 | unsigned int u, totlen, isofrmlen; | 972 | unsigned int u, totlen, isofrmlen; |
971 | int ret, ifnum = -1; | 973 | int ret, ifnum = -1; |
972 | int is_in; | 974 | int is_in; |
@@ -1174,8 +1176,8 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
1174 | as->signr = uurb->signr; | 1176 | as->signr = uurb->signr; |
1175 | as->ifnum = ifnum; | 1177 | as->ifnum = ifnum; |
1176 | as->pid = get_pid(task_pid(current)); | 1178 | as->pid = get_pid(task_pid(current)); |
1177 | as->uid = current->uid; | 1179 | as->uid = cred->uid; |
1178 | as->euid = current->euid; | 1180 | as->euid = cred->euid; |
1179 | security_task_getsecid(current, &as->secid); | 1181 | security_task_getsecid(current, &as->secid); |
1180 | if (!is_in) { | 1182 | if (!is_in) { |
1181 | if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, | 1183 | if (copy_from_user(as->urb->transfer_buffer, uurb->buffer, |
diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 94632264dccf..185be760833e 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c | |||
@@ -277,8 +277,8 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t de | |||
277 | 277 | ||
278 | if (inode) { | 278 | if (inode) { |
279 | inode->i_mode = mode; | 279 | inode->i_mode = mode; |
280 | inode->i_uid = current->fsuid; | 280 | inode->i_uid = current_fsuid(); |
281 | inode->i_gid = current->fsgid; | 281 | inode->i_gid = current_fsgid(); |
282 | inode->i_blocks = 0; | 282 | inode->i_blocks = 0; |
283 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 283 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
284 | switch (mode & S_IFMT) { | 284 | switch (mode & S_IFMT) { |