|
@@ -1151,7 +1151,7 @@ static ssize_t oom_score_adj_write(struct file *file, const char __user *buf,
|
|
|
goto err_task_lock;
|
|
|
}
|
|
|
|
|
|
- if (oom_score_adj < task->signal->oom_score_adj &&
|
|
|
+ if (oom_score_adj < task->signal->oom_score_adj_min &&
|
|
|
!capable(CAP_SYS_RESOURCE)) {
|
|
|
err = -EACCES;
|
|
|
goto err_sighand;
|
|
@@ -1164,6 +1164,8 @@ static ssize_t oom_score_adj_write(struct file *file, const char __user *buf,
|
|
|
atomic_dec(&task->mm->oom_disable_count);
|
|
|
}
|
|
|
task->signal->oom_score_adj = oom_score_adj;
|
|
|
+ if (has_capability_noaudit(current, CAP_SYS_RESOURCE))
|
|
|
+ task->signal->oom_score_adj_min = oom_score_adj;
|
|
|
/*
|
|
|
* Scale /proc/pid/oom_adj appropriately ensuring that OOM_DISABLE is
|
|
|
* always attainable.
|