x86: bpf_jit: support negative offsets
authorAlexei Starovoitov <ast@plumgrid.com>
Mon, 10 Mar 2014 22:56:51 +0000 (15:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Mar 2014 03:25:22 +0000 (23:25 -0400)
commit864eb362af845969cbbcabc5eed0d36ec1f20cd4
tree019fc2c8cbb011ddf715659316d83ce58ed1ab76
parent422cdc6fff40b685271b5dd0352ff04150c370c2
x86: bpf_jit: support negative offsets

Commit 1179d8b6e243 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: 1179d8b6e243 ("bpf jit: Let the x86 jit handle negative offsets")
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Cc: Jan Seiffert <kaffeemonster@googlemail.com>
Cc: Eric Dumazet <edumazet@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/x86/net/bpf_jit.S