In the Linux kernel, the following vulnerability has been resolved: can: isotp: fix potential CAN frame reception race in isotprcv() When receiving a CAN frame the current code logic does not consider concurrently receiving processes which do not show up in real world usage. Ziyang Xuan writes: The following syz problem is one of the scenarios. so->rx.len is changed by isotprcvff() during isotprcvcf(), so->rx.len equals 0 before allocskb() and equals 4096 after allocskb(). That will trigger skboverpanic() in skbput(). ======================================================= CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 5.16.0-rc8-syzkaller #0 RIP: 0010:skbpanic+0x16c/0x16e net/core/skbuff.c:113 Call Trace: <TASK> skboverpanic net/core/skbuff.c:118 [inline] skbput.cold+0x24/0x24 net/core/skbuff.c:1990 isotprcvcf net/can/isotp.c:570 [inline] isotprcv+0xa38/0x1e30 net/can/isotp.c:668 deliver net/can/afcan.c:574 [inline] canrcvfilter+0x445/0x8d0 net/can/afcan.c:635 canreceive+0x31d/0x580 net/can/afcan.c:665 canrcv+0x120/0x1c0 net/can/afcan.c:696 _netifreceiveskbonecore+0x114/0x180 net/core/dev.c:5465 _netifreceiveskb+0x24/0x1b0 net/core/dev.c:5579 Therefore we make sure the state changes and data structures stay consistent at CAN frame reception time by adding a spinlock in isotp_rcv(). This fixes the issue reported by syzkaller but does not affect real world operation.
{ "availability": "No subscription required", "binaries": [ { "binary_name": "linux-buildinfo-5.15.0-1008-intel-iotg", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-cloud-tools-5.15.0-1008-intel-iotg", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-headers-5.15.0-1008-intel-iotg", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-image-unsigned-5.15.0-1008-intel-iotg", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-image-unsigned-5.15.0-1008-intel-iotg-dbgsym", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-intel-iotg-5.15-cloud-tools-5.15.0-1008", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-intel-iotg-5.15-cloud-tools-common", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-intel-iotg-5.15-headers-5.15.0-1008", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-intel-iotg-5.15-tools-5.15.0-1008", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-intel-iotg-5.15-tools-common", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-intel-iotg-5.15-tools-host", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-modules-5.15.0-1008-intel-iotg", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-modules-extra-5.15.0-1008-intel-iotg", "binary_version": "5.15.0-1008.11~20.04.1" }, { "binary_name": "linux-tools-5.15.0-1008-intel-iotg", "binary_version": "5.15.0-1008.11~20.04.1" } ] }