In the Linux kernel, the following vulnerability has been resolved:
tipc: do not update mtu if msg_max is too small in mtu negotiation
When doing link mtu negotiation, a malicious peer may send Activate msg with a very small mtu, e.g. 4 in Shuang's testing, without checking for the minimum mtu, l->mtu will be set to 4 in tipclinkprotorcv(), then n->links[bearerid].mtu is set to 4294967228, which is a overflow of '4 - INTHSIZE - EMSGOVERHEAD' in tipclink_mss().
With tipclink.mtu = 4, tipclink_xmit() kept printing the warning:
tipc: Too large msg, purging xmit list 1 5 0 40 4! tipc: Too large msg, purging xmit list 1 15 0 60 4!
And with tipclinkentry.mtu 4294967228, a huge skb was allocated in nameddistribute(), and when purging it in tipclink_xmit(), a crash was even caused:
general protection fault, probably for non-canonical address 0x2100001011000dd: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 0 Comm: swapper/0 Kdump: loaded Not tainted 6.3.0.neta #19 RIP: 0010:kfreeskblistreason+0x7e/0x1f0 Call Trace: <IRQ> skbreleasedata+0xf9/0x1d0 kfreeskbreason+0x40/0x100 tipclinkxmit+0x57a/0x740 [tipc] tipcnodexmit+0x16c/0x5c0 [tipc] tipcnamednodeup+0x27f/0x2c0 [tipc] tipcnodewriteunlock+0x149/0x170 [tipc] tipcrcv+0x608/0x740 [tipc] tipcudprecv+0xdc/0x1f0 [tipc] udpqueuercvoneskb+0x33e/0x620 udpunicastrcvskb.isra.72+0x75/0x90 _udp4librcv+0x56d/0xc20 ipprotocoldeliver_rcu+0x100/0x2d0
This patch fixes it by checking the new mtu against tipcbearermin_mtu(), and not updating mtu if it is too small.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53517.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53517.json"
[
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@259683001d7e879fea4b42084fb6560dd9408a7e",
"digest": {
"function_hash": "289342067098478517294204875294795840747",
"length": 3476.0
},
"id": "CVE-2023-53517-af7d7006",
"deprecated": false,
"target": {
"file": "net/tipc/link.c",
"function": "tipc_link_proto_rcv"
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@259683001d7e879fea4b42084fb6560dd9408a7e",
"digest": {
"line_hashes": [
"286898587965777548265895427857214415579",
"293060327653849264792986410263907644785",
"201417332161202009188722227721276882814",
"139053883701243259021311672072225731745",
"191643029191942085673328533292373190614",
"146978619611099553111680329021526711718",
"320094149984780896643356964358757965779",
"145736015037802524605537945005005426316",
"247466750264569758582281100850074352765",
"19344050030075946517718722365861857467",
"53207856516563346610382663766756296452",
"239398459773780221571749433871039461216",
"118831700203244048023267973477606380449"
],
"threshold": 0.9
},
"id": "CVE-2023-53517-b069314d",
"deprecated": false,
"target": {
"file": "net/tipc/link.c"
}
}
]