In the Linux kernel, the following vulnerability has been resolved:
scsi: bnx2fc: Make bnx2fcrecvframe() mp safe
Running tests with a debug kernel shows that bnx2fcrecvframe() is modifying the per_cpu lport stats counters in a non-mpsafe way. Just boot a debug kernel and run the bnx2fc driver with the hardware enabled.
[ 1391.699147] BUG: using smpprocessorid() in preemptible [00000000] code: bnx2fc_ [ 1391.699160] caller is bnx2fcrecvframe+0xbf9/0x1760 [bnx2fc] [ 1391.699174] CPU: 2 PID: 4355 Comm: bnx2fcl2threa Kdump: loaded Tainted: G B [ 1391.699180] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013 [ 1391.699183] Call Trace: [ 1391.699188] dumpstacklvl+0x57/0x7d [ 1391.699198] checkpreemptiondisabled+0xc8/0xd0 [ 1391.699205] bnx2fcrecvframe+0xbf9/0x1760 [bnx2fc] [ 1391.699215] ? dorawspintrylock+0xb5/0x180 [ 1391.699221] ? bnx2fcnpivcreatevports.isra.0+0x4e0/0x4e0 [bnx2fc] [ 1391.699229] ? bnx2fcl2rcvthread+0xb7/0x3a0 [bnx2fc] [ 1391.699240] bnx2fcl2rcvthread+0x1af/0x3a0 [bnx2fc] [ 1391.699250] ? bnx2fculpinit+0xc0/0xc0 [bnx2fc] [ 1391.699258] kthread+0x364/0x420 [ 1391.699263] ? rawspinunlockirq+0x24/0x50 [ 1391.699268] ? setkthreadstruct+0x100/0x100 [ 1391.699273] retfromfork+0x22/0x30
Restore the old getcpu/putcpu code with some modifications to reduce the size of the critical section.
[
{
"signature_version": "v1",
"target": {
"file": "drivers/scsi/bnx2fc/bnx2fc_fcoe.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2f5a1ac68bdf2899ce822ab845081922ea8c588e",
"digest": {
"threshold": 0.9,
"line_hashes": [
"283631426871125460532496434218563807479",
"333865113688292026739632001123546834102",
"38009595650112696316970033943933535051",
"85313255352030994724451347221483924334",
"293339136799247555429970042793027724411",
"338822189470214978750009648141355362047",
"49018259340760709593154851417559196510",
"14788641406630829027558408773650736352",
"224049936847281374808302236861733582458",
"46283069331752624766522612840254990684",
"195437967150469314815386365346097966177",
"131558554951379403263372719329844817508",
"233600031023444406536321732390140379087",
"26346739583196215270820343094408135241",
"83454418547756272761643748799798541918",
"52768388593748097118798046737840334656",
"96643495272769302843187334395262443067",
"130527139610754139166537650677853254049",
"301531935809986513773969555691532662418"
]
},
"deprecated": false,
"id": "CVE-2022-48715-09af6265",
"signature_type": "Line"
},
{
"signature_version": "v1",
"target": {
"file": "drivers/scsi/bnx2fc/bnx2fc_fcoe.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@471085571f926a1fe6b1bed095638994dbf23990",
"digest": {
"threshold": 0.9,
"line_hashes": [
"283631426871125460532496434218563807479",
"333865113688292026739632001123546834102",
"38009595650112696316970033943933535051",
"85313255352030994724451347221483924334",
"293339136799247555429970042793027724411",
"338822189470214978750009648141355362047",
"49018259340760709593154851417559196510",
"14788641406630829027558408773650736352",
"224049936847281374808302236861733582458",
"46283069331752624766522612840254990684",
"195437967150469314815386365346097966177",
"131558554951379403263372719329844817508",
"233600031023444406536321732390140379087",
"26346739583196215270820343094408135241",
"83454418547756272761643748799798541918",
"52768388593748097118798046737840334656",
"96643495272769302843187334395262443067",
"130527139610754139166537650677853254049",
"301531935809986513773969555691532662418"
]
},
"deprecated": false,
"id": "CVE-2022-48715-5658ebd9",
"signature_type": "Line"
},
{
"signature_version": "v1",
"target": {
"function": "bnx2fc_recv_frame",
"file": "drivers/scsi/bnx2fc/bnx2fc_fcoe.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2d24336c7214b281b51860e54783dfc65f1248df",
"digest": {
"length": 2759.0,
"function_hash": "309208281969711386473796057404782127800"
},
"deprecated": false,
"id": "CVE-2022-48715-57249127",
"signature_type": "Function"
},
{
"signature_version": "v1",
"target": {
"function": "bnx2fc_recv_frame",
"file": "drivers/scsi/bnx2fc/bnx2fc_fcoe.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@471085571f926a1fe6b1bed095638994dbf23990",
"digest": {
"length": 2759.0,
"function_hash": "309208281969711386473796057404782127800"
},
"deprecated": false,
"id": "CVE-2022-48715-6829cfbd",
"signature_type": "Function"
},
{
"signature_version": "v1",
"target": {
"function": "bnx2fc_recv_frame",
"file": "drivers/scsi/bnx2fc/bnx2fc_fcoe.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2f5a1ac68bdf2899ce822ab845081922ea8c588e",
"digest": {
"length": 2759.0,
"function_hash": "309208281969711386473796057404782127800"
},
"deprecated": false,
"id": "CVE-2022-48715-8c3db2f7",
"signature_type": "Function"
},
{
"signature_version": "v1",
"target": {
"file": "drivers/scsi/bnx2fc/bnx2fc_fcoe.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2d24336c7214b281b51860e54783dfc65f1248df",
"digest": {
"threshold": 0.9,
"line_hashes": [
"283631426871125460532496434218563807479",
"333865113688292026739632001123546834102",
"38009595650112696316970033943933535051",
"85313255352030994724451347221483924334",
"293339136799247555429970042793027724411",
"338822189470214978750009648141355362047",
"49018259340760709593154851417559196510",
"14788641406630829027558408773650736352",
"224049936847281374808302236861733582458",
"46283069331752624766522612840254990684",
"195437967150469314815386365346097966177",
"131558554951379403263372719329844817508",
"233600031023444406536321732390140379087",
"26346739583196215270820343094408135241",
"83454418547756272761643748799798541918",
"52768388593748097118798046737840334656",
"96643495272769302843187334395262443067",
"130527139610754139166537650677853254049",
"301531935809986513773969555691532662418"
]
},
"deprecated": false,
"id": "CVE-2022-48715-9048220b",
"signature_type": "Line"
}
]