lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 6 Jun 2014 08:27:16 -0700
From:	Alexei Starovoitov <ast@...mgrid.com>
To:	David Laight <David.Laight@...lab.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net] net: filter: fix typo in sparc BPF JIT

On Fri, Jun 6, 2014 at 1:36 AM, David Laight <David.Laight@...lab.com> wrote:
> From: Alexei Starovoitov
>> fix typo in sparc codegen for SKF_AD_IFINDEX and SKF_AD_HATYPE
>> classic BPF extensions
> ...
>> --- a/arch/sparc/net/bpf_jit_comp.c
>> +++ b/arch/sparc/net/bpf_jit_comp.c
>> @@ -83,9 +83,9 @@ static void bpf_flush_icache(void *start_, void *end_)
>>  #define BNE          (F2(0, 2) | CONDNE)
>>
>>  #ifdef CONFIG_SPARC64
>> -#define BNE_PTR              (F2(0, 1) | CONDNE | (2 << 20))
>> +#define BE_PTR               (F2(0, 1) | CONDE | (2 << 20))
>>  #else
>> -#define BNE_PTR              BNE
>> +#define BE_PTR               BNE
>>  #endif
>
> That doesn't look right.
> AFAICT you've had to invert the branch in the code (below) so need
> the alternate define - I presume this is the only place they are used.
> But the second is only partially inverted.

Ohh. yes. sorry. It's a copy paste error from net-next into net :((
I fixed it carefully in net-next first, then tried to git am, had to
do it manually, built/ran sparc64 only.

> I presume you only tested sparc64?

yes. I don't have it setup yet.

>         David
>
>>  #define SETHI(K, REG)        \
>> @@ -600,7 +600,7 @@ void bpf_jit_compile(struct sk_filter *fp)
>>                       case BPF_S_ANC_IFINDEX:
>>                               emit_skb_loadptr(dev, r_A);
>>                               emit_cmpi(r_A, 0);
>> -                             emit_branch(BNE_PTR, cleanup_addr + 4);
>> +                             emit_branch(BE_PTR, cleanup_addr + 4);
>>                               emit_nop();
>>                               emit_load32(r_A, struct net_device, ifindex, r_A);
>>                               break;
>> @@ -613,7 +613,7 @@ void bpf_jit_compile(struct sk_filter *fp)
>>                       case BPF_S_ANC_HATYPE:
>>                               emit_skb_loadptr(dev, r_A);
>>                               emit_cmpi(r_A, 0);
>> -                             emit_branch(BNE_PTR, cleanup_addr + 4);
>> +                             emit_branch(BE_PTR, cleanup_addr + 4);
>>                               emit_nop();
>>                               emit_load16(r_A, struct net_device, type, r_A);
>>                               break;
>> --
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@...r.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ