sctp: fix OOB write to userspace in sctp_getsockopt_peer_auth_chunks
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 65b07e5d0d09c77e98050b5f0146ead29e5add32 · < 70a089cc9590aa347a61e84434116ab74619e3c3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
sctp: fix OOB write to userspace in sctp_getsockopt_peer_auth_chunks
sctp_getsockopt_peer_auth_chunks() checks that the caller's optval buffer is large enough for the peer AUTH chunk list with
if (len < num_chunks) return -EINVAL;
but then writes num_chunks bytes to p->gauth_chunks, which lives at offset offsetof(struct sctp_authchunks, gauth_chunks) == 8 inside optval. The check is missing the sizeof(struct sctp_authchunks) = 8-byte header. When the caller supplies len == num_chunks (for any num_chunks > 0) the test passes but copy_to_user() writes sizeof(struct sctp_authchunks) = 8 bytes past the declared buffer.
The sibling function sctp_getsockopt_local_auth_chunks() at the next line already has the correct check:
if (len < sizeof(struct sctp_authchunks) + num_chunks) return -EINVAL;
Align the peer variant with its sibling.
From the CVE record · Linux
The Linux kernel’s SCTP peer AUTH chunk getsockopt handler can write eight bytes past the buffer length supplied by the caller. An unprivileged local caller can trigger this with an AUTH-enabled SCTP association and a short buffer; the write affects the caller’s userspace data, not kernel memory.
Engineers running Linux kernels with SCTP support should check their systems; the issue was reproduced on v7.0-13-generic, and no affected-version range was provided.