This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/81715] asan-stack=1 redzone allocation is too inflexible


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715

--- Comment #4 from Arnd Bergmann <arnd at linaro dot org> ---
Created attachment 42195
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42195&action=edit
preprocessed net/wireless/nl80211.c, compressed

This is another file that shows the problem, in fact we hit this with every
allmodconfig build using gcc-5 through gcc-8.0.0:

/home/arnd/cross-gcc/bin/x86_64-linux-gcc-5.4.1 -c nl80211.i -O2  --std=gnu89
-Wall -Wno-unused -Wno-pointer-sign -Wframe-larger-than=1024
-fno-strict-aliasing -fno-strict-overflow -fsanitize=kernel-address --param
asan-stack=1  -fconserve-stack/git/arm-soc/net/wireless/nl80211.c: In function
'nl80211_add_commands_unsplit':
/git/arm-soc/net/wireless/nl80211.c:1411:1: warning: the frame size of 2208
bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
 ^
/git/arm-soc/net/wireless/nl80211.c: In function 'nl80211_get_mesh_config':
/git/arm-soc/net/wireless/nl80211.c:5779:1: warning: the frame size of 2048
bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
 ^
/git/arm-soc/net/wireless/nl80211.c: In function 'nl80211_send_wiphy':
/git/arm-soc/net/wireless/nl80211.c:1905:1: warning: the frame size of 3856
bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
...
/git/arm-soc/net/wireless/nl80211.c: In function
'nl80211_send_station.isra.47':
/git/arm-soc/net/wireless/nl80211.c:4476:1: warning: the frame size of 2240
bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
 ^
/git/arm-soc/net/wireless/nl80211.c: In function 'nl80211_dump_station':
/git/arm-soc/net/wireless/nl80211.c:4529:1: warning: the frame size of 1168
bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
 ^
/git/arm-soc/net/wireless/nl80211.c: In function 'nl80211_dump_scan':
/git/arm-soc/net/wireless/nl80211.c:7837:1: warning: the frame size of 1280
bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }

In comparison:
/home/arnd/cross-gcc/bin/clang -c nl80211.i -O2 --std=gnu89 -Wno-gnu -Wall
-Wno-unused -Wno-pointer-sign -Wno-tautological-compare
-Wno-constant-logical-operand -no-integrated-as -Wframe-larger-than=1024
-fsanitize=kernel-address -mllvm -asan-stack=1
/git/arm-soc/net/wireless/nl80211.c:1420:12: warning: stack frame size of 1816
bytes in function 'nl80211_send_wiphy'
      [-Wframe-larger-than=]
static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
           ^
/git/arm-soc/net/wireless/nl80211.c:14117:6: warning: stack frame size of 1112
bytes in function
      'cfg80211_del_sta_sinfo' [-Wframe-larger-than=]
void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr,
     ^
/git/arm-soc/net/wireless/nl80211.c:9717:12: warning: stack frame size of 1144
bytes in function
      'cfg80211_cqm_rssi_update' [-Wframe-larger-than=]
static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev,
           ^
/git/arm-soc/net/wireless/nl80211.c:4531:12: warning: stack frame size of 1112
bytes in function 'nl80211_get_station'
      [-Wframe-larger-than=]
static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
           ^
/git/arm-soc/net/wireless/nl80211.c:4478:12: warning: stack frame size of 1240
bytes in function
      'nl80211_dump_station' [-Wframe-larger-than=]
static int nl80211_dump_station(struct sk_buff *skb,

The proposed workaround in the kernel is
https://patchwork.kernel.org/patch/9787449/, but it would be good to not need
this for future compilers.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]