All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Detect future mis-uses of __ex_table section.
@ 2015-03-17 12:39 Quentin Casasnovas
  2015-03-17 12:39 ` [PATCH 1/7] modpost: add strict white-listing when referencing sections Quentin Casasnovas
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: Quentin Casasnovas @ 2015-03-17 12:39 UTC (permalink / raw)
  To: lkml; +Cc: Oleg Nesterov, Borislav Petkov, Linus Torvalds

Hi,

This patch-set adds some sanity checks on the __ex_table section so that it
makes it much harder to introduce wrong entries in there.  It works by
checking every relocation in __ex_table and making sure it points to an
executable section and does not point to a list of black-listed sections,
like .altinstr_replacement.  Patch 6 adds a new script, check_extable.sh,
so it can be used to get more human readable diagnostics on where the wrong
ex_table entry was added in the code.  Here's a truncated example output
from v4.0-rc2:

 Error: found a reference to .altinstr_replacement in __ex_table:
 	xrstor_state at /home/quentin/linux-2.6/./arch/x86/include/asm/xsave.h:179
 	 (inlined by) fpu_xrstor_checking at /home/quentin/linux-2.6/./arch/x86/include/asm/xsave.h:207
 	 (inlined by) fpu_restore_checking at /home/quentin/linux-2.6/./arch/x86/include/asm/fpu-internal.h:284
 	 (inlined by) kvm_load_guest_fpu at /home/quentin/linux-2.6/arch/x86/kvm/x86.c:6986

This is to prevent future misuses of the __ex_table entry like there was
for xsaves/xrstors for example, see upstream commit 06e5801b
("x86/fpu/xsaves: Fix improper uses of __ex_table").

This will potentially break the build for other architectures (tested on
x86-64 and sparc), since there might be exotic sections in there that I
don't know about.

Quentin


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-04-15  8:34 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17 12:39 [PATCH 0/7] Detect future mis-uses of __ex_table section Quentin Casasnovas
2015-03-17 12:39 ` [PATCH 1/7] modpost: add strict white-listing when referencing sections Quentin Casasnovas
2015-03-17 16:25   ` Linus Torvalds
2015-03-18  9:14     ` Quentin Casasnovas
2015-03-20  1:29   ` Rusty Russell
2015-04-13  9:04     ` Quentin Casasnovas
2015-04-13 11:19       ` Rusty Russell
2015-04-13 11:24       ` Rusty Russell
2015-03-17 12:39 ` [PATCH 2/7] modpost: add .sched.text and .kprobes.text to the TEXT_SECTIONS list Quentin Casasnovas
2015-03-18  9:08   ` Quentin Casasnovas
2015-03-17 12:39 ` [PATCH 3/7] modpost: add handler function pointer to sectioncheck Quentin Casasnovas
2015-03-18  9:08   ` Quentin Casasnovas
2015-03-17 12:39 ` [PATCH 4/7] modpost: factorize symbol pretty print in get_pretty_name() Quentin Casasnovas
2015-03-18  9:08   ` Quentin Casasnovas
2015-03-17 12:40 ` [PATCH 5/7] modpost: mismatch_handler: retrieve tosym information only when needed Quentin Casasnovas
2015-03-18  9:09   ` Quentin Casasnovas
2015-03-17 12:40 ` [PATCH 6/7] scripts: add check_extable.sh script Quentin Casasnovas
2015-03-18  9:09   ` Quentin Casasnovas
2015-03-17 12:40 ` [PATCH 7/7] modpost: handle relocations mismatch in __ex_table Quentin Casasnovas
2015-03-18  9:09   ` Quentin Casasnovas
2015-04-13 11:18   ` Rusty Russell
2015-04-13 13:33     ` Quentin Casasnovas
2015-04-14 12:14   ` Thierry Reding
2015-04-14 12:35     ` Quentin Casasnovas
2015-04-15  3:27       ` Rusty Russell
2015-04-15  8:35         ` Quentin Casasnovas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.