]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: raspberrypi: Remove VLA usage
authorKees Cook <keescook@chromium.org>
Fri, 29 Jun 2018 18:44:50 +0000 (11:44 -0700)
committerFlorian Fainelli <f.fainelli@gmail.com>
Mon, 9 Jul 2018 17:47:29 +0000 (10:47 -0700)
commite15d3825f6b12d467477ba4b588013a7879dc456
treef53f4d6e3dc3045f8c504445a3eec298f23a0409
parentc547959fa330e42eed35cd5bc7691ad174eb88de
firmware: raspberrypi: Remove VLA usage

In the quest to remove all stack VLA usage from the kernel[1], this
removes the VLA in favor of a maximum size and adds a sanity check.
Existing callers of the firmware interface never need more than 24
bytes (struct gpio_set_config). This chooses 32 just to stay ahead
of future growth.

v2: Fix the length passed to rpi_firmware_property_list (by anholt,
    acked by Kees).

[1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
drivers/firmware/raspberrypi.c