You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(net): reject an oversized sockaddr length with EINVAL before reading it
The seccomp-notify trap fires at syscall entry, before the kernel's own
`addrlen > sizeof(sockaddr_storage)` -> EINVAL check, so a child can pass an
`addr_len`/`msg_namelen` up to u32::MAX. Reading it verbatim into
`vec![0u8; len]` let the child force a multi-GiB supervisor allocation
(OOM / alloc-abort of the monitor). Add a `read_sockaddr` helper that rejects a
length larger than a `sockaddr_storage` with EINVAL (matching the kernel) before
the allocation, and route the six connect/sendto/sendmsg/sendmmsg sockaddr reads
through it; a read fault still maps to EIO. Regression test drives a bogus 4 GiB
addr_len and asserts EINVAL plus a surviving supervisor.
Rebased onto main after #128 (net parse/decide/execute refactor): the helper
lives in network/mod.rs and the six reads are in the connect/send/unix submodules.
0 commit comments