bin/98905: [PATCH] devfs(8) segfaults if the ruleset doesn't end with a newline

Fabian Keil freebsd-listen at fabiankeil.de
Tue Jun 13 16:40:17 UTC 2006


>Number:         98905
>Category:       bin
>Synopsis:       [PATCH] devfs(8) segfaults if the ruleset doesn't end with a newline
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 13 16:40:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Fabian Keil
>Release:        RELENG_6
>Organization:
>Environment:
FreeBSD TP51.local 6.1-STABLE FreeBSD 6.1-STABLE #44: Fri Jun  9 20:00:13 CEST 2006     fk at TP51.local:/usr/obj/usr/src/sys/THINKPAD  i386
>Description:
devfs segfaults if the ruleset doesn't end with a newline.

The man page doesn't say if rulesets are required to
end with newlines, but at least the code looks as if
they are not supposed to.

Please note that I'm not using vanilla sources.
One of the patches I use is Jeremie Le Hen's SSP patch,
but the devfs code is the original one and the problem
looks like a "normal" segfault to me.
>How-To-Repeat:
fk at TP51 ~ $cat ~/test/pf-jail.rules
path pf hide
path pf unhidefk at TP51 ~ $
fk at TP51 ~ $sudo devfs rule -s 7 show
fk at TP51 ~ $sudo devfs rule -s 7 add - < ~/test/pf-jail.rules 
Segmentation fault: 11 (core dumped)
fk at TP51 ~ $sudo devfs rule -s 7 show
100 path pf hide

>Fix:
With:
http://www.fabiankeil.de/sourcecode/freebsd/devfs.c.diff
I get:
fk at TP51 ~ $cat ~/test/pf-jail.rules
path pf hide
path pf unhidefk at TP51 ~ $
fk at TP51 ~ $sudo devfs rule -s 7 show
fk at TP51 ~ $sudo devfs rule -s 7 add - < ~/test/pf-jail.rules 
fk at TP51 ~ $sudo devfs rule -s 7 show
100 path pf hide
200 path pf unhide

Not sure if strlcpy is allowed in the base or if
that's the best solution though.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list