From: Yu Jiahua yujiahua1@huawei.com
hulk inclusion category: feature bugzilla: 175551 https://gitee.com/openeuler/kernel/issues/I4DDEL
--------------------------------
Add access control for sysctl_update_load_latency
Signed-off-by: Yu Jiahua yujiahua1@huawei.com Reviewed-by: Chen Hui judy.chenhui@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com --- kernel/sched/fair.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0183b177ee6b..96793d50c621 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -52,6 +52,9 @@ int sysctl_update_load_latency(struct ctl_table *table, int write, int latency = sysctl_load_tracking_latency; struct ctl_table t;
+ if (write && !capable(CAP_SYS_ADMIN)) + return -EPERM; + t = *table; t.data = &latency; t.extra1 = &min;