-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Verifier prints bits of information about held resources (locks etc.). There is refs=1,2,3 to indicate object ids, and then ref_id=1 can be found in the values.
One of the common problems is to find the origin of a resource that was not released properly. While it can be done already with register tracking, it's not obvious how to associate a "ref" with a value. The bpfvv UI should make it obvious and/or easy to find.
Trivial example:
; bpf_iter_num_new(&it, 0, BPFJ_MAX_POD_PER_PID); @ maps.h:204
32: (b4) w2 = 0 ; R2_w=0
33: (b4) w3 = 4 ; R3_w=4
34: (85) call bpf_iter_num_new#53307 ; R0_w=scalar() fp-32_w=iter_num(ref_id=2,state=active,depth=0) refs=2
35: (bf) r1 = r10 ; R1_w=fp0 R10=fp0 refs=2
36: (07) r1 += -32 ; R1=fp-32 refs=2
; while ((v = bpf_iter_num_next(&it))) { @ maps.h:205
37: (85) call bpf_iter_num_next#53310 ; R0_w=0 fp-32=iter_num(ref_id=2,state=drained,depth=0) refs=2
38: (bf) r1 = r0 ; R0_w=0 R1_w=0 refs=2
39: (b7) r0 = 0 ; R0_w=0 refs=2
40: (15) if r1 == 0x0 goto pc+12 ; R1_w=0 refs=2
; if (!exists) { @ maps.h:212
53: (7b) *(u64 *)(r10 -104) = r0 ; R0_w=0 R10=fp0 fp-104_w=0 refs=2
54: (bf) r1 = r10 ; R1_w=fp0 R10=fp0 refs=2
55: (07) r1 += -32 ; R1_w=fp-32 refs=2
56: (85) call bpf_iter_num_destroy#53304 ;