On Fri, 2023-11-17 at 11:47 -0500, Andrii Nakryiko wrote: [...] > > +SEC("?raw_tp") > > +__success __log_level(2) > > +/* Check that last verified exit from the program visited each > > + * callback expected number of times: one visit per callback for each > > + * top level bpf_loop call. > > + */ > > +__msg("r1 = *(u64 *)(r10 -16) ; R1_w=111111 R10=fp0 fp-16=111111") > > +/* Ensure that read above is the last one by checking that there are > > + * no more reads for ctx.i. > > + */ > > +__not_msg("r1 = *(u64 *)(r10 -16) ; R1_w=") > > can't you enforce that we don't go above 111111 just by making sure to > use r1 - 111111 + 1 as an index into choice_arr()? > > We can then simplify the patch set by dropping __not_msg() parts (and > can add them separately). Well, r1 could be 0 as well, so idx would be out of bounds. But I like the idea, it is possible to check that r1 is either 00000, 100000, ..., 111111 and do something unsafe otherwise. Thank you. I'll drop __not_msg() then.