Commit b49f986
committed
fix(userspace/libsinsp/parsers): guard against invalid cmsg_len values
Guard against invalid `cmsg_len` values while accessing control
messages in ancillary data. This is achieved by checking there is
enough space between between cmsg and the end of the buffer to hold
the current cmsg and the next one.
This change sync the implementation of `ppm_cmsg_nxthdr()` with the
current glibc implementation:
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/cmsg_nxthdr.c;h=0e602a16053ed6742ea1556d75de8540e49157f1;hb=170550da27f68a08589e91b541883dcc58dee640
Signed-off-by: Leonardo Di Giovanna <[email protected]>1 parent 9e6a8cc commit b49f986
1 file changed
+15
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3180 | 3180 | | |
3181 | 3181 | | |
3182 | 3182 | | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
3183 | 3188 | | |
3184 | 3189 | | |
3185 | 3190 | | |
| |||
3191 | 3196 | | |
3192 | 3197 | | |
3193 | 3198 | | |
3194 | | - | |
3195 | | - | |
3196 | | - | |
3197 | | - | |
3198 | | - | |
3199 | | - | |
3200 | | - | |
3201 | | - | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
3202 | 3205 | | |
3203 | 3206 | | |
3204 | | - | |
| 3207 | + | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
3205 | 3211 | | |
3206 | 3212 | | |
3207 | 3213 | | |
| |||
0 commit comments