linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* may I ignore "net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes ..."?
@ 2018-11-04 16:14 Toralf Förster
  2018-11-04 17:15 ` Joe Perches
  2018-11-05 19:57 ` David Ahern
  0 siblings, 2 replies; 3+ messages in thread
From: Toralf Förster @ 2018-11-04 16:14 UTC (permalink / raw)
  To: netdev; +Cc: Linux Kernel

compiling recent kernel (4.18.x, 4.19.1) at my server I do still get :


net/core/rtnetlink.c: In function ‘rtnl_newlink’:
net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes is larger than 1024 bytes [-Wframe-larger-than=]


with "gcc version 7.3.0 (Gentoo Hardened 7.3.0-r3 p1.4) " and do wonder whether it is safe to ignore it?


-- 
Toralf
PGP C4EACDDE 0076E94E

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: may I ignore "net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes ..."?
  2018-11-04 16:14 may I ignore "net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes ..."? Toralf Förster
@ 2018-11-04 17:15 ` Joe Perches
  2018-11-05 19:57 ` David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Perches @ 2018-11-04 17:15 UTC (permalink / raw)
  To: Toralf Förster, netdev, Kees Cook; +Cc: Linux Kernel

On Sun, 2018-11-04 at 17:14 +0100, Toralf Förster wrote:
> compiling recent kernel (4.18.x, 4.19.1) at my server I do still get :
> 
> 
> net/core/rtnetlink.c: In function ‘rtnl_newlink’:
> net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> 
> with "gcc version 7.3.0 (Gentoo Hardened 7.3.0-r3 p1.4) " and do wonder whether it is safe to ignore it?
> 

This was introduce by a desire to eliminate variable length array
declarations by

commit ccf8dbcd062a930e64741c939ca784d15316aa0c
Author: Kees Cook <
keescook@chromium.org>
Date:   Wed May 30 15:20:52 2018 -0700

    rtnetlink: Remove VLA usage

It does make the stack use here unfortunately obviously large, but
it could have been this large, just unreported.

Perhaps no obvious solution here as an alloc instead of stack use
may be costly.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: may I ignore "net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes ..."?
  2018-11-04 16:14 may I ignore "net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes ..."? Toralf Förster
  2018-11-04 17:15 ` Joe Perches
@ 2018-11-05 19:57 ` David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2018-11-05 19:57 UTC (permalink / raw)
  To: Toralf Förster, netdev; +Cc: Linux Kernel

On 11/4/18 9:14 AM, Toralf Förster wrote:
> compiling recent kernel (4.18.x, 4.19.1) at my server I do still get :
> 
> 
> net/core/rtnetlink.c: In function ‘rtnl_newlink’:
> net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> 
> with "gcc version 7.3.0 (Gentoo Hardened 7.3.0-r3 p1.4) " and do wonder whether it is safe to ignore it?
> 
> 

I believe the warning is coming from this part of rtnl_newlink():

        if (1) {
                struct nlattr *attr[RTNL_MAX_TYPE + 1];
                struct nlattr *slave_attr[RTNL_SLAVE_MAX_TYPE + 1];
                struct nlattr **data = NULL;
                struct nlattr **slave_data = NULL;
                struct net *dest_net, *link_net = NULL;

The heavy hitters are:
#define RTNL_MAX_TYPE           49
#define RTNL_SLAVE_MAX_TYPE     36

attr and slave_attr would amount to 696 bytes of that 1280. The earlier
defined:

struct nlattr *tb[IFLA_MAX+1];

Would be another 416, so those 3 are 1112 bytes of the warning.

I have been using CONFIG_FRAME_WARN=2048 for a while without a problem.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-05 19:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-04 16:14 may I ignore "net/core/rtnetlink.c:3156:1: warning: the frame size of 1280 bytes ..."? Toralf Förster
2018-11-04 17:15 ` Joe Perches
2018-11-05 19:57 ` David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).