CVE-2021-46999: sctp: do asoc update earlier in sctp_sf_do_dupcook_a
In the Linux kernel, the following vulnerability has been resolved:
sctp: do asoc update earlier in sctpsfdodupcooka
There's a panic that occurs in a few of envs, the call trace is as below:
[] general protection fault, ... 0x29acd70f1000a: 0000 [#1] SMP PTI [] RIP: 0010:sctpulpeventnotifypeeraddrchange+0x4b/0x1fa [sctp] [] sctpassoccontroltransport+0x1b9/0x210 [sctp] [] sctpdo82transportstrike.isra.16+0x15c/0x220 [sctp] [] sctpcmdinterpreter.isra.21+0x1231/0x1a10 [sctp] [] sctpdosm+0xc3/0x2a0 [sctp] [] sctpgeneratetimeoutevent+0x81/0xf0 [sctp]
This is caused by a transport use-after-free issue. When processing a duplicate COOKIE-ECHO chunk in sctpsfdodupcooka(), both COOKIE-ACK and SHUTDOWN chunks are allocated with the transort from the new asoc. However, later in the sideeffect machine, the old asoc is used to send them out and old asoc's shutdownlastsentto is set to the transport that SHUTDOWN chunk attached to in sctpcmdsetupt2(), which actually belongs to the new asoc. After the newasoc is freed and the old asoc T2 timeout, the old asoc's shutdownlastsentto that is already freed would be accessed in sctpsft2timerexpire().
Thanks Alexander and Jere for helping dig into this issue.
To fix it, this patch is to do the asoc update first, then allocate the COOKIE-ACK and SHUTDOWN chunks with the 'updated' old asoc. This would make more sense, as a chunk from an asoc shouldn't be sent out with another asoc. We had fixed quite a few issues caused by this.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2021-46999?
CVE-2021-46999 is classified with high severity due to its potential to cause kernel panic in affected systems.
How do I fix CVE-2021-46999?
To fix CVE-2021-46999, update your Linux kernel to a version that is above the affected thresholds as specified by the vulnerability.
Which versions of the Linux kernel are affected by CVE-2021-46999?
CVE-2021-46999 affects Linux kernel versions 4.19.123 to 4.19.191, 5.4.41 to 5.4.120, 5.7 to 5.10.38, and 5.11 to 5.11.22.
What symptoms indicate an issue related to CVE-2021-46999?
Symptoms of CVE-2021-46999 may include unexpected system crashes or kernel panics while using affected Linux kernel versions.
Is there any workaround for CVE-2021-46999?
There are no specific workarounds for CVE-2021-46999; the best approach is to apply the patch by upgrading the kernel.