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: <98c2ad67-2672-4eef-b952-18e6ad28a027@kernel.org>
Date: Mon, 9 Dec 2024 17:05:57 +0000
From: Quentin Monnet <qmo@...nel.org>
To: Simone Magnani <simone.magnani@...valent.com>, 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

2024-12-09 18:01 UTC+0100 ~ Simone Magnani <simone.magnani@...valent.com>
> 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.


Right, that's what I missed.


> 
> 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.


No it's all good to me in that case, thank you!

Quentin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ