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 <sultan@kerneltoast.com>
Signed-off-by: Panchajanya1999 <kernel@panchajanya.dev>
This commit is contained in:
Sultan Alsawaf 2023-01-14 18:37:30 +05:30 committed by Ksawlii
parent 74cbd01416
commit 25da1fb9b2

View file

@ -380,6 +380,9 @@ static ssize_t cpu_latency_qos_write(struct file *filp, const char __user *buf,
{
s32 value;
/* 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;