printk: Don't allow userspace to write to /dev/kmsg
There is extensive spam in dmesg because of userspace.
This kills all "init", "healthd", "logd" messages in kernel logs and makes them
more readable.
Extracted from 59f163ac76
.
Signed-off-by: idkwhoiam322 <idkwhoiam322@raphielgang.org>
Signed-off-by: prorooter007 <shreyashwasnik112@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
This commit is contained in:
parent
311d21b734
commit
f434223a87
1 changed files with 3 additions and 0 deletions
|
@ -768,6 +768,9 @@ static ssize_t devkmsg_write(struct kiocb *iocb, struct iov_iter *from)
|
|||
size_t len = iov_iter_count(from);
|
||||
ssize_t ret = len;
|
||||
|
||||
/* Don't allow userspace to write to /dev/kmesg */
|
||||
return len;
|
||||
|
||||
if (!user || len > LOG_LINE_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
Loading…
Reference in a new issue