[OpenWrt-Devel] [RFC] netifd: Crash when netifd reload is handled during netifd startup

Felix Fietkau nbd at openwrt.org
Tue Jun 24 08:05:30 EDT 2014


On 2014-06-24 12:46, Hans Dedecker wrote:
> Netifd is crashing when when a network reload (ubus call network reload) is handled during the parsing of the network config in the function config_init_all (called from main) at startup.
> As an ubus_invoke function call is issued when the interfaces are created; ubus will also process the pending ubus calls in this case the network reload during the invoke.
> As netifd_reload calls again config_init_all network config will be parsed again; on return from netifd_reload the original config_init_all function call will continue but will crash as references hold to interface/device/etc ... lists are not correct anymore.
> This potential problem has always been present but due to netifd_reload timing behavior change in netifd commit 5db02763d61785529bef538f196c180e968b7c26 this problem can easily be triggered.
> To solve the issue I was thinking about deferring the network reload when the function config_init_all is parsing the config.
> Any opinion if this is the correct way to go or any other alternatives ?
Please try applying this patch to ubus:
http://nbd.name/libubus-req-defer.patch

It should ensure that no invoke will be processed while netifd is busy
with registering/unregistering objects or sending notify calls.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list