udevd: don't use monitor after manager_exit()
authorMartin Wilck <mwilck@suse.com>
Tue, 26 Nov 2019 17:39:09 +0000 (18:39 +0100)
committerMartin Wilck <mwilck@suse.com>
Tue, 26 Nov 2019 19:38:28 +0000 (20:38 +0100)
commit030f4571670537c76355c5d923468c9a61aa77e9
tree4afacbf8d11912cded1bc0be616a3bd162b32de8
parent3cabdc2345608b01e344a52fe6f8c3c378406ebc
udevd: don't use monitor after manager_exit()

If udevd receives an exit signal, it releases its reference on the udev
monitor in manager_exit(). If at this time a worker is hanging, and if
the event timeout for this worker expires before udevd exits, udevd
crashes in on_sigchld()->udev_monitor_send_device(), because the monitor
has already been freed.

Fix this by testing the validity of manager->monitor in on_sigchld().
src/udev/udevd.c