diff options
| author | Kees Cook <kees@kernel.org> | 2024-11-17 03:38:13 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-14 20:03:32 +0100 |
| commit | 9fcb73b960e853b9cfde2b19611ef111a575126f (patch) | |
| tree | 5ae509461ac7d391214019823dc43004cb779128 /scripts/objdiff | |
| parent | 9bfeeeff2c92b9dd261198b601b45bde4c529841 (diff) | |
| download | linux-9fcb73b960e853b9cfde2b19611ef111a575126f.tar.gz linux-9fcb73b960e853b9cfde2b19611ef111a575126f.tar.bz2 linux-9fcb73b960e853b9cfde2b19611ef111a575126f.zip | |
lib: stackinit: hide never-taken branch from compiler
commit 5c3793604f91123bf49bc792ce697a0bef4c173c upstream.
The never-taken branch leads to an invalid bounds condition, which is by
design. To avoid the unwanted warning from the compiler, hide the
variable from the optimizer.
../lib/stackinit_kunit.c: In function 'do_nothing_u16_zero':
../lib/stackinit_kunit.c:51:49: error: array subscript 1 is outside array bounds of 'u16[0]' {aka 'short unsigned int[]'} [-Werror=array-bounds=]
51 | #define DO_NOTHING_RETURN_SCALAR(ptr) *(ptr)
| ^~~~~~
../lib/stackinit_kunit.c:219:24: note: in expansion of macro 'DO_NOTHING_RETURN_SCALAR'
219 | return DO_NOTHING_RETURN_ ## which(ptr + 1); \
| ^~~~~~~~~~~~~~~~~~
Link: https://lkml.kernel.org/r/20241117113813.work.735-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
