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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140424163114.GD36716@pburton-linux.le.imgtec.org>
Date:	Thu, 24 Apr 2014 17:31:14 +0100
From:	Paul Burton <paul.burton@...tec.com>
To:	Markos Chandras <markos.chandras@...tec.com>
CC:	<linux-mips@...ux-mips.org>,
	"David S. Miller" <davem@...emloft.net>, <netdev@...r.kernel.org>
Subject: Re: [PATCH v3 13/14] MIPS: net: Add BPF JIT

On Thu, Apr 24, 2014 at 03:50:13PM +0100, Markos Chandras wrote:
> diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
> new file mode 100644
> index 0000000..864e5b7
> --- /dev/null
> +++ b/arch/mips/net/bpf_jit.c

... cut ...

> +			off = offsetof(struct sk_buff, protocol);
> +			emit_half_load(r_A, r_skb, off, ctx);
> +#ifdef CONFIG_CPU_LITTLE_ENDIAN
> +			/* This needs little endian fixup */
> +			if (cpu_has_mips_r1) {

Doesn't cpu_has_mips_r1 cover everything >= r1? ie. everything will now
take this path, including systems >= r2. Don't you want the inverse
(!cpu_has_mips_r2) instead?

Paul

> +				/* Get first byte */
> +				emit_andi(r_tmp_imm, r_A, 0xff, ctx);
> +				/* Shift it */
> +				emit_sll(r_tmp, r_tmp_imm, 8, ctx);
> +				/* Get second byte */
> +				emit_srl(r_tmp_imm, r_A, 8, ctx);
> +				emit_andi(r_tmp_imm, r_tmp_imm, 0xff, ctx);
> +				/* Put everyting together in r_A */
> +				emit_or(r_A, r_tmp, r_tmp_imm, ctx);
> +			} else {
> +				/* R2 and later have the wsbh instruction */
> +				emit_wsbh(r_A, r_A, ctx);
> +			}

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ