Crash after failed UBIFS mount

Dr.-Ing. Martin Däumler SYS TEC electronic GmbH martin.daeumler at
Wed Mar 2 01:24:43 PST 2016


we encountered a problem of barebox tag 2015.05.0, which is also 
reproducible with tag 2016.01.0. Mounting an UBIFS file system partition 
fails (correctly) and barebox crashes while cleaning up. The call 
hierarchy is
as follows:

-mount() (fs/fs.c:1243): try to mount ubifs partition; call 
--register_device() (drivers/base/driver.c:138):
---match() (drivers/base/driver.c:117): look for a suitable device driver
----device_probe() (drivers/base/driver.c:82): ubifs partition fails to 
mount due to corrupted LEB
----device_probe(): delete device's 'active' list ('list_del(&dev->active)')
---match(): set device driver to NULL and return -1 to register_device()
--register_device(): return 0 (success) to mount()
-mount(): check device driver and call unregister_device() due to 
invalid driver
--unregister_device() (drivers/base/driver.c:180): delete device's 
'active' list the second time -> crash

Barebox does not crash if drivers/base/driver.c:92, i.e., list deletion 
in device_probe(), is removed. Is the removal of the list deletion a 
valid solution or does this have side effects?

With regards,
Martin Däumler

More information about the barebox mailing list