[BusyBox] telnetd in kernel 2.6 segfaults (devfs)

Ignacio García Pérez iggarpe at terra.es
Wed Feb 9 20:52:32 UTC 2005


After some more investigation, I think it is not a busybox related problem:

In kernel 2.4, if you execute "cat /dev/ptmx" in one console, and do a
"ls -la /dev/pts", you'll see a "0" file which is the slave PTY
corresponding to the open("/dev/ptmx") that the "cat" does.

If you do the same in kernel 2.6, no "0" file appears. The ptsname() call
sets errno = ENOENT ("No such file...").

I think it's very unlikely that it is a kernel 2.6 bug (I'm using 2.6.9),
because it would be SO evident it would have been fixed before the release.
So it is most likely to be a problem caused by the combination of kernel
2.6, glibc, and my minimal root filesystem. I'm probably missing something
glibc requires, though I've examined the glibc sources and just can't
imagine what it is.

> -----Original Message-----
> From: busybox-bounces at mail.busybox.net
> [mailto:busybox-bounces at mail.busybox.net]On Behalf Of Rich Ireland
> Sent: miércoles, 09 de febrero de 2005 21:15
> To: busybox at mail.busybox.net
> Subject: Re: [BusyBox] telnetd in kernel 2.6 segfaults (devfs)
>
>
> Ignacio García Pérez wrote:
> >
> > I'm using busybox-1.00, with a minimal root filesystem. I use devfs.
>  >
> > If I load kernel 2.6.9, telnetd segfaults upon the first connection.
> >
> > If I load kernel 2.4.29, telnetd runs file.
>
> Just as another datapoint, I see similar behavior on an Atmel at91rm9200
> (csb337) with an ext2 ram initrd.  I had thought that I had a broken
> build since I used glibc instead of uClibc.
>
> > I have traced the problem down to the ptsname() call. Under
> kernel 2.4 it
> > returns "/dev/pts/0", while under kernel 2.6 it returns NULL. As telnetd
> > does not do error checking, hence the segfault.
> >
> > I have devfs enabled in both kernels, and also the pty
> filesystem is enabled
> > (note that under kernel 2.6, open("/dev/ptmx") returns a valid handle).
> >
> > Any clues?
>
> None from this mostly linux newbie.
>
> --
> Rich Ireland
> Firmware Engineer - Perforce Advocate
> Idaho Technology, Inc.
> http://www.idahotech.com/
> mailto:rich.ireland at idahotech.com
>
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.6 - Release Date: 07/02/2005




More information about the busybox mailing list