Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391712

Re: [PATCH] efibc: avoid stack overflow warning

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] efibc: avoid stack overflow warning
Date 2016-05-01 00:40 +0200
Message-ID <rtLIm-78D-5@gated-at.bofh.it> (permalink)
References <rtkIa-1vq-7@gated-at.bofh.it> <rtJwS-5qf-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Saturday 30 April 2016 21:14:49 Matt Fleming wrote:
> On Fri, 29 Apr, at 07:48:31PM, Arnd Bergmann wrote:
> > gcc complains about a newly added file for the EFI Bootloader Control:
> > 
> > drivers/firmware/efi/efibc.c: In function 'efibc_set_variable':
> > drivers/firmware/efi/efibc.c:53:1: error: the frame size of 2272 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> > 
> > The problem is the declaration of a local variable of type
> > struct efivar_entry, which is by itself larger than the warning
> > limit of 1024 bytes.
> > 
> > We know that the reboot notifiers are not called from a deep stack,
> > so this is not an actual bug, but we should still try to rework
> > the code to avoid the warning. We also know that reboot notifiers
> > are never run concurrently on multiple CPUs, so there is no problem
> > in just making the variable 'static'.
>  
> I assumed reboot notifiers were guaranteed to be non-concurrent too
> but having dug into the callers of kernel_reboot(), I couldn't find
> any kind of mutual exclusion.
> 
> How/where is this guaranteed?

The sys_restart() system call takes a mutex before calling kernel_restart()
or kernel_poweroff().

I've had a closer look now and found that there are a few other
callers of kernel_restart, so I guess if you restart using sysctl
at the exact same time as calling /sbin/reboot, things may break.

It's not something we'd have to worry about in practice, but it does
make my patch incorrect. Should we come up with a different way to
do it?

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] efibc: avoid stack overflow warning Arnd Bergmann <arnd@arndb.de> - 2016-04-29 19:50 +0200
  Re: [PATCH] efibc: avoid stack overflow warning Matt Fleming <matt@codeblueprint.co.uk> - 2016-04-30 22:20 +0200
    Re: [PATCH] efibc: avoid stack overflow warning Arnd Bergmann <arnd@arndb.de> - 2016-05-01 00:40 +0200
      Re: [PATCH] efibc: avoid stack overflow warning Matt Fleming <matt@codeblueprint.co.uk> - 2016-05-01 00:50 +0200
        Re: [PATCH] efibc: avoid stack overflow warning Arnd Bergmann <arnd@arndb.de> - 2016-05-01 01:30 +0200
          Re: [PATCH] efibc: avoid stack overflow warning Matt Fleming <matt@codeblueprint.co.uk> - 2016-05-01 15:20 +0200

csiph-web