lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1426596002-26128-1-git-send-email-quentin.casasnovas@oracle.com>
Date:	Tue, 17 Mar 2015 13:39:55 +0100
From:	Quentin Casasnovas <quentin.casasnovas@...cle.com>
To:	lkml <linux-kernel@...r.kernel.org>
Cc:	Oleg Nesterov <oleg@...hat.com>, Borislav Petkov <bp@...en8.de>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [PATCH 0/7] Detect future mis-uses of __ex_table section.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ