Commit fe5b5ef8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ DECLARE_PER_CPU(u32, kstack_offset);
	if (static_branch_maybe(CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT,	\
				&randomize_kstack_offset)) {		\
		u32 offset = raw_cpu_read(kstack_offset);		\
		offset ^= (rand);					\
		offset = ror32(offset, 5) ^ (rand);			\
		raw_cpu_write(kstack_offset, offset);			\
	}								\
} while (0)
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ static const test_ubsan_fp test_ubsan_array[] = {
};

/* 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,
};

+2 −0
Original line number Diff line number Diff line
@@ -467,6 +467,8 @@ static bool stackleak_gate(void)
			return false;
		if (STRING_EQUAL(section, ".entry.text"))
			return false;
		if (STRING_EQUAL(section, ".head.text"))
			return false;
	}

	return track_frame_size >= 0;