diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-05-23 08:27:56 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-05-24 09:03:08 +0200 |
commit | 870a0ef748ef3c4644a4072acf13e9f7f2e052f5 (patch) | |
tree | 7b78df078cd97ee0bafbf41a2731553d31b339d2 /arch/arm/mach-tegra | |
parent | d08f27e2ca9535471b547e1928a3199983aac712 (diff) | |
download | barebox-870a0ef748ef3c4644a4072acf13e9f7f2e052f5.tar.gz barebox-870a0ef748ef3c4644a4072acf13e9f7f2e052f5.tar.xz |
tlsf: fix internal overflow trying to allocate big buffers
The function adjust_request_size() has an unhandled failure mode:
If aligning a buffer up overflows SIZE_MAX, it will compute a way to
short buffer instead of propagating an error. Fix this by returning
0 in this case and checking for 0 whereever the function is called.
0 is a safe choice for an error code, because the function returns
at least block_size_min on success and 0 was already an error code
(that was just never handled).
Reported-by: Jonas Martin <j.martin@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220523062756.774153-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-tegra')
0 files changed, 0 insertions, 0 deletions