system/5130: pfctl dumps core when parsing group:network when a group member has no IP

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

system/5130: pfctl dumps core when parsing group:network when a group member has no IP

andrew fresh
>Number:         5130
>Category:       system
>Synopsis:       pfctl dumps core when parsing group:network when a group member has no IP
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 22 19:40:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Fresh
>Release:        OpenBSD 3.9 release and -stable
>Organization:
Red River Communications

>Environment:
        <machine, os, target, libraries (multiple lines)>
        System      : OpenBSD 3.9
        Architecture: OpenBSD.i386
        Machine     : i386

>Description:
        If I set up a group with one interface having an IP and a
second interface having no IP when I reference group:network in pf.conf,
pfctl core dumps.  A single interface in the group with no IP doesn't
cause the problem.

It happens on both of these kernels:

OpenBSD 3.9 (GENERIC) #617: Thu Mar  2 02:26:48 MST 2006
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC

and

OpenBSD 3.9-stable (GENERIC.MP) #0: Fri May  5 18:54:04 MST 2006
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC.MP

>How-To-Repeat:
        sis1 and sis2 here are used in the example because the box I was
testing with was a soekris.  I also got the same results on another box
with de cards.  If it turns out that that it only happens on my setup I
can get dmesg's from the boxes I tested on.  The soekris is a net4801
with no additional cards plugged in.

# ifconfig sis1 10.35.254.1 netmask 255.255.255.0
# ifconfig sis1 up
# ifconfig sis1 group test

# ifconfig sis2 up
# ifconfig sis2 group test

$ echo "pass in on test from test:network" > pf.test.conf

$ pfctl -nf pf.test.conf
Segmentation fault (core dumped)

>Fix:
        Don't do stupid things with interface groups.  Other than that I
am not sure.


>Release-Note:
>Audit-Trail:
>Unformatted:

Reply | Threaded
Open this post in threaded view
|

Re: system/5130: pfctl dumps core when parsing group:network when a group member has no IP

Henning Brauer-3
The following reply was made to PR system/5130; it has been noted by GNATS.

From: Henning Brauer <[hidden email]>
To: andrew fresh <[hidden email]>
Cc: [hidden email]
Subject: Re: system/5130: pfctl dumps core when parsing group:network when a group member has no IP
Date: Mon, 22 May 2006 22:03:16 +0200

 * andrew fresh <[hidden email]> [2006-05-22 21:52]:
 > >Number:         5130
 > >Category:       system
 > >Synopsis:       pfctl dumps core when parsing group:network when a group member has no IP
 > >Confidential:   yes
 > >Severity:       non-critical
 > >Priority:       medium
 > >Responsible:    bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:      
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Mon May 22 19:40:01 GMT 2006
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Andrew Fresh
 > >Release:        OpenBSD 3.9 release and -stable
 > >Organization:
 > Red River Communications
 >
 > >Environment:
 > <machine, os, target, libraries (multiple lines)>
 > System      : OpenBSD 3.9
 > Architecture: OpenBSD.i386
 > Machine     : i386
 >
 > >Description:
 > If I set up a group with one interface having an IP and a
 > second interface having no IP when I reference group:network in pf.conf,
 > pfctl core dumps.  A single interface in the group with no IP doesn't
 > cause the problem.
 > >How-To-Repeat:
 > sis1 and sis2 here are used in the example because the box I was
 > testing with was a soekris.  I also got the same results on another box
 > with de cards.  If it turns out that that it only happens on my setup I
 > can get dmesg's from the boxes I tested on.  The soekris is a net4801
 > with no additional cards plugged in.
 >
 > # ifconfig sis1 10.35.254.1 netmask 255.255.255.0
 > # ifconfig sis1 up
 > # ifconfig sis1 group test
 >
 > # ifconfig sis2 up
 > # ifconfig sis2 group test
 >
 > $ echo "pass in on test from test:network" > pf.test.conf
 >
 > $ pfctl -nf pf.test.conf
 > Segmentation fault (core dumped)
 
 hmm, I cannot reproduce that on current.
 
 <brahe@skywalker>  $ ifconfig foo                                        
     
 em0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
         lladdr 00:0a:e4:30:e9:09
         groups: foo
         media: Ethernet autoselect (none)
         status: no carrier
 <brahe@skywalker>  $ echo "pass in on foo from foo:network" | pfctl -nf -
 no IP address found for foo:network
 stdin:1: could not parse host specification
 <brahe@skywalker>  $ sudo ifconfig wi0 group foo
 <brahe@skywalker>  $ echo "pass in on foo from foo:network" | pfctl -nvf -
 pass in on foo inet from 172.16.43.0/24 to any
 <brahe@skywalker>  $
 
 --
 BS Web Services, http://www.bsws.de/
 OpenBSD-based Webhosting, Mail Services, Managed Servers, ...
 Unix is very simple, but it takes a genius to understand the simplicity.
 (Dennis Ritchie)

Reply | Threaded
Open this post in threaded view
|

Re: system/5130: pfctl dumps core when parsing group:network when a group member has no IP

Henning Brauer-3
In reply to this post by andrew fresh
The following reply was made to PR system/5130; it has been noted by GNATS.

From: Henning Brauer <[hidden email]>
To: andrew fresh <[hidden email]>
Cc: [hidden email]
Subject: Re: system/5130: pfctl dumps core when parsing group:network when a group member has no IP
Date: Tue, 23 May 2006 13:34:22 +0200

 * andrew fresh <[hidden email]> [2006-05-22 21:52]:
 > If I set up a group with one interface having an IP and a
 > second interface having no IP when I reference group:network in pf.conf,
 > pfctl core dumps.
 
 fix:
 
 Index: pfctl_parser.c
 ===================================================================
 RCS file: /cvs/src/sbin/pfctl/pfctl_parser.c,v
 retrieving revision 1.223
 diff -u -p -r1.223 pfctl_parser.c
 --- pfctl_parser.c 21 Mar 2006 03:31:09 -0000 1.223
 +++ pfctl_parser.c 23 May 2006 11:26:04 -0000
 @@ -1225,7 +1225,8 @@ ifa_grouplookup(const char *ifa_name, in
  for (ifg = ifgr.ifgr_groups; ifg && len >= sizeof(struct ifg_req);
     ifg++) {
  len -= sizeof(struct ifg_req);
 - n = ifa_lookup(ifg->ifgrq_member, flags);
 + if ((n = ifa_lookup(ifg->ifgrq_member, flags)) == NULL)
 + continue;
  if (h == NULL)
  h = n;
  else {
 
 --
 BS Web Services, http://www.bsws.de/
 OpenBSD-based Webhosting, Mail Services, Managed Servers, ...
 Unix is very simple, but it takes a genius to understand the simplicity.
 (Dennis Ritchie)