tools/nolibc: tests: use volatile to force stack smashing
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 28 Mar 2023 16:18:45 +0000 (18:18 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 9 Jun 2023 18:33:04 +0000 (11:33 -0700)
commite7654c3fbdb348a0c54244015d97f0a0b8773b8c
treee69ca4275e0e40254f8ebe6e860b8c8c5deec121
parentac9a78681b921877518763ba0e89202254349d1b
tools/nolibc: tests: use volatile to force stack smashing

Use a volatile pointer to write outside the buffer so the compiler can't
optimize it away.

Reported-by: Alexey Dobriyan <adobriyan@gmail.com>
Link: https://lore.kernel.org/lkml/c0584807-511c-4496-b062-1263ea38f349@p183/
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/testing/selftests/nolibc/nolibc-test.c