Re: [PATCH] net/ibm/emac: Remove VLA usage

From: David Miller
Date: Thu Sep 13 2018 - 20:32:37 EST


From: Kees Cook <keescook@xxxxxxxxxxxx>
Date: Thu, 13 Sep 2018 14:23:56 -0700

> In the quest to remove all stack VLA usage from the kernel[1], this
> removes the VLA used for the emac xaht registers size. Since the size
> of registers can only ever be 4 or 8, as detected in emac_init_config(),
> the max can be hardcoded and a runtime test added for robustness.
>
> [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@xxxxxxxxxxxxxx
>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Christian Lamparter <chunkeey@xxxxxxxxx>
> Cc: Ivan Mikhaylov <ivan@xxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx
> Co-developed-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>

Applied to net-next, thanks.