All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: bpf_dbg: register misuse
@ 2014-04-25 20:52 Brendan Hickey
  2014-04-25 21:15 ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: Brendan Hickey @ 2014-04-25 20:52 UTC (permalink / raw)
  To: netdev; +Cc: dborkman

Hi,

I noticed a mistaken use of the X register instead of the K register
in bpf_dbg. Enclosed is a fix.

Brendan


From: Brendan Hickey <bhickey@google.com>
Date: Fri, 25 Apr 2014 15:54:13 -0400
Subject: [PATCH] bpf_dbg: Fix erroneous register use for AND

The AND instruction is erroneously using the X register instead of the K
register.
---
 tools/net/bpf_dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/net/bpf_dbg.c b/tools/net/bpf_dbg.c
index 65dc757..5e54848 100644
--- a/tools/net/bpf_dbg.c
+++ b/tools/net/bpf_dbg.c
@@ -823,7 +823,7 @@ do_div:
  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;


--
1.9.1.423.g4596e3a

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: bpf_dbg: register misuse
  2014-04-25 20:52 [PATCH] tools: bpf_dbg: register misuse Brendan Hickey
@ 2014-04-25 21:15 ` Alexei Starovoitov
  2014-04-25 21:23   ` Brendan Hickey
  0 siblings, 1 reply; 4+ messages in thread
From: Alexei Starovoitov @ 2014-04-25 21:15 UTC (permalink / raw)
  To: Brendan Hickey; +Cc: netdev, Daniel Borkmann

On Fri, Apr 25, 2014 at 1:52 PM, Brendan Hickey <bhickey@google.com> wrote:
> Hi,
>
> I noticed a mistaken use of the X register instead of the K register
> in bpf_dbg. Enclosed is a fix.

Nice catch!
Please add your signed-off-by.

> Brendan
>
>
> From: Brendan Hickey <bhickey@google.com>
> Date: Fri, 25 Apr 2014 15:54:13 -0400
> Subject: [PATCH] bpf_dbg: Fix erroneous register use for AND
>
> The AND instruction is erroneously using the X register instead of the K
> register.
> ---
>  tools/net/bpf_dbg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/net/bpf_dbg.c b/tools/net/bpf_dbg.c
> index 65dc757..5e54848 100644
> --- a/tools/net/bpf_dbg.c
> +++ b/tools/net/bpf_dbg.c
> @@ -823,7 +823,7 @@ do_div:
>   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;
>
>
> --
> 1.9.1.423.g4596e3a
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: bpf_dbg: register misuse
  2014-04-25 21:15 ` Alexei Starovoitov
@ 2014-04-25 21:23   ` Brendan Hickey
  2014-04-28  8:49     ` Daniel Borkmann
  0 siblings, 1 reply; 4+ messages in thread
From: Brendan Hickey @ 2014-04-25 21:23 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: netdev, Daniel Borkmann

From: Brendan Hickey <bhickey@google.com>
Date: Fri, 25 Apr 2014 17:22:52 -0400
Subject: [PATCH] bpf_dbg: Fix erroneous register use for AND

The AND instruction is erroneously using the X register instead of the K
register.

Signed-off-by: Brendan Hickey <bhickey@google.com>
---
 tools/net/bpf_dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/net/bpf_dbg.c b/tools/net/bpf_dbg.c
index 65dc757..5e54848 100644
--- a/tools/net/bpf_dbg.c
+++ b/tools/net/bpf_dbg.c
@@ -823,7 +823,7 @@ do_div:
                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;
-- 
1.9.1.423.g4596e3a

On Fri, Apr 25, 2014 at 5:15 PM, Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
> On Fri, Apr 25, 2014 at 1:52 PM, Brendan Hickey <bhickey@google.com> wrote:
>> Hi,
>>
>> I noticed a mistaken use of the X register instead of the K register
>> in bpf_dbg. Enclosed is a fix.
>
> Nice catch!
> Please add your signed-off-by.
>
>> Brendan
>>
>>
>> From: Brendan Hickey <bhickey@google.com>
>> Date: Fri, 25 Apr 2014 15:54:13 -0400
>> Subject: [PATCH] bpf_dbg: Fix erroneous register use for AND
>>
>> The AND instruction is erroneously using the X register instead of the K
>> register.
>> ---
>>  tools/net/bpf_dbg.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/net/bpf_dbg.c b/tools/net/bpf_dbg.c
>> index 65dc757..5e54848 100644
>> --- a/tools/net/bpf_dbg.c
>> +++ b/tools/net/bpf_dbg.c
>> @@ -823,7 +823,7 @@ do_div:
>>   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;
>>
>>
>> --
>> 1.9.1.423.g4596e3a
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: bpf_dbg: register misuse
  2014-04-25 21:23   ` Brendan Hickey
@ 2014-04-28  8:49     ` Daniel Borkmann
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2014-04-28  8:49 UTC (permalink / raw)
  To: Brendan Hickey; +Cc: Alexei Starovoitov, netdev

On 04/25/2014 11:23 PM, Brendan Hickey wrote:
> From: Brendan Hickey <bhickey@google.com>
> Date: Fri, 25 Apr 2014 17:22:52 -0400
> Subject: [PATCH] bpf_dbg: Fix erroneous register use for AND
>
> The AND instruction is erroneously using the X register instead of the K
> register.
>
> Signed-off-by: Brendan Hickey <bhickey@google.com>

Sorry for the late reply as I'm on vacations currently.

Patch looks good to me, but it looks like it got whitespace
corrupted by your email client. Please submit this against
'net' in subject line. Otherwise when this is fixed, feel
free to add my ack:

Acked-by: Daniel Borkmann <dborkman@redhat.com>

Thanks, Brendan!

> ---
>   tools/net/bpf_dbg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/net/bpf_dbg.c b/tools/net/bpf_dbg.c
> index 65dc757..5e54848 100644
> --- a/tools/net/bpf_dbg.c
> +++ b/tools/net/bpf_dbg.c
> @@ -823,7 +823,7 @@ do_div:
>                  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;
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-28  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-25 20:52 [PATCH] tools: bpf_dbg: register misuse Brendan Hickey
2014-04-25 21:15 ` Alexei Starovoitov
2014-04-25 21:23   ` Brendan Hickey
2014-04-28  8:49     ` Daniel Borkmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.