In the Linux kernel, the following vulnerability has been resolved:
bpf: Disable preemption in bpfeventoutput
We received report [1] of kernel crash, which is caused by using nesting protection without disabled preemption.
The bpfeventoutput can be called by programs executed by bpfprogrunarraycg function that disabled migration but keeps preemption enabled.
This can cause task to be preempted by another one inside the nesting protection and lead eventually to two tasks using same perfsampledata buffer and cause crashes like:
BUG: kernel NULL pointer dereference, address: 0000000000000001 #PF: supervisor instruction fetch in kernel mode #PF: errorcode(0x0010) - not-present page ... ? perfoutputsample+0x12a/0x9a0 ? finishtaskswitch.isra.0+0x81/0x280 ? perfeventoutput+0x66/0xa0 ? bpfeventoutput+0x13a/0x190 ? bpfeventoutputdata+0x22/0x40 ? bpfprogdfc84bbde731b257cilsock4connect+0x40a/0xacb ? xaload+0x87/0xe0 ? _cgroupbpfrunfiltersockaddr+0xc1/0x1a0 ? releasesock+0x3e/0x90 ? sksetsockopt+0x1a1/0x12f0 ? udppreconnect+0x36/0x50 ? inetdgramconnect+0x93/0xa0 ? _sysconnect+0xb4/0xe0 ? udpsetsockopt+0x27/0x40 ? _pfxudppushpendingframes+0x10/0x10 ? _syssetsockopt+0xdf/0x1a0 ? _x64sysconnect+0xf/0x20 ? dosyscall64+0x3a/0x90 ? entrySYSCALL64after_hwframe+0x72/0xdc
Fixing this by disabling preemption in bpfeventoutput.
[1] https://github.com/cilium/cilium/issues/26756
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/54xxx/CVE-2023-54173.json",
"cna_assigner": "Linux"
}