OSDN Git Service

caif: reduce stack size with KASAN
authorArnd Bergmann <arnd@arndb.de>
Tue, 16 Jan 2018 16:34:00 +0000 (17:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:19:07 +0000 (07:19 +0200)
commitff5ca554b16608b2a35665210e62b5afb4429f51
tree3d7354dd7c34990b0fca5635b242e06e6c0a99a2
parentee254b4d2912ea566e95f605c50b5265e585522a
caif: reduce stack size with KASAN

commit ce6289661b14a8b391d90db918c91b6d6da6540a upstream.

When CONFIG_KASAN is set, we can use relatively large amounts of kernel
stack space:

net/caif/cfctrl.c:555:1: warning: the frame size of 1600 bytes is larger than 1280 bytes [-Wframe-larger-than=]

This adds convenience wrappers around cfpkt_extr_head(), which is responsible
for most of the stack growth. With those wrapper functions, gcc apparently
starts reusing the stack slots for each instance, thus avoiding the
problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/caif/cfpkt.h
net/caif/cfctrl.c