Re: HEADS UP: device name checking on device registration
On 2010-10-12, Andriy Gapon wrote: > on 12/10/2010 16:36 Matthew Jacob said the following: > > Good workaround, still a nasty surprising bug. > > Yeah. I also would prefer ignoring such a partition or somehow sanitizing its > name or etc. panic(9) on bad internal state of a kernel sounds appropriate, > panic(9) on bad input sounds like trouble. I am working on a change for GEOM. I will post a patch to -geom for comments shortly. I want just to note that previously bad names could cause erratic behavior (including panics) deep in devfs code instead of catching them early. -- Jaakko ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: HEADS UP: device name checking on device registration
I am antisocial. Okay, changed it so my replies are above the quotes. Seems to have attributes here. And I usually hit 'reply list' since multiple copies burns bandwidth. On 10/12/2010 1:57 PM, Andriy Gapon wrote: P.S. Matthew, it seems like you have a really unhelpful mail client program: first, it top-posts :-) second, it doesn't always attribute quoted text. It also doesn't cc in replies the addresses that were in to or cc of original message, which may or may not be a good thing. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: HEADS UP: device name checking on device registration
on 12/10/2010 16:36 Matthew Jacob said the following: > Good workaround, still a nasty surprising bug. Yeah. I also would prefer ignoring such a partition or somehow sanitizing its name or etc. panic(9) on bad internal state of a kernel sounds appropriate, panic(9) on bad input sounds like trouble. P.S. Matthew, it seems like you have a really unhelpful mail client program: first, it top-posts :-) second, it doesn't always attribute quoted text. It also doesn't cc in replies the addresses that were in to or cc of original message, which may or may not be a good thing. >> On 2010-10-11, barbara wrote: >>> The panic is caused by: >>> g_dev_taste(): make_dev_p() failed (gp->name=ext2fs//, error=22) >>> as I have a linux partition (I swear, it's for my mom!) on the same machine. >>> As I don't care about that partition (being ext4 I can't even mount >>> it), is there any solution other then applying the patch after every >>> csup? >> If you don't need ext2fs labels you can put the following line to >> /boot/loader.conf as a workaround: >> >> kern.geom.label.ext2fs.enable=0 -- Andriy Gapon ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: HEADS UP: device name checking on device registration
Good workaround, still a nasty surprising bug. On 2010-10-11, barbara wrote: The panic is caused by: g_dev_taste(): make_dev_p() failed (gp->name=ext2fs//, error=22) as I have a linux partition (I swear, it's for my mom!) on the same machine. As I don't care about that partition (being ext4 I can't even mount it), is there any solution other then applying the patch after every csup? If you don't need ext2fs labels you can put the following line to /boot/loader.conf as a workaround: kern.geom.label.ext2fs.enable=0 ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: HEADS UP: device name checking on device registration
On 2010-10-11, barbara wrote: > The panic is caused by: > g_dev_taste(): make_dev_p() failed (gp->name=ext2fs//, error=22) > as I have a linux partition (I swear, it's for my mom!) on the same machine. > As I don't care about that partition (being ext4 I can't even mount > it), is there any solution other then applying the patch after every > csup? If you don't need ext2fs labels you can put the following line to /boot/loader.conf as a workaround: kern.geom.label.ext2fs.enable=0 -- Jaakko ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
HEADS UP: device name checking on device registration
Since r213526 device names are checked on device registration. That is, if you call a make_dev*() function with an invalid device name, a panic will occur by default. For make_dev_credf(9) or make_dev_p(9) you can specify the MAKEDEV_CHECKNAME flag to get an error return instead of a panic. Invalid names are as follows: - empty name - names longer than SPECNAMELEN - names containing "." or ".." path component - names ending with '/' - already existing device names So, if you see a "bad si_name" panic you may have encountered a driver bug. Currently several GEOM classes (notably geom_label) allow to create devices with invalid names. Below is a link to a patch which converts g_dev_taste() to use make_dev_p() with MAKEDEV_CHECKNAME flag. It's not a complete solution and essentially changes the panic to a printf. http://people.freebsd.org/~jh/patches/geom_dev-checkname.diff -- Jaakko ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"