]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - drivers/block/sunvdc.c
sunvdc: Remove VLA usage
authorKees Cook <keescook@chromium.org>
Mon, 8 Oct 2018 15:46:51 +0000 (08:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Oct 2018 18:09:34 +0000 (11:09 -0700)
commitff5d1a42096cd96e70546c97d92f01d10cbddc2d
tree5e117b880905b7b3a7368d9f65a16f2f9d7a8b34
parent0854ba5ff5c938307cd783e996b62c83f1ce923b
sunvdc: Remove VLA usage

In the quest to remove all stack VLA usage from the kernel[1], this moves
the math for cookies calculation into macros and allocates a fixed size
array for the maximum number of cookies and adds a runtime sanity check.
(Note that the size was always fixed, but just hidden from the compiler.)

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

Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/block/sunvdc.c