Re: Should this happen?

From: Albert Cranford (ac9410@bellsouth.net)
Date: Fri May 05 2000 - 03:26:44 EST


Manfred Spraul wrote:
>
> Wakko Warner wrote:
> >
> > > > Also sprach Craig Whitmore:
> > > > } 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
>
> --
> Manfred
>
> --------------------------------------------------------------------------------------------------------------------------------
> Name: patch-misc
> patch-misc Type: C Code (text/plain)
> Encoding: 7bit

Worked well for me in 2.3. Please forward patch to Linus.
Later,
Albert
home1:/proc# cat misc
144 nvram
135 rtc
130 watchdog
134 apm_bios
home1:/proc# more misc
144 nvram
135 rtc
130 watchdog
134 apm_bios
home1:/proc#

-- 
Albert Cranford Deerfield Beach FL USA
ac9410@bellsouth.net

- 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