lkml.org 
[lkml]   [2014]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] cmdline: Hide "debug" from /proc/cmdline
On Wed, 2 Apr 2014, Linus Torvalds wrote:

> > Which doesn't really protect you from tasks that do open()/write()/close()
> > cycle for /dev/kmsg write every 2ms though.
>
> I don't think we should try to protect against wilful bad behavior
> unless that is shown to be necessary. Yeah, if it turns out that
> systemd really does that just to mess with us, we'd need to extend it,
> but in the absence of proof to the contrary, maybe this simple
> attached patch works?
>
> TOTALLY UNTESTED. But it really isn't complex.

[ ... snip ... [
@@ -483,6 +484,8 @@ static ssize_t devkmsg_read(struct file *file, char __user *buf,

if (!user)
return -EBADF;
+ if (!___ratelimit(&user->rs, current->comm))
+ return 0;

I am admittedly rather new to this 'abuse the hell out of kernel
ringbuffer' thing, but shouldn't we better be limiting the
devkmsg_writev()?

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2014-04-03 02:21    [W:0.075 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site