Commit 3297b35
tools/gethostlatency,slabratetop: read strings with bpf_probe_read_*_str
The BCC versions have the same defect as the libbpf-tools versions: the host argument and the slab cache name are read with the fixed-size bpf_probe_read_user()/bpf_probe_read_kernel() helpers, which copy past the source string's NUL terminator and leak adjacent memory into the map value and perf output.
Use the NUL-stopping *_str variants so only the string is copied into the zero-initialized destination.1 parent 12afbb3 commit 3297b35
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
0 commit comments