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: <ca871055-0b4c-4380-8f32-a4a7152345c6@isovalent.com>
Date: Mon, 9 Dec 2024 18:01:44 +0100
From: Simone Magnani <simone.magnani@...valent.com>
To: Quentin Monnet <qmo@...nel.org>, bpf@...r.kernel.org
Cc: ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
 martin.lau@...ux.dev, eddyz87@...il.com, song@...nel.org,
 yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org,
 sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org, nathan@...nel.org,
 ndesaulniers@...gle.com, morbo@...gle.com, justinstitt@...gle.com,
 linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH bpf-next v2] bpftool: Probe for ISA v4 instruction set
 extension

On 09/12/24 16:20, Quentin Monnet wrote:
> Looking again at the probe itself, does the second instruction serve any
> practical purpose here? Don't you just need to test the BPF_JMP32_A?
> 
> Looks good otherwise, thank you!
> 
> Reviewed-by: Quentin Monnet <qmo@...nel.org>

I wanted to keep probes similar to the previous ones (especially v3
and v2), despite we never check their return codes. This means
having as 4th instruction `BPF_MOV64_IMM(BPF_REG_0, 1)`. However,
to do so, I also need the 2nd instruction, otherwise I'd hit an
`Invalid Argument` error while calling `bpf_prog_load()`: I think
that would be due to the fact that no execution paths would
execute that instruction otherwise.

An alternative approach less consistent with the others would be:

struct bpf_insn insns[3] = {
		BPF_MOV64_IMM(BPF_REG_0, 0),
		BPF_JMP32_A(0),
		BPF_EXIT_INSN()
	};

Please let me know if you have any further questions, need
additional information, or if I could improve the patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ