Commit 58d22fc
Jyri Sarha
tools: probes: reject oversized data_size_bytes to prevent integer overflow
Add a sanity check in process_sync() to reject packets with
data_size_bytes exceeding 16 MiB before performing the
data_size_bytes + sizeof(uint64_t) addition used for realloc sizing.
Without this check, a crafted probe dump with data_size_bytes near
UINT32_MAX wraps the realloc size to a small value, then the subsequent
data copy writes data_size_bytes into the undersized buffer.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>1 parent 783de8d commit 58d22fc
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
197 | 204 | | |
198 | 205 | | |
199 | 206 | | |
| |||
0 commit comments