Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jul 2012 23:50:30 +1000 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        Chris Rees <utisoft@gmail.com>
Cc:        freebsd-ipfw@freebsd.org
Subject:   Re: kern/165939: [ipw] security bug: incomplete firewall rules loaded if tables are used in ipfw.conf
Message-ID:  <20120715232828.T81219@sola.nimnet.asn.au>
In-Reply-To: <CADLo83-C_6=AMHejePkCLnRfQWKFUwvM7as5vSnJDRMULKH4vw@mail.gmail.com>
References:  <201207141614.q6EGEi7P024139@freefall.freebsd.org> <20120715025005.I74353@sola.nimnet.asn.au> <CADLo83-C_6=AMHejePkCLnRfQWKFUwvM7as5vSnJDRMULKH4vw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 14 Jul 2012 18:59:54 +0100, Chris Rees wrote:
 > On 14 Jul 2012 18:49, "Ian Smith" <smithi@nimnet.asn.au> wrote:
 > >
 > > On Sat, 14 Jul 2012, crees@freebsd.org wrote:
 > >  > http://www.freebsd.org/cgi/query-pr.cgi?pr=165939
[..]
 > >  > Description
 > >  > If user has tables used in /etc/ipfw.conf for example:
 > >  >
 > >  > table 1 add 64.6.108.239
 > >  >
 > >  > then firewall restart:
 > >  >
 > >  > /etc/rc.d/ipfw start
 > >  >
 > >  > fails with:
 > >  > Line 8: setsockopt(IP_FW_TABLE_ADD): File exists
 > >  > Firewall rules loaded.
 > >  >
 > >  > and incomplete ruleset is loaded. This is serious security problem.

I've likely said more than enough while awaiting team response, but does 
this still fail if in /etc/rc.conf you set either (should come to the 
same for your custom firewall_type=/etc/ipfw.conf via rc.firewall) of:

firewall_quiet="YES"
firewall_flags="-q"

Just that ipfw(8) reckons, noting the last sentence:

    -q	     Be quiet when executing the add, nat, zero, resetlog or flush
	     commands; (implies -f).  This is useful when updating rulesets by
	     executing multiple ipfw commands in a script (e.g.,
	     `sh /etc/rc.firewall'), or by processing a file with many ipfw
	     rules across a remote login session.  It also stops a table add
	     or delete from failing if the entry already exists or is not
	     present.

ie, with -q on table add commands, you shouldn't need to flush tables.

cheers, Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120715232828.T81219>