diff options
| author | Eduard Zingerman <eddyz87@gmail.com> | 2023-06-13 18:38:24 +0300 | 
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2023-06-13 15:15:13 -0700 | 
| commit | 18b89265572b5c899522b6c1f8698e87edfad369 (patch) | |
| tree | b54adfd56be610fc6423c01aaf05b1364fb91a23 /lib/debugobjects.c | |
| parent | 1ffc85d9298e0ca0137ba65c93a786143fe167b8 (diff) | |
selftests/bpf: Verify that check_ids() is used for scalars in regsafe()
Verify that the following example is rejected by verifier:
  r9 = ... some pointer with range X ...
  r6 = ... unbound scalar ID=a ...
  r7 = ... unbound scalar ID=b ...
  if (r6 > r7) goto +1
  r7 = r6
  if (r7 > X) goto exit
  r9 += r6
  *(u64 *)r9 = Y
Also add test cases to:
- check that check_alu_op() for BPF_MOV instruction does not allocate
  scalar ID if source register is a constant;
- check that unique scalar IDs are ignored when new verifier state is
  compared to cached verifier state;
- check that two different scalar IDs in a verified state can't be
  mapped to the same scalar ID in current state.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230613153824.3324830-5-eddyz87@gmail.com
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions
