Re: Should this happen?

From: Wakko Warner (wakko@animx.eu.org)
Date: Fri May 05 2000 - 08:35:18 EST


> > > > } With 2.3.99-pre6 (haven't checked any other versions)
> > > > }
> > > > } [root@lennon /proc]# more misc
> > > > } Segmentation fault
> > > > } [root@lennon /proc]# cat misc
> > > > } 175 agpgart
> > > > } 63 tdfx
> > > > } 1 psaux
> > > > }
> > > > } I don't think this should happen..
> > > > }
> > > > IMHO, probably not. But it does this in "stable" kernels as well ;-)
> > > >
>
> Very simple&stupid bug:
> try
> strace dd if=/proc/misc bs=1
>
> read(fd,buf,1) returns more than 1 byte, thus it overruns a user space
> buffer in more, and crashes. It won't oops.
>
> I've attached an untested patch, it should fix the bug in 2.2 & 2.3

I tried it on a number of machines. It seems that if there is something in
/proc/misc, more will segfault, if there's nothing in it, it doesn't.

None of my machines have anything in /proc/misc except for my laptop.

Interesting

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:17 EST