2016-10-15 22:58:28

by Fengguang Wu

[permalink] [raw]
Subject: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1001354ca34179f3db924eb66672442a173147dc
commit: 0766f788eb727e2e330d55d30545db65bcf2623f latent_entropy: Mark functions with __latent_entropy
date: 5 days ago
config: i386-randconfig-c0-10160635 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
git checkout 0766f788eb727e2e330d55d30545db65bcf2623f
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

drivers/pci/hotplug/ibmphp_ebda.c: In function 'ibmphp_access_ebda':
>> drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes [-Wframe-larger-than=]
}
^

vim +409 drivers/pci/hotplug/ibmphp_ebda.c

^1da177e Linus Torvalds 2005-04-16 393 rc = ebda_rio_table();
^1da177e Linus Torvalds 2005-04-16 394 if (rc)
^1da177e Linus Torvalds 2005-04-16 395 goto out;
^1da177e Linus Torvalds 2005-04-16 396 }
^1da177e Linus Torvalds 2005-04-16 397 }
^1da177e Linus Torvalds 2005-04-16 398 rc = ebda_rsrc_controller();
^1da177e Linus Torvalds 2005-04-16 399 if (rc)
^1da177e Linus Torvalds 2005-04-16 400 goto out;
^1da177e Linus Torvalds 2005-04-16 401
^1da177e Linus Torvalds 2005-04-16 402 rc = ebda_rsrc_rsrc();
^1da177e Linus Torvalds 2005-04-16 403 goto out;
^1da177e Linus Torvalds 2005-04-16 404 error_nodev:
^1da177e Linus Torvalds 2005-04-16 405 rc = -ENODEV;
^1da177e Linus Torvalds 2005-04-16 406 out:
^1da177e Linus Torvalds 2005-04-16 407 iounmap(io_mem);
^1da177e Linus Torvalds 2005-04-16 408 return rc;
^1da177e Linus Torvalds 2005-04-16 @409 }
^1da177e Linus Torvalds 2005-04-16 410
^1da177e Linus Torvalds 2005-04-16 411 /*
^1da177e Linus Torvalds 2005-04-16 412 * map info of scalability details and rio details from physical address
^1da177e Linus Torvalds 2005-04-16 413 */
^1da177e Linus Torvalds 2005-04-16 414 static int __init ebda_rio_table(void)
^1da177e Linus Torvalds 2005-04-16 415 {
^1da177e Linus Torvalds 2005-04-16 416 u16 offset;
^1da177e Linus Torvalds 2005-04-16 417 u8 i;

:::::: The code at line 409 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


Attachments:
(No filename) (2.52 kB)
.config.gz (24.68 kB)
Download all attachments

2016-10-17 21:38:30

by Emese Revfy

[permalink] [raw]
Subject: Re: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

On Sun, 16 Oct 2016 06:52:16 +0800
kbuild test robot <[email protected]> wrote:

> drivers/pci/hotplug/ibmphp_ebda.c: In function 'ibmphp_access_ebda':
> >> drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Hi,

Thanks for the report. The problem is that these are large functions
(there are a lot of basic blocks) and the entropy plugin instruments all basic blocks.
I think the solution is to skip these functions which contain more than n basic blocks.
Sorry, I haven't time to fix this bug. PaX Team will fix it in PaX.

--
Emese

2016-10-18 20:57:43

by Kees Cook

[permalink] [raw]
Subject: Re: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

On Mon, Oct 17, 2016 at 2:37 PM, Emese Revfy <[email protected]> wrote:
> On Sun, 16 Oct 2016 06:52:16 +0800
> kbuild test robot <[email protected]> wrote:
>
>> drivers/pci/hotplug/ibmphp_ebda.c: In function 'ibmphp_access_ebda':
>> >> drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes [-Wframe-larger-than=]
>
> Hi,
>
> Thanks for the report. The problem is that these are large functions
> (there are a lot of basic blocks) and the entropy plugin instruments all basic blocks.
> I think the solution is to skip these functions which contain more than n basic blocks.
> Sorry, I haven't time to fix this bug. PaX Team will fix it in PaX.

This is controlled by CONFIG_FRAME_WARN. I don't think this is a
particular problem or should be avoided, but perhaps we can set the
default to 2048 (as done on 64BIT) if we're building with the entropy
plugin.

-Kees

--
Kees Cook
Nexus Security

2016-10-18 21:37:19

by Emese Revfy

[permalink] [raw]
Subject: Re: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

On Tue, 18 Oct 2016 13:57:35 -0700
Kees Cook <[email protected]> wrote:

> This is controlled by CONFIG_FRAME_WARN. I don't think this is a
> particular problem or should be avoided, but perhaps we can set the
> default to 2048 (as done on 64BIT) if we're building with the entropy
> plugin.

This is probably a gcc code generation bug on i386 when a plugin uses too many 64 bit variables
so I think PaX Team's patch will be the best solution.

--
Emese

2016-10-18 22:05:50

by Kees Cook

[permalink] [raw]
Subject: Re: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

On Tue, Oct 18, 2016 at 2:36 PM, Emese Revfy <[email protected]> wrote:
> On Tue, 18 Oct 2016 13:57:35 -0700
> Kees Cook <[email protected]> wrote:
>
>> This is controlled by CONFIG_FRAME_WARN. I don't think this is a
>> particular problem or should be avoided, but perhaps we can set the
>> default to 2048 (as done on 64BIT) if we're building with the entropy
>> plugin.
>
> This is probably a gcc code generation bug on i386 when a plugin uses too many 64 bit variables
> so I think PaX Team's patch will be the best solution.

Okay, cool. If you're able, please CC me with the fix when it happens. :)

Thanks!

-Kees

--
Kees Cook
Nexus Security

2016-10-18 22:17:44

by Emese Revfy

[permalink] [raw]
Subject: Re: drivers/pci/hotplug/ibmphp_ebda.c:409:1: warning: the frame size of 1108 bytes is larger than 1024 bytes

On Tue, 18 Oct 2016 15:05:39 -0700
Kees Cook <[email protected]> wrote:

> On Tue, Oct 18, 2016 at 2:36 PM, Emese Revfy <[email protected]> wrote:
> > On Tue, 18 Oct 2016 13:57:35 -0700
> > Kees Cook <[email protected]> wrote:
> >
> >> This is controlled by CONFIG_FRAME_WARN. I don't think this is a
> >> particular problem or should be avoided, but perhaps we can set the
> >> default to 2048 (as done on 64BIT) if we're building with the entropy
> >> plugin.
> >
> > This is probably a gcc code generation bug on i386 when a plugin uses too many 64 bit variables
> > so I think PaX Team's patch will be the best solution.
>
> Okay, cool. If you're able, please CC me with the fix when it happens. :)

This is the plugin side fix:
https://github.com/ephox-gcc-plugins/latent_entropy/commit/12776eab89861239d5194a9241a98e48e3b3e8ae

The kernel side fix will be released in PaX for linux 4.8.

--
Emese