Re: [PATCH bpf-next v1 1/2] selftests/bpf: Check alignment flag if expected result is REJECT

From: Tiezhu Yang

Date: Thu Mar 12 2026 - 07:07:16 EST


On 03/12/2026 05:29 PM, Paul Chaignon wrote:
On Thu, Mar 12, 2026 at 02:59:57PM +0800, Tiezhu Yang wrote:

...

For example, for the test_verifier 14,
verifier/atomic_cmpxchg.c:215
"Dest pointer in r0 - succeed, check 5",
if remove ".flags = F_NEEDS_EFFICIENT_UNALIGNED_ACCESS,",

I think I'm missing something. Why would you remove this flag?

Are you trying to illustrate that this is a program that could be
rejected because of misaligned accesses?

Yes.

I agree, but here the flag is
set and this program is therefore rejected because of an invalid memory
access; the misalgined access check is skipped in the verifier.

...

-#14/p Dest pointer in r0 - succeed, check 5 OK
+#14/p Dest pointer in r0 - succeed, check 5 OK (NOTE: not executed due to
unknown alignment)

As stated in my previous answer, this note would be incorrect: the
program was executed in test case #14 because it was rejected, not
because of unknown alignment.

OK, please ignore this patch.

Thanks,
Tiezhu