diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-07-13 11:20:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-07-14 10:07:40 +0200 |
commit | 2f8704aac5bd8165f0abf15e580561373ed53d4b (patch) | |
tree | 19c182fe765406b7111df094bab75a9a7412b0d9 /dts/src/arm/rk3288-thermal.dtsi | |
parent | 298727bc7931fe878fd72a1fa6f35c18bd7c593c (diff) | |
download | barebox-2f8704aac5bd8165f0abf15e580561373ed53d4b.tar.gz barebox-2f8704aac5bd8165f0abf15e580561373ed53d4b.tar.xz |
ubifs: fix crash building without decompressors
When building barebox with ubifs support, but without decompressors
enabled, we run into a NULL pointer dereference:
BUG: failure at lib/string.c:249/strncmp()!
BUG!
[<4fd8ea59>] (unwind_backtrace+0x1/0x78) from [<4fd014e5>] (panic+0x1d/0x34)
[<4fd014e5>] (panic+0x1d/0x34) from [<4fd65ed1>] (strncmp+0x2d/0x50)
[<4fd65ed1>] (strncmp+0x2d/0x50) from [<4fd784bb>] (compr_init+0x4b/0x70)
[<4fd784bb>] (compr_init+0x4b/0x70) from [<4fd78915>] (ubifs_compressors_init+0x15/0x40)
[<4fd78915>] (ubifs_compressors_init+0x15/0x40) from [<4fd78e89>] (ubifs_init+0x2d/0x48)
[<4fd78e89>] (ubifs_init+0x2d/0x48) from [<4fd01159>] (start_barebox+0x35/0x6c)
[<4fd01159>] (start_barebox+0x35/0x6c) from [<4fd8c9f3>] (barebox_non_pbl_start+0x127/0x170)
[<4fd8c9f3>] (barebox_non_pbl_start+0x127/0x170) from [<4fd00005>] (__bare_init_start+0x1/0xc)
This is because the loop in crypto_alloc_comp iterates over all possible
decompressors and then accesses comp->capi_name, which will be NULL for
unusable decompressors. Add a NULL check to handle this gracefully.
A check for alg_name isn't needed because it's already checked in
compr_init.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220713092047.1588210-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'dts/src/arm/rk3288-thermal.dtsi')
0 files changed, 0 insertions, 0 deletions