-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
When showing dependencies, bpfvv now correctly identifies instructions with "side-effect" changes. That is, when the verifier prints an updated value for a slot that is not directly affected by the instruction.
Example (extracted from this log):
6: (15) if r6 == 0x0 goto pc+104 ; R6_w=ptr_node_data(ref_obj_id=2) refs=2
60: (85) call bpf_rbtree_add_impl#54894 ; R0_w=scalar() R6=ptr_node_data(non_own_ref) R7=2 R8=ptr_node_data(non_own_ref,off=16) R9=ptr_node_data(non_own_ref,off=16) R10=fp0
99: (55) if r0 != 0x0 goto pc+13 113: R0_w=ptr_node_data(non_own_ref,off=16) R6=scalar() R7=5 R8=scalar() R9=scalar() R10=fp0
120: (79) r7 = *(u64 *)(r6 +8)
If you load this into bpfvv, and click on r6 at instruction 120, the app correctly detects side-effects changing r6:
- at 60:
ptr_node_data(ref_obj_id=2)->ptr_node_data(non_own_ref) - at 99:
ptr_node_data(non_own_ref)->scalar()
Because of that instructions 60 and 99 are highlighted. However, in order to see how r6 changed there, one has to click on the line to and see the change in the state panel:
output.mp4
The task is to detect this situation, and modify dependency lines such that tracked value-change is shown. For example, we could show:
if (r0 != 0x0) goto pc+13 ; r6: ptr_node_data(non_own_ref) -> scalar()
Or
if (r0 != 0x0) goto pc+13 ; side-effect on r6
with r6 being interactive