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: <ZPmOUYBdRxR1/8vw@shell.armlinux.org.uk>
Date:   Thu, 7 Sep 2023 09:48:17 +0100
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Puranjay Mohan <puranjay12@...il.com>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <martin.lau@...ux.dev>,
        Song Liu <song@...nel.org>,
        Yonghong Song <yonghong.song@...ux.dev>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Stanislav Fomichev <sdf@...gle.com>,
        Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
        Shubham Bansal <illusionist.neo@...il.com>,
        Mykola Lysenko <mykolal@...com>, Shuah Khan <shuah@...nel.org>,
        bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v2 4/8] arm32, bpf: add support for
 unconditional bswap instruction

On Wed, Sep 06, 2023 at 06:33:16PM +0000, Puranjay Mohan wrote:
> @@ -1633,8 +1633,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
>  	/* dst = htobe(dst) */
>  	case BPF_ALU | BPF_END | BPF_FROM_LE:
>  	case BPF_ALU | BPF_END | BPF_FROM_BE:
> +	/* dst = bswap(dst) */
> +	case BPF_ALU64 | BPF_END | BPF_TO_LE:
>  		rd = arm_bpf_get_reg64(dst, tmp, ctx);
> -		if (BPF_SRC(code) == BPF_FROM_LE)
> +		if (BPF_SRC(code) == BPF_FROM_LE && BPF_CLASS(code) != BPF_ALU64)

With the addition of the BPF_ALU64 case, I'm wondering why this if() is
affected. If you were adding:

	case BPF_ALU64 | BPF_END | BPF_FROM_LE:

then maybe there would be a reason, but the BPF_ALU64 | BPF_END |
BPF_TO_LE case will never match even the original if() statement.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ