This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/81715] asan-stack=1 redzone allocation is too inflexible
- From: "arnd at linaro dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Sep 2017 13:52:48 +0000
- Subject: [Bug sanitizer/81715] asan-stack=1 redzone allocation is too inflexible
- Auto-submitted: auto-generated
- References: <bug-81715-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715
--- Comment #2 from Arnd Bergmann <arnd at linaro dot org> ---
Created attachment 42178
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42178&action=edit
preprocessed linux/drivers/media/dvb-frontends/stv090x.c, compressed
This is one of the typical files showing the behavior, with stack sizes up to 8
KB using gcc, but only a few hundred bytes using clang:
$ /home/arnd/cross-gcc/bin/x86_64-linux-gcc-8.0.0 -c /tmp/stv090x.i
-Werror=frame-larger-than=256 -O2 -fsanitize=kernel-address --param
asan-stack=0 # no warnings
$ /home/arnd/cross-gcc/bin/x86_64-linux-gcc-8.0.0 -c stv090x.i
-Werror=frame-larger-than=128 -O2 -fsanitize=kernel-address --param
asan-stack=1
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c: In function
'stv090x_i2c_gate_ctrl':
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c:810:1: error: the frame size
of 288 bytes is larger than 256 bytes [-Werror=frame-larger-than=]
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c: In function
'stv090x_blind_search':
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c:2067:1: error: the frame
size of 8688 bytes is larger than 256 bytes [-Werror=frame-larger-than=]
}
^
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c: In function
'stv090x_optimize_track':
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c:3089:1: error: the frame
size of 5872 bytes is larger than 256 bytes [-Werror=frame-larger-than=]
}
^
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c: In function
'stv090x_search':
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c:3505:1: error: the frame
size of 8016 bytes is larger than 256 bytes [-Werror=frame-larger-than=]
}
^
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c: In function
'stv090x_attach':
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c:4998:1: error: the frame
size of 1152 bytes is larger than 256 bytes [-Werror=frame-larger-than=]
$ /home/arnd/cross-gcc/bin/clang -Wframe-larger-than=256 /tmp/stv090x.i -c
-Wall -Wno-constant-logical-operand -O2 -Wno-unused-value -Wno-pointer-sign
-fsanitize=kernel-address -mllvm -asan-stack=0
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c:3173:34: warning: stack
frame size of 264 bytes in function
'stv090x_algo' [-Wframe-larger-than=]
static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state)
$ /home/arnd/cross-gcc/bin/clang -Wframe-larger-than=256 /tmp/stv090x.i -c
-Wall -Wno-constant-logical-operand -O2 -Wno-unused-value -Wno-pointer-sign
-fsanitize=kernel-address -mllvm -asan-stack=1
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c:756:12: warning: stack frame
size of 280 bytes in function
'stv090x_write_reg' [-Wframe-larger-than=]
static int stv090x_write_reg(struct stv090x_state *state, unsigned int reg, u8
data)
^
/git/arm-soc/drivers/media/dvb-frontends/stv090x.c:3173:34: warning: stack
frame size of 376 bytes in function
'stv090x_algo' [-Wframe-larger-than=]
static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state)
^