Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169155
b: refs/heads/master
c: 825332e
h: refs/heads/master
i:
  169153: 8c941e2
  169151: 45e5d50
v: v3
  • Loading branch information
Arjan van de Ven authored and James Morris committed Oct 13, 2009
1 parent 3f1971d commit 65193df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a27ab9f26b729326778271c1efd895aef4fda1c4
refs/heads/master: 825332e4ff1373c55d931b49408df7ec2298f71e
9 changes: 6 additions & 3 deletions trunk/kernel/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ SYSCALL_DEFINE2(capget, cap_user_header_t, header, cap_user_data_t, dataptr)
SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data)
{
struct __user_cap_data_struct kdata[_KERNEL_CAPABILITY_U32S];
unsigned i, tocopy;
unsigned i, tocopy, copybytes;
kernel_cap_t inheritable, permitted, effective;
struct cred *new;
int ret;
Expand All @@ -255,8 +255,11 @@ SYSCALL_DEFINE2(capset, cap_user_header_t, header, const cap_user_data_t, data)
if (pid != 0 && pid != task_pid_vnr(current))
return -EPERM;

if (copy_from_user(&kdata, data,
tocopy * sizeof(struct __user_cap_data_struct)))
copybytes = tocopy * sizeof(struct __user_cap_data_struct);
if (copybytes > sizeof(kdata))
return -EFAULT;

if (copy_from_user(&kdata, data, copybytes))
return -EFAULT;

for (i = 0; i < tocopy; i++) {
Expand Down

0 comments on commit 65193df

Please sign in to comment.