netifd: segfault on teardown when using proto static on dynamically added interface

Martin Schiller ms at dev.tdt.de
Fri Jan 15 06:01:45 EST 2021


Hi!

In my work on https://github.com/openwrt/openwrt/pull/2759 (umbim /
wwan: bugfixes + support for non-dhcp devices), I ran into a problem
ith netifd.

If you use the "static" protocol for a dynamically created interface,
the netifd throws a segfault on "ifdown" of the parent interface.

This is how I create the dynamic interface:

https://github.com/openwrt/openwrt/pull/2759/files#diff-3721d970f207cbcaaa5251bf32caa91ab96818fae68cf0e9f15ea572a0d2dc22R161

It seems to be related to the flag "PROTO_FLAG_IMMEDIATE" of proto
static, whereby in __interface_set_down() the iface gets already freed
before the last interface_flush_state(iface) call.

Regards,
Martin



More information about the openwrt-devel mailing list