diff options
author | Eduard Zingerman <[email protected]> | 2022-11-16 00:48:58 +0200 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2022-11-15 17:38:36 -0800 |
commit | befae75856ab406a3f3fab2aa2118cf3b2dfe3e6 (patch) | |
tree | df373b27a681958e041929cd5a91b7f679616905 /tools/perf/scripts/python/sctop.py | |
parent | 32637e33003f36e75e9147788cc0e2f21706ef99 (diff) |
bpf: propagate nullness information for reg to reg comparisons
Propagate nullness information for branches of register to register
equality compare instructions. The following rules are used:
- suppose register A maybe null
- suppose register B is not null
- for JNE A, B, ... - A is not null in the false branch
- for JEQ A, B, ... - A is not null in the true branch
E.g. for program like below:
r6 = skb->sk;
r7 = sk_fullsock(r6);
r0 = sk_fullsock(r6);
if (r0 == 0) return 0; (a)
if (r0 != r7) return 0; (b)
*r7->type; (c)
return 0;
It is safe to dereference r7 at point (c), because of (a) and (b).
Signed-off-by: Eduard Zingerman <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sctop.py')
0 files changed, 0 insertions, 0 deletions