x86: bpf_jit: support negative offsets
authorAlexei Starovoitov <ast@plumgrid.com>
Mon, 10 Mar 2014 22:56:51 +0000 (15:56 -0700)
committerJiri Slaby <jslaby@suse.cz>
Mon, 31 Mar 2014 12:22:29 +0000 (14:22 +0200)
commit03961b13eea339809447597c9222a87a3ee0d059
treec2569cfb5a5826954ad401f8d9e385a8d2768d19
parente9fc4074f0325b19f31bd407eb70739d49cfaf6d
x86: bpf_jit: support negative offsets

commit fdfaf64e75397567257e1051931f9a3377360665 upstream.

Commit a998d4342337 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: a998d4342337 ("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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/x86/net/bpf_jit.S