> On Jun 24, 2025, at 3:18 PM, Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: > > On Tue, 2025-06-24 at 15:00 -0700, Song Liu wrote: > > [...] > >> +SEC("lsm.s/socket_connect") >> +__success __log_level(2) >> +__msg("0: (b7) r0 = 1") >> +__msg("1: (84) w0 = -w0") > > Sorry, my previous comment probably was ambiguous. > What I meant is that you can match verifier output for "w0 = -w0 ; R0=-1", > thus checking that inferred value for "w0". Ah, I removed that part because I found some other __msg doesn’t have the whole line. Let me add it back. Thanks, Song > >> +__msg("mark_precise: frame0: last_idx 2 first_idx 0 subseq_idx -1") >> +__msg("mark_precise: frame0: regs=r0 stack= before 1: (84) w0 = -w0") >> +__msg("mark_precise: frame0: regs=r0 stack= before 0: (b7) r0 = 1") >> +__naked int bpf_neg_2(void) >> +{ >> + /* >> + * lsm.s/socket_connect requires a return value within [-4095, 0]. >> + * Returning -1 is allowed >> + */ >> + asm volatile ( >> + "r0 = 1;" >> + "w0 = -w0;" >> + "exit;" >> + ::: __clobber_all); >> +} > > [...]