realtek: 6.6: harden fw_init_cmdline()
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 25 Aug 2024 17:22:28 +0000 (13:22 -0400)
committerSander Vanheule <sander@svanheule.net>
Sat, 14 Sep 2024 18:08:57 +0000 (20:08 +0200)
commitdc9fca1fd19a31af4a0e3f1e3c93306ce4bca8b0
tree79315cdc83c75ab9d82ff2a752f8dd0dce498ed5
parent9f8570b0ddc4304cdfa3a1407640b9ae8392c719
realtek: 6.6: harden fw_init_cmdline()

Some devices (e.g. HP JG924A) hand over other than expected kernel boot
arguments. Looking at these one can see:

fw_init_cmdline: fw_arg0=00020000
fw_init_cmdline: fw_arg1=00060000
fw_init_cmdline: fw_arg2=fffdffff
fw_init_cmdline: fw_arg3=0000416c

Especially fw_arg2 should be the pointer to the environment and it looks
very suspicous. It is not aligned and the address is outside KSEG0 and
KSEG1. Booting the device will result in a hang. Do better at verifying
the address.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Suggested-by: Bjørn Mork <bjorn@mork.no>
target/linux/realtek/patches-6.6/320-harden-fw_init_cmdline.patch [new file with mode: 0644]