Revision e96d71359e9bbea846a2111e4469a03a055dfa6f authored by Mathieu Desnoyers on 09 July 2018, 19:51:50 UTC, committed by Thomas Gleixner on 10 July 2018, 20:18:51 UTC
Change the rseq ABI so rseq_cs start_ip, post_commit_offset and abort_ip fields are seen as 64-bit fields by both 32-bit and 64-bit kernels rather that ignoring the 32 upper bits on 32-bit kernels. This ensures we have a consistent behavior for a 32-bit binary executed on 32-bit kernels and in compat mode on 64-bit kernels. Validating the value of abort_ip field to be below TASK_SIZE ensures the kernel don't return to an invalid address when returning to userspace after an abort. I don't fully trust each architecture code to consistently deal with invalid return addresses. Validating the value of the start_ip and post_commit_offset fields prevents overflow on arithmetic performed on those values, used to check whether abort_ip is within the rseq critical section. If validation fails, the process is killed with a segmentation fault. When the signature encountered before abort_ip does not match the expected signature, return -EINVAL rather than -EPERM to be consistent with other input validation return codes from rseq_get_rseq_cs(). Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-api@vger.kernel.org Cc: Peter Zijlstra <peterz@infradead.org> Cc: "Paul E . McKenney" <paulmck@linux.vnet.ibm.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Dave Watson <davejwatson@fb.com> Cc: Paul Turner <pjt@google.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: "H . Peter Anvin" <hpa@zytor.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Chris Lameter <cl@linux.com> Cc: Ben Maurer <bmaurer@fb.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Joel Fernandes <joelaf@google.com> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Link: https://lkml.kernel.org/r/20180709195155.7654-2-mathieu.desnoyers@efficios.com
1 parent 1e4b044
File | Mode | Size |
---|---|---|
Kconfig | -rw-r--r-- | 2.2 KB |
Makefile | -rw-r--r-- | 1.4 KB |
asymmetric_keys.h | -rw-r--r-- | 657 bytes |
asymmetric_type.c | -rw-r--r-- | 15.1 KB |
mscode.asn1 | -rw-r--r-- | 840 bytes |
mscode_parser.c | -rw-r--r-- | 2.9 KB |
pkcs7.asn1 | -rw-r--r-- | 3.8 KB |
pkcs7_key_type.c | -rw-r--r-- | 2.4 KB |
pkcs7_parser.c | -rw-r--r-- | 16.4 KB |
pkcs7_parser.h | -rw-r--r-- | 2.3 KB |
pkcs7_trust.c | -rw-r--r-- | 4.8 KB |
pkcs7_verify.c | -rw-r--r-- | 12.8 KB |
public_key.c | -rw-r--r-- | 4.4 KB |
restrict.c | -rw-r--r-- | 8.0 KB |
signature.c | -rw-r--r-- | 1.7 KB |
verify_pefile.c | -rw-r--r-- | 11.4 KB |
verify_pefile.h | -rw-r--r-- | 1.2 KB |
x509.asn1 | -rw-r--r-- | 1.6 KB |
x509_akid.asn1 | -rw-r--r-- | 1.0 KB |
x509_cert_parser.c | -rw-r--r-- | 16.1 KB |
x509_parser.h | -rw-r--r-- | 2.3 KB |
x509_public_key.c | -rw-r--r-- | 6.4 KB |
Computing file changes ...