Commit 9e6a8cc
fix(userspace/libsinsp): prevent infinite loop in ancillary data parsing due to integer overflow
Add validation in ppm_cmsg_nxthdr to ensure cmsg_aligned_len is at least
sizeof(ppm_cmsghdr) after alignment calculation. This prevents an infinite
loop when malformed ancillary data contains cmsg_len = 0xFFFFFFFFFFFFFFFF,
which causes integer overflow in PPM_CMSG_ALIGN macro, resulting in
cmsg_aligned_len = 0 and preventing forward progress in the loop.
Signed-off-by: Francesco Emmi <[email protected]>1 parent 9b8a8e4 commit 9e6a8cc
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3192 | 3192 | | |
3193 | 3193 | | |
3194 | 3194 | | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
3195 | 3199 | | |
3196 | 3200 | | |
3197 | 3201 | | |
| |||
0 commit comments