Commit fe5b5ef8 authored by Linus Torvalds's avatar Linus Torvalds

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
parents a6189a74 9c573cd3
...@@ -80,7 +80,7 @@ DECLARE_PER_CPU(u32, kstack_offset); ...@@ -80,7 +80,7 @@ DECLARE_PER_CPU(u32, kstack_offset);
if (static_branch_maybe(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, \ if (static_branch_maybe(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT, \
&randomize_kstack_offset)) { \ &randomize_kstack_offset)) { \
u32 offset = raw_cpu_read(kstack_offset); \ u32 offset = raw_cpu_read(kstack_offset); \
offset ^= (rand); \ offset = ror32(offset, 5) ^ (rand); \
raw_cpu_write(kstack_offset, offset); \ raw_cpu_write(kstack_offset, offset); \
} \ } \
} while (0) } while (0)
......
...@@ -134,7 +134,7 @@ static const test_ubsan_fp test_ubsan_array[] = { ...@@ -134,7 +134,7 @@ static const test_ubsan_fp test_ubsan_array[] = {
}; };
/* Excluded because they Oops the module. */ /* Excluded because they Oops the module. */
static const test_ubsan_fp skip_ubsan_array[] = { static __used const test_ubsan_fp skip_ubsan_array[] = {
test_ubsan_divrem_overflow, test_ubsan_divrem_overflow,
}; };
......
...@@ -467,6 +467,8 @@ static bool stackleak_gate(void) ...@@ -467,6 +467,8 @@ static bool stackleak_gate(void)
return false; return false;
if (STRING_EQUAL(section, ".entry.text")) if (STRING_EQUAL(section, ".entry.text"))
return false; return false;
if (STRING_EQUAL(section, ".head.text"))
return false;
} }
return track_frame_size >= 0; return track_frame_size >= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment