Eric Dumazet
06a22d897d
bpf: fix access to skb_shared_info->gso_segs
...
It is possible we reach bpf_convert_ctx_access() with
si->dst_reg == si->src_reg
Therefore, we need to load BPF_REG_AX before eventually
mangling si->src_reg.
syzbot generated this x86 code :
3: 55 push %rbp
4: 48 89 e5 mov %rsp,%rbp
7: 48 81 ec 00 00 00 00 sub $0x0,%rsp // Might be avoided ?
e: 53 push %rbx
f: 41 55 push %r13
11: 41 56 push %r14
13: 41 57 push %r15
15: 6a 00 pushq $0x0
17: 31 c0 xor %eax,%eax
19: 48 8b bf c0 00 00 00 mov 0xc0(%rdi),%rdi
20: 44 8b 97 bc 00 00 00 mov 0xbc(%rdi),%r10d
27: 4c 01 d7 add %r10,%rdi
2a: 48 0f b7 7f 06 movzwq 0x6(%rdi),%rdi // Crash
2f: 5b pop %rbx
30: 41 5f pop %r15
32: 41 5e pop %r14
34: 41 5d pop %r13
36: 5b pop %rbx
37: c9 leaveq
38: c3 retq
Fixes: d9ff286a0f59 ("bpf: allow BPF programs access skb_shared_info->gso_segs field")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-07-23 14:12:37 -07:00
..
2019-07-06 12:50:01 +02:00
2019-07-12 17:31:19 -07:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-05 17:37:10 +02:00
2019-05-30 11:26:32 -07:00
2019-06-16 14:22:37 -07:00
2019-07-08 19:48:57 -07:00
2019-07-11 10:55:49 -07:00
2019-05-30 11:29:53 -07:00
2019-07-12 16:03:16 -07:00
2019-07-11 10:55:49 -07:00
2019-05-30 11:29:22 -07:00
2019-06-07 23:03:54 +02:00
2019-07-12 12:24:03 -07:00
2019-07-23 14:12:37 -07:00
2019-05-30 11:29:52 -07:00
2019-07-08 19:38:03 -07:00
2019-05-24 17:36:42 +02:00
2019-07-10 18:43:43 -07:00
2019-07-18 16:32:39 -07:00
2019-06-07 11:00:14 -07:00
2019-07-11 14:37:45 -07:00
2019-06-19 11:37:47 -04:00
2019-05-21 10:50:46 +02:00
2019-07-22 16:04:17 +02:00
2019-07-18 12:01:43 -07:00
2019-06-19 16:26:33 -04:00
2019-06-19 17:09:55 +02:00
2019-07-08 19:48:57 -07:00
2019-07-08 19:38:03 -07:00
2019-06-23 13:24:17 -07:00
2019-06-17 20:20:36 -07:00
2019-06-05 17:36:36 +02:00
2019-07-11 10:55:49 -07:00
2019-05-30 11:26:41 -07:00
2019-06-12 09:42:34 -07:00
2019-05-30 11:26:32 -07:00
2019-07-11 10:55:49 -07:00
2019-05-21 11:28:45 +02:00
2019-06-14 19:50:33 -07:00
2019-07-01 19:00:52 -07:00
2019-07-08 12:46:24 -07:00
2019-06-19 17:09:55 +02:00
2019-07-12 15:16:58 -07:00
2019-06-27 21:06:39 -07:00
2019-06-05 17:37:07 +02:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:36:37 +02:00
2019-07-17 12:06:52 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-07-11 10:55:49 -07:00
2019-07-17 13:34:09 -07:00
2019-07-17 12:01:19 -07:00
2019-06-27 21:06:39 -07:00
2019-06-22 08:59:24 -04:00
2019-07-12 12:24:03 -07:00
2019-05-30 11:26:32 -07:00
2019-07-17 15:24:38 -07:00
2019-07-22 16:04:17 +02:00
2019-06-07 11:00:14 -07:00
2019-07-08 15:35:17 -07:00
2019-06-05 17:30:29 +02:00
2019-07-11 10:55:49 -07:00
2019-05-24 17:27:12 +02:00
2019-07-12 15:02:21 +02:00
2019-07-08 19:48:57 -07:00
2019-05-31 15:30:03 -06:00
2019-06-17 13:56:26 -07:00
2019-02-28 08:24:23 -07:00
2019-07-13 10:36:53 -07:00
2019-05-21 10:50:45 +02:00