Skip to content

Commit

Permalink
bpf_dbg: fix wrong register usage
Browse files Browse the repository at this point in the history
The AND instruction is erroneously using the X register instead
of the K register.

Signed-off-by: Brendan Hickey <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
bhswl authored and davem330 committed Apr 30, 2014
1 parent f114890 commit e5744fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/net/bpf_dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ static void bpf_single_step(struct bpf_regs *r, struct sock_filter *f,
r->A &= r->X;
break;
case BPF_ALU_AND | BPF_K:
r->A &= r->X;
r->A &= K;
break;
case BPF_ALU_OR | BPF_X:
r->A |= r->X;
Expand Down

0 comments on commit e5744fe

Please sign in to comment.