Bug 127042 - [pf] [patch] pf recursion panic if interface group is the same as the new interface name
Summary: [pf] [patch] pf recursion panic if interface group is the same as the new int...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-pf mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-02 12:10 UTC by Artis Caune
Modified: 2018-05-28 19:46 UTC (History)
0 users

See Also:


Attachments
file.diff (975 bytes, patch)
2008-09-02 12:10 UTC, Artis Caune
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Artis Caune 2008-09-02 12:10:01 UTC
On carp enabled kernels, there is interface group "carp" with all carpX interfaces as menbers.
If I change name for any carpX interface to "carp", pf will panic with recursive call to pfi_kif_update().




#487 0xffffffff801d92dc in pfi_kif_update (kif=0xffffff0001ec4700) at /usr/src/sys/contrib/pf/net/pf_if.c:525
#488 0xffffffff801d92dc in pfi_kif_update (kif=0xffffff0001ec4700) at /usr/src/sys/contrib/pf/net/pf_if.c:525
#489 0xffffffff801d92dc in pfi_kif_update (kif=0xffffff0001ec4700) at /usr/src/sys/contrib/pf/net/pf_if.c:525
#490 0xffffffff801d92dc in pfi_kif_update (kif=0xffffff0001ec4700) at /usr/src/sys/contrib/pf/net/pf_if.c:525
#491 0xffffffff801d92dc in pfi_kif_update (kif=0xffffff0001ec4700) at /usr/src/sys/contrib/pf/net/pf_if.c:525
#492 0xffffffff801d9c0d in pfi_attach_ifnet_event (arg=Variable "arg" is not available.
) at /usr/src/sys/contrib/pf/net/pf_if.c:895
#493 0xffffffff8053f9f0 in ifhwioctl (cmd=Variable "cmd" is not available.
) at pcpu.h:194
#494 0xffffffff80541871 in if_detach (ifp=0xffffff0001f0d800) at /usr/src/sys/net/if.c:730
#495 0xffffffff804e11f2 in kern_ioctl (td=0xffffff00030e09f0, fd=3, com=2149607720, data=0xffffff0001ea28e0 "carp0") at file.h:266
#496 0xffffffff804e1519 in ioctl (td=0xffffff00030e09f0, uap=0xffffffffafaf7be0) at /usr/src/sys/kern/sys_generic.c:570
#497 0xffffffff80730514 in syscall (frame=0xffffffffafaf7c70) at /usr/src/sys/amd64/amd64/trap.c:841
#498 0xffffffff8071614b in Xpage () at /usr/src/sys/amd64/amd64/exception.S:228
#499 0x0000000800722cfc in ?? ()

Fix: this patch will check:
*) if group name already exists when renaming interface
*) if interface already exists when adding interface to group


Patch attached with submission follows:
How-To-Repeat: # ifconfig em0 group externals
# ifconfig em0 name externals

or

# ifconfig carp0 create
# ifconfig carp0 name carp


but the following works fine:

# ifconfig em0 group externals
# ifconfig fxp0 name externals
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2008-09-02 23:34:07 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-pf

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:46:15 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.