Re: [PATCH 3/4] staging: rtl8712: reduce stack usage, again

To: Arnd Bergmann <arnd@xxxxxxxx>
Subject: Re: [PATCH 3/4] staging: rtl8712: reduce stack usage, again
Cc: Kees Cook <keescook@xxxxxxxxxxxx>, Larry Finger <Larry.Finger@xxxxxxxxxxxx>, Florian Schilhabel <florian.c.schilhabel@xxxxxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, James Smart <>, Dick Kennedy <dick.kennedy@xxxxxxxxxxxx>, "James E . J . Bottomley" <jejb@xxxxxxxxxxxxx>, "Martin K . Petersen" <martin.petersen@xxxxxxxxxx>, "David S . Miller" <davem@xxxxxxxxxxxxx>, Wensong Zhang <wensong@xxxxxxxxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>, Julian Anastasov <ja@xxxxxx>, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, James Morris <jmorris@xxxxxxxxx>, linux-scsi@xxxxxxxxxxxxxxx, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>, devel@xxxxxxxxxxxxxxxxxxxx, Network Development <netdev@xxxxxxxxxxxxxxx>, lvs-devel@xxxxxxxxxxxxxxx, netfilter-devel <netfilter-devel@xxxxxxxxxxxxxxx>, coreteam@xxxxxxxxxxxxx, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>, Nishka Dasgupta <nishkadg.linux@xxxxxxxxx>
From: Willem de Bruijn <willemdebruijn.kernel@xxxxxxxxx>
Date: Fri, 28 Jun 2019 15:52:03 -0400
On Fri, Jun 28, 2019 at 8:41 AM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> An earlier patch I sent reduced the stack usage enough to get
> below the warning limit, and I could show this was safe, but with
> GCC_PLUGIN_STRUCTLEAK_BYREF_ALL, it gets worse again because large stack
> variables in the same function no longer overlap:
> drivers/staging/rtl8712/rtl871x_ioctl_linux.c: In function 
> 'translate_scan.isra.2':
> drivers/staging/rtl8712/rtl871x_ioctl_linux.c:322:1: error: the frame size of 
> 1200 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> Split out the largest two blocks in the affected function into two
> separate functions and mark those noinline_for_stack.
> Fixes: 8c5af16f7953 ("staging: rtl8712: reduce stack usage")
> Fixes: 81a56f6dcd20 ("gcc-plugins: structleak: Generalize to all variable 
> types")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>