Alexei Starovoitov
af86ca4e30
bpf: Prevent memory disambiguation attack
Detect code patterns where malicious 'speculative store bypass' can be used
and sanitize such patterns.
39: (bf) r3 = r10
40: (07) r3 += -216
41: (79) r8 = *(u64 *)(r7 +0) // slow read
42: (7a) *(u64 *)(r10 -72) = 0 // verifier inserts this instruction
43: (7b) *(u64 *)(r8 +0) = r3 // this store becomes slow due to r8
44: (79) r1 = *(u64 *)(r6 +0) // cpu speculatively executes this load
45: (71) r2 = *(u8 *)(r1 +0) // speculatively arbitrary 'load byte'
// is now sanitized
Above code after x86 JIT becomes:
e5: mov %rbp,%rdx
e8: add $0xffffffffffffff28,%rdx
ef: mov 0x0(%r13),%r14
f3: movq $0x0,-0x48(%rbp)
fb: mov %rdx,0x0(%r14)
ff: mov 0x0(%rbx),%rdi
103: movzbq 0x0(%rdi),%rsi
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2018-05-19 20:44:24 +02:00
..
2018-04-13 15:51:06 -07:00
2018-04-13 16:20:36 -07:00
2018-04-06 17:35:43 -07:00
2018-04-24 17:41:18 +02:00
2018-04-13 16:20:36 -07:00
2018-04-07 12:08:19 -07:00
2018-04-11 10:28:37 -07:00
2018-04-10 12:09:27 -07:00
2018-04-12 12:55:50 -07:00
2018-04-20 17:18:35 -07:00
2018-04-20 17:18:35 -07:00
2018-04-11 10:28:37 -07:00
2018-04-25 07:58:18 -06:00
2018-04-25 21:13:40 -07:00
2018-05-19 20:44:24 +02:00
2018-04-11 01:01:40 +02:00
2018-04-15 16:12:35 -07:00
2018-04-20 17:18:35 -07:00
2018-04-11 10:28:35 -07:00
2018-04-11 10:28:38 -07:00
2018-04-19 12:29:41 -03:00
2018-05-03 13:55:47 +02:00
2018-04-10 08:40:45 +02:00
2018-04-19 09:48:32 +02:00
2018-04-24 13:38:42 -04:00
2018-04-12 12:28:32 -07:00
2018-04-25 21:23:38 -07:00
2018-04-09 09:26:12 +02:00
2018-04-11 10:28:31 -07:00
2018-04-26 14:53:32 +02:00
2018-04-09 11:42:31 -07:00
2018-04-11 10:28:39 -07:00
2018-04-17 13:59:28 -04:00
2018-04-11 10:28:35 -07:00
2018-04-13 17:10:28 -07:00
2018-04-11 10:28:38 -07:00
2018-04-07 07:53:23 -07:00
2018-04-17 13:42:48 +02:00
2018-04-12 09:41:19 -07:00
2018-04-07 16:53:59 -07:00
2018-04-07 12:08:19 -07:00
2018-04-11 10:28:31 -07:00
2018-04-11 10:28:32 -07:00
2018-04-12 21:46:10 -04:00
2018-04-11 10:28:32 -07:00
2018-04-11 10:28:39 -07:00
2018-04-11 10:28:32 -07:00
2018-04-13 15:37:59 +02:00
2018-04-10 16:06:22 -04:00
2018-04-10 16:06:22 -04:00
2018-05-05 00:51:44 +02:00
2018-04-11 10:28:32 -07:00
2018-04-11 10:28:39 -07:00
2018-04-06 18:31:06 -07:00
2018-04-06 18:31:06 -07:00
2018-04-11 10:28:39 -07:00
2018-05-05 00:51:43 +02:00
2018-05-05 00:51:44 +02:00
2018-04-07 16:53:59 -07:00
2018-04-11 10:28:36 -07:00
2018-04-23 10:06:59 +02:00
2018-04-13 17:10:28 -07:00
2018-04-16 02:06:47 -04:00
2018-04-28 15:01:14 -07:00
2018-04-09 16:47:27 +02:00
2018-04-16 18:53:13 -04:00
2018-04-20 17:18:35 -07:00
2018-04-18 10:07:13 -07:00
2018-04-09 11:54:56 +02:00
2018-04-26 14:53:32 +02:00
2018-04-17 17:18:05 +02:00
2018-04-26 14:53:32 +02:00
2018-04-17 17:18:04 +02:00
2018-04-10 11:27:30 -07:00
2018-04-23 11:05:52 +02:00
2018-04-11 10:28:35 -07:00
2018-04-23 13:41:55 +02:00
2018-04-25 20:33:19 +03:00
2018-04-11 10:28:30 -07:00
2018-04-11 10:28:39 -07:00