Skip to content

Commit fe5b5ef

Browse files
committed
Merge tag 'hardening-v6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening fixes from Kees Cook: - gcc-plugins/stackleak: Avoid .head.text section (Ard Biesheuvel) - ubsan: fix unused variable warning in test module (Arnd Bergmann) - Improve entropy diffusion in randomize_kstack * tag 'hardening-v6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: randomize_kstack: Improve entropy diffusion ubsan: fix unused variable warning in test module gcc-plugins/stackleak: Avoid .head.text section
2 parents a6189a7 + 9c573cd commit fe5b5ef

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

include/linux/randomize_kstack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ DECLARE_PER_CPU(u32, kstack_offset);
8080
if (static_branch_maybe(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, \
8181
&randomize_kstack_offset)) { \
8282
u32 offset = raw_cpu_read(kstack_offset); \
83-
offset ^= (rand); \
83+
offset = ror32(offset, 5) ^ (rand); \
8484
raw_cpu_write(kstack_offset, offset); \
8585
} \
8686
} while (0)

lib/test_ubsan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static const test_ubsan_fp test_ubsan_array[] = {
134134
};
135135

136136
/* Excluded because they Oops the module. */
137-
static const test_ubsan_fp skip_ubsan_array[] = {
137+
static __used const test_ubsan_fp skip_ubsan_array[] = {
138138
test_ubsan_divrem_overflow,
139139
};
140140

scripts/gcc-plugins/stackleak_plugin.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ static bool stackleak_gate(void)
467467
return false;
468468
if (STRING_EQUAL(section, ".entry.text"))
469469
return false;
470+
if (STRING_EQUAL(section, ".head.text"))
471+
return false;
470472
}
471473

472474
return track_frame_size >= 0;

0 commit comments

Comments
 (0)