From d30b7253ed26d052f175f9e9d264c1478d70ac10 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Fri, 3 May 2019 00:34:19 -0700 Subject: [PATCH] qos: Don't allow userspace to impose restrictions on CPU idle levels Giving userspace intimate control over CPU latency requirements is nonsense. Userspace can't even stop itself from being preempted, so there's no reason for it to have access to a mechanism primarily used to eliminate CPU delays on the order of microseconds. Remove userspace's ability to send pm_qos requests so that it can't hurt power consumption. Signed-off-by: Sultan Alsawaf --- kernel/power/qos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/power/qos.c b/kernel/power/qos.c index 2027e7e6b..c85354cbc 100755 --- a/kernel/power/qos.c +++ b/kernel/power/qos.c @@ -383,6 +383,9 @@ static ssize_t cpu_latency_qos_write(struct file *filp, const char __user *buf, /* Don't let userspace impose restrictions on CPU idle levels */ return count; + /* Don't let userspace impose restrictions on CPU idle levels */ + return count; + if (count == sizeof(s32)) { if (copy_from_user(&value, buf, sizeof(s32))) return -EFAULT;