Date: Tue, 13 Jun 2006 16:31:18 GMT From: Fabian Keil <freebsd-listen@fabiankeil.de> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/98905: [PATCH] devfs(8) segfaults if the ruleset doesn't end with a newline Message-ID: <200606131631.k5DGVIko005748@www.freebsd.org> Resent-Message-ID: <200606131640.k5DGeFUs033355@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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@TP51 ~ $cat ~/test/pf-jail.rules path pf hide path pf unhidefk@TP51 ~ $ fk@TP51 ~ $sudo devfs rule -s 7 show fk@TP51 ~ $sudo devfs rule -s 7 add - < ~/test/pf-jail.rules Segmentation fault: 11 (core dumped) fk@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@TP51 ~ $cat ~/test/pf-jail.rules path pf hide path pf unhidefk@TP51 ~ $ fk@TP51 ~ $sudo devfs rule -s 7 show fk@TP51 ~ $sudo devfs rule -s 7 add - < ~/test/pf-jail.rules fk@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200606131631.k5DGVIko005748>