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]
Date:   Thu, 23 Jun 2022 16:44:28 -0700
From:   John Fastabend <john.fastabend@...il.com>
To:     Simon wang <wangchuanguo@...pur.com>, ast@...nel.org,
        daniel@...earbox.net, andrii@...nel.org
Cc:     netdev@...r.kernel.org, bpf@...r.kernel.org,
        linux-kernel@...r.kernel.org, Simon Wang <wangchuanguo@...pur.com>
Subject: RE: [PATCH] bpf: Replace 0 with BPF_K

Simon wang wrote:
> From: Simon Wang <wangchuanguo@...pur.com>
> 
> Enhance readability.
> 
> Signed-off-by: Simon Wang <wangchuanguo@...pur.com>
> ---
>  kernel/bpf/verifier.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 2859901ffbe3..29060f15daab 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -9064,7 +9064,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
>  
>  	if (opcode == BPF_END || opcode == BPF_NEG) {
>  		if (opcode == BPF_NEG) {
> -			if (BPF_SRC(insn->code) != 0 ||
> +			if (BPF_SRC(insn->code) != BPF_K ||
>  			    insn->src_reg != BPF_REG_0 ||
>  			    insn->off != 0 || insn->imm != 0) {
>  				verbose(env, "BPF_NEG uses reserved fields\n");
> -- 
> 2.27.0
> 

Code is fine and seems everywhere else we do this check with

    BPF_SRC(insn->code) != BPF_K

One thing though this should have [PATCH bpf-next] in the title so its
clear the code is targeted for bpf-next. Although in this case its
obvious from the content.

Acked-by: John Fastabend <john.fastabend@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ