mknod bug (in uClibc)

Rob Landley rob at landley.net
Fri Nov 14 04:21:19 UTC 2008


On Thursday 13 November 2008 18:55:31 Doug Graham wrote:
> On Thu, Nov 13, 2008 at 06:48:41PM -0600, Rob Landley wrote:
> > On Thursday 13 November 2008 13:35:57 Doug Graham wrote:
> > > This is probably the wrong mailing list to report this bug to, but it's
> > > the one I subscribe to, and this bug is relevant to this list, so you
> > > might be interested.
> > >
> > > uClibc's mknod implementation looks like this:
> >
> > Not only a report to the wrong list, but no mention of which version you
> > encountered the problem in (when said project had a new release
> > _yesterday_).
>
> Well, I shouldn't think it would be too hard to check the latest release
> to see if this bug still exists, but you're right, I should have mentioned
> which release I was looking at.  It was uClibc-0.9.30 (today's release).

Ok, worth taking 15 minutes to look at then.

mknod.c is getting major() and minor() macros out of include/sys/sysmacros.h, 
where major() minor() and makedev() are redirected to gnu_dev_*, which is 
insane for 3 reasons:

1) What does gnu have to do with anything?  We're making a linux kernel 
syscall.
2) It's messing around with 64 bit numbers, but kdev_t is a 32 bit number.  
(The whole << 32 bit is just bloat that's going to get chopped off, as is the 
gratuitous conversion to long long on 32 bit platforms.)
3) In this case, dev_t and kdev_t should be in exactly the same format, so if 
it was working _correctly_ the translation would be a NOP.

Possibly the attached patch?

Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mknod.patch
Type: text/x-diff
Size: 571 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20081113/3cf4b5ee/attachment.bin 


More information about the uClibc mailing list