[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2g4ZDcyxuSOkYzOmqV3Hc3YF3Anc3GQysvGo9bijYufQ@mail.gmail.com>
Date: Mon, 17 Jun 2019 22:58:58 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Philipp Reisner <philipp.reisner@...bit.com>,
Lars Ellenberg <lars.ellenberg@...bit.com>,
Jens Axboe <axboe@...nel.dk>,
Roland Kammerer <roland.kammerer@...bit.com>,
Eric Biggers <ebiggers@...gle.com>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Kees Cook <keescook@...omium.org>, drbd-dev@...ts.linbit.com,
linux-block <linux-block@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drbd: dynamically allocate shash descriptor
On Mon, Jun 17, 2019 at 4:43 PM Herbert Xu <herbert@...dor.apana.org.au> wrote:
>
> On Mon, Jun 17, 2019 at 03:24:13PM +0200, Arnd Bergmann wrote:
> > Building with clang and KASAN, we get a warning about an overly large
> > stack frame on 32-bit architectures:
> >
> > drivers/block/drbd/drbd_receiver.c:921:31: error: stack frame size of 1280 bytes in function 'conn_connect'
> > [-Werror,-Wframe-larger-than=]
> >
> > We already allocate other data dynamically in this function, so
> > just do the same for the shash descriptor, which makes up most of
> > this memory.
> >
> > Signed-off-by: Arnd Bergmann <arnd@...db.de>
> > ---
> > drivers/block/drbd/drbd_receiver.c | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
>
> Does this patch fix the warning as well?
The warning is gone with this patch. Instead of 1280 bytes for drbd_receiver,
I now see 512 bytes, and 768 bytes for drbd_get_response, everything else is
under 160 bytes in this file.
However, with the call chain of
drbd_receiver
conn_connect
drbd_do_auth
drbd_get_response
This still adds up to as much as before, so it only shuts up the
warning but does not reduce the maximum stack usage.
If we are sure that is ok, then your patch would be nicer,
possibly with a 'noinline_for_stack' tag on drbd_get_response.
Arnd
Powered by blists - more mailing lists