]> git.baikalelectronics.ru Git - kernel.git/commit
rtnl: allocate more attr tables on the heap
authorJakub Kicinski <kuba@kernel.org>
Fri, 29 Apr 2022 23:55:06 +0000 (16:55 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Mon, 2 May 2022 13:14:20 +0000 (15:14 +0200)
commit02d0a30d5ae2a6578d95ba62b9444395b38d026a
tree3ae147a26bf9768b022f49582df91ba2ee9cc43d
parent4b59dabf463735eb518799b52271a67a284b1d2a
rtnl: allocate more attr tables on the heap

Commit 5fcdee0684bd ("rtnetlink: avoid frame size warning in rtnl_newlink()")
moved to allocating the largest attribute array of rtnl_newlink()
on the heap. Kalle reports the stack has grown above 1k again:

  net/core/rtnetlink.c:3557:1: error: the frame size of 1104 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Move more attrs to the heap, wrap them in a struct.
Don't bother with linkinfo, it's referenced a lot and we take
its size so it's awkward to move, plus it's small (6 elements).

Reported-by: Kalle Valo <kvalo@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Tested-by: Kalle Valo <kvalo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/core/rtnetlink.c