lkml.org 
[lkml]   [2012]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] remove no longer use of pdflush interface
On Wed, 6 Jun 2012 11:21:27 +0800 Wanpeng Li <liwp.linux@gmail.com> wrote:

> >Secondly, this code will permit unprivileged users to flood the logs,
> >by repeatedly reading /proc/sys/vm/nr_pdflush_threads. We try to avoid
> >this, as it is a form of denial-of-service attack.
> >
> >This is a bit hard to fix. The typical way of addressing this is to
> >use printk_once(), so the message only appears once per boot. But that
> >doesn't work for a generic function - we'd need to add one bit of state
> >to the ctl_table to do this. We can of course do that, but it's not
> >obvious that it's _worth_ doing that just for handling obsolete
> >entries.
> >
> >So perhaps the solution is to give up on the generic proc_obsolete()
> >idea, and just add a handler specifically for nr_pdflush_threads, whcih
> >uses printk_once().
>
> What about modify the generic proc_obsolete just to put the warning message into
> the buffer, then transfer to userspace, in order to users can see this warning.Do
> you think this is a better idea?

err, no. That's deliberately corrupting the output of an existing
interface. In response to this change userspace might crash, hand over
root privileges or tune to a porn channel. Instead we should yield
a well-formed response such as "0" (or maybe non-zero, if a zero
response might be unexpected) and inform the system operator via
conventional means. ie: syslog.


\
 
 \ /
  Last update: 2012-06-06 06:41    [W:0.064 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site