Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42663
b: refs/heads/master
c: 8fb4fc6
h: refs/heads/master
i:
  42661: cfd24ec
  42659: 46e101e
  42655: 515a99d
v: v3
  • Loading branch information
Guillem Jover authored and Linus Torvalds committed Dec 7, 2006
1 parent 684fd8c commit 240a2c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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: 3b17979bda74493633364c2c263b452b7788e350
refs/heads/master: 8fb4fc68ca391862b061b3d358a288ccf6abed39
6 changes: 4 additions & 2 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,6 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
char buffer[PROC_NUMBUF], *end;
int oom_adjust;

if (!capable(CAP_SYS_RESOURCE))
return -EPERM;
memset(buffer, 0, sizeof(buffer));
if (count > sizeof(buffer) - 1)
count = sizeof(buffer) - 1;
Expand All @@ -699,6 +697,10 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
task = get_proc_task(file->f_dentry->d_inode);
if (!task)
return -ESRCH;
if (oom_adjust < task->oomkilladj && !capable(CAP_SYS_RESOURCE)) {
put_task_struct(task);
return -EACCES;
}
task->oomkilladj = oom_adjust;
put_task_struct(task);
if (end - buffer == 0)
Expand Down

0 comments on commit 240a2c4

Please sign in to comment.