Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19678
b: refs/heads/master
c: 6d94074
h: refs/heads/master
v: v3
  • Loading branch information
Davi Arnaut authored and Linus Torvalds committed Feb 3, 2006
1 parent 6754e96 commit 13425d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 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: 353368dffb56b066cbe00264581a56caf0241b29
refs/heads/master: 6d94074f0804143eac6bce72dc04447c0040e7d8
15 changes: 10 additions & 5 deletions trunk/security/keys/keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ asmlinkage long sys_add_key(const char __user *_type,
description = kmalloc(dlen + 1, GFP_KERNEL);
if (!description)
goto error;
description[dlen] = '\0';

ret = -EFAULT;
if (copy_from_user(description, _description, dlen + 1) != 0)
if (copy_from_user(description, _description, dlen) != 0)
goto error2;

/* pull the payload in if one was supplied */
Expand Down Expand Up @@ -161,9 +162,10 @@ asmlinkage long sys_request_key(const char __user *_type,
description = kmalloc(dlen + 1, GFP_KERNEL);
if (!description)
goto error;
description[dlen] = '\0';

ret = -EFAULT;
if (copy_from_user(description, _description, dlen + 1) != 0)
if (copy_from_user(description, _description, dlen) != 0)
goto error2;

/* pull the callout info into kernel space */
Expand All @@ -182,9 +184,10 @@ asmlinkage long sys_request_key(const char __user *_type,
callout_info = kmalloc(dlen + 1, GFP_KERNEL);
if (!callout_info)
goto error2;
callout_info[dlen] = '\0';

ret = -EFAULT;
if (copy_from_user(callout_info, _callout_info, dlen + 1) != 0)
if (copy_from_user(callout_info, _callout_info, dlen) != 0)
goto error3;
}

Expand Down Expand Up @@ -279,9 +282,10 @@ long keyctl_join_session_keyring(const char __user *_name)
name = kmalloc(nlen + 1, GFP_KERNEL);
if (!name)
goto error;
name[nlen] = '\0';

ret = -EFAULT;
if (copy_from_user(name, _name, nlen + 1) != 0)
if (copy_from_user(name, _name, nlen) != 0)
goto error2;
}

Expand Down Expand Up @@ -583,9 +587,10 @@ long keyctl_keyring_search(key_serial_t ringid,
description = kmalloc(dlen + 1, GFP_KERNEL);
if (!description)
goto error;
description[dlen] = '\0';

ret = -EFAULT;
if (copy_from_user(description, _description, dlen + 1) != 0)
if (copy_from_user(description, _description, dlen) != 0)
goto error2;

/* get the keyring at which to begin the search */
Expand Down

0 comments on commit 13425d4

Please sign in to comment.