2 Aug 2010 22:46
Re: [Security] [PATCH] bug in led_proc_write()
Helge Deller <deller <at> gmx.de>
2010-08-02 20:46:41 GMT
2010-08-02 20:46:41 GMT
* Andrew Morton <akpm <at> linux-foundation.org>:
> On Sat, 10 Nov 2007 23:50:29 +0100 Ilja <ilja <at> netric.org> wrote:
> > When reading some of the parisc driver code I stumbled on a bug in
> > led_proc_write() in drivers/parisc/led.c
> > the code looks like:
> >
> > 182 static int led_proc_write(struct file *file, const char *buf,
> > 183 unsigned long count, void *data)
> > 184 {
> > 185 char *cur, lbuf[count + 1];
> > 186 int d;
> > 187
> > 188 if (!capable(CAP_SYS_ADMIN))
> > 189 return -EACCES;
> > ....
> > 235 }
> >
> > the problem being that the stack is limited and count is not (except for the
> > MAX_INT check done in sys_write() I guess). this could lead to stack
> > corruption (when for example calling capable()).
>
> yes, and the bug's still there. It allows a writer to /proc/pdc/led(?)
> to cause the kernel to consume an unbounded amount of stack.
Ilja, Andrew,
Thanks for the bug report.
Below is a patch to fix this issue.
Kyle, please apply to the parisc git tree.
(Continue reading)
RSS Feed