Skip to content

Commit fdfaf64

Browse files
Alexei Starovoitovdavem330
Alexei Starovoitov
authored andcommitted
x86: bpf_jit: support negative offsets
Commit a998d43 claimed to introduce negative offset support to x86 jit, but it couldn't be working, since at the time of the execution of LD+ABS or LD+IND instructions via call into bpf_internal_load_pointer_neg_helper() the %edx (3rd argument of this func) had junk value instead of access size in bytes (1 or 2 or 4). Store size into %edx instead of %ecx (what original commit intended to do) Fixes: a998d43 ("bpf jit: Let the x86 jit handle negative offsets") Signed-off-by: Alexei Starovoitov <[email protected]> Cc: Jan Seiffert <[email protected]> Cc: Eric Dumazet <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 20a599b commit fdfaf64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/net/bpf_jit.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ bpf_slow_path_byte_msh:
140140
push %r9; \
141141
push SKBDATA; \
142142
/* rsi already has offset */ \
143-
mov $SIZE,%ecx; /* size */ \
143+
mov $SIZE,%edx; /* size */ \
144144
call bpf_internal_load_pointer_neg_helper; \
145145
test %rax,%rax; \
146146
pop SKBDATA; \

0 commit comments

Comments
 (0)