Commit 90804bd5 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] setrlimit incorrectly allows hard limits to exceed soft limits

From:  Kingsley Cheung <kingsley@aurema.com>
parent d2a0e2b6
......@@ -1233,6 +1233,8 @@ asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit *rlim)
return -EINVAL;
if(copy_from_user(&new_rlim, rlim, sizeof(*rlim)))
return -EFAULT;
if (new_rlim.rlim_cur > new_rlim.rlim_max)
return -EINVAL;
old_rlim = current->rlim + resource;
if (((new_rlim.rlim_cur > old_rlim->rlim_max) ||
(new_rlim.rlim_max > old_rlim->rlim_max)) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment