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: d9ff286a0f ("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-06-17 20:20:36 -07:00
2019-04-08 09:51:54 -07:00
2019-03-27 13:49:44 -07:00
2019-05-30 11:26:32 -07:00
2019-03-27 13:49:43 -07:00
2019-07-08 19:38:46 -07:00
2019-07-09 12:02:13 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2019-07-01 19:34:46 -07:00
2019-06-27 09:38:17 -07:00
2019-04-10 22:12:26 -07:00
2019-06-08 12:52:42 -07:00
2019-07-23 14:12:37 -07:00
2019-07-09 12:11:59 -07:00
2019-07-09 14:38:50 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-03-10 11:07:14 -07:00
2019-06-09 19:40:10 -07:00
2019-07-01 19:02:47 -07:00
2019-06-05 17:36:38 +02:00
2019-05-30 11:26:32 -07:00
2019-04-27 09:07:04 -07:00
2019-07-15 11:03:29 -07:00
2019-07-11 10:55:49 -07:00
2019-04-09 14:19:06 +02:00
2019-05-30 11:26:32 -07:00
2019-06-19 11:23:13 -04:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-02 18:08:36 -07:00
2019-05-30 11:26:32 -07:00
2019-07-08 14:58:04 -07:00
2019-06-07 11:00:14 -07:00
2019-06-05 17:36:38 +02:00
2019-05-30 11:26:32 -07:00
2019-06-26 13:14:59 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 10:50:45 +02:00
2019-07-16 14:12:06 -07:00
2019-07-22 16:04:17 +02:00
2019-07-22 16:04:17 +02:00
2019-06-15 01:21:19 +02:00
2019-07-12 11:05:46 -07:00
2018-12-04 21:21:18 -08:00
2019-06-14 20:18:28 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:32 -07:00
2019-07-08 14:58:04 -07:00