bpf: Verify scalar ids mapping in regsafe() using check_ids()

[ Upstream commit 1ffc85d929 ]

Make sure that the following unsafe example is rejected by verifier:

1: r9 = ... some pointer with range X ...
2: r6 = ... unbound scalar ID=a ...
3: r7 = ... unbound scalar ID=b ...
4: if (r6 > r7) goto +1
5: r6 = r7
6: if (r6 > X) goto ...
This commit is contained in:
Eduard Zingerman 2023-06-13 18:38:23 +03:00 • committed by Greg Kroah-Hartman
commit ae3c237881
2 changed files with 79 additions and 29 deletions