In the Linux kernel, the following vulnerability has been resolved:
scsi: mpi3mr: Avoid memcpy field-spanning write WARNING
When the "storcli2 show" command is executed for eHBA-9600, mpi3mr driver prints this WARNING message:
memcpy: detected field-spanning write (size 128) of single field "bsgreplybuf->replybuf" at drivers/scsi/mpi3mr/mpi3mrapp.c:1658 (size 1) WARNING: CPU: 0 PID: 12760 at drivers/scsi/mpi3mr/mpi3mrapp.c:1658 mpi3mrbsg_request+0x6b12/0x7f10 [mpi3mr]
The cause of the WARN is 128 bytes memcpy to the 1 byte size array "_u8 replaybuf[1]" in the struct mpi3mrbsginreplybuf. The array is intended to be a flexible length array, so the WARN is a false positive.
To suppress the WARN, remove the constant number '1' from the array declaration and clarify that it has flexible length. Also, adjust the memory allocation size to match the change.
[ { "signature_type": "Function", "id": "CVE-2024-36920-0c993254", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f09318244c6cafd10aca741b9c01e0a2c362d43a", "signature_version": "v1", "target": { "function": "mpi3mr_bsg_process_mpt_cmds", "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "digest": { "function_hash": "293453829915905586810073817671293286676", "length": 11253.0 }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-36920-21a36968", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d2772324f43cf5674ac3dbe3f74a7e656396716", "signature_version": "v1", "target": { "function": "mpi3mr_bsg_process_mpt_cmds", "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "digest": { "function_hash": "261265001816911155169519989826585994645", "length": 12634.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-36920-3b27886a", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f09318244c6cafd10aca741b9c01e0a2c362d43a", "signature_version": "v1", "target": { "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "188907995007292714330879446429895332379", "28660054659361153261615285911310330394", "98956436018142948930608588401574229418", "32548739152296959782015506416483625643" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-36920-488f2e6d", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@429846b4b6ce9853e0d803a2357bb2e55083adf0", "signature_version": "v1", "target": { "function": "mpi3mr_bsg_process_mpt_cmds", "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "digest": { "function_hash": "261265001816911155169519989826585994645", "length": 12634.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-36920-6340b565", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5f0266044dc611563539705bff0b3e1545fbb6aa", "signature_version": "v1", "target": { "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "188907995007292714330879446429895332379", "28660054659361153261615285911310330394", "98956436018142948930608588401574229418", "32548739152296959782015506416483625643" ] }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-36920-7cd51ccf", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f09318244c6cafd10aca741b9c01e0a2c362d43a", "signature_version": "v1", "target": { "file": "include/uapi/scsi/scsi_bsg_mpi3mr.h" }, "digest": { "threshold": 0.9, "line_hashes": [ "149702816995683853108620686572014689049", "207613560510058207459899689150939843549", "291694449306403875223362436902353361939", "231421485681236880092670687585575722194" ] }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-36920-82a473db", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d2772324f43cf5674ac3dbe3f74a7e656396716", "signature_version": "v1", "target": { "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "188907995007292714330879446429895332379", "28660054659361153261615285911310330394", "98956436018142948930608588401574229418", "32548739152296959782015506416483625643" ] }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-36920-a80a3c97", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d2772324f43cf5674ac3dbe3f74a7e656396716", "signature_version": "v1", "target": { "file": "include/uapi/scsi/scsi_bsg_mpi3mr.h" }, "digest": { "threshold": 0.9, "line_hashes": [ "149702816995683853108620686572014689049", "207613560510058207459899689150939843549", "291694449306403875223362436902353361939", "231421485681236880092670687585575722194" ] }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-36920-b6b70bf0", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@429846b4b6ce9853e0d803a2357bb2e55083adf0", "signature_version": "v1", "target": { "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "188907995007292714330879446429895332379", "28660054659361153261615285911310330394", "98956436018142948930608588401574229418", "32548739152296959782015506416483625643" ] }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-36920-bdd5fd0f", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5f0266044dc611563539705bff0b3e1545fbb6aa", "signature_version": "v1", "target": { "file": "include/uapi/scsi/scsi_bsg_mpi3mr.h" }, "digest": { "threshold": 0.9, "line_hashes": [ "149702816995683853108620686572014689049", "207613560510058207459899689150939843549", "291694449306403875223362436902353361939", "231421485681236880092670687585575722194" ] }, "deprecated": false }, { "signature_type": "Function", "id": "CVE-2024-36920-c6d0bf6c", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5f0266044dc611563539705bff0b3e1545fbb6aa", "signature_version": "v1", "target": { "function": "mpi3mr_bsg_process_mpt_cmds", "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "digest": { "function_hash": "293453829915905586810073817671293286676", "length": 11253.0 }, "deprecated": false }, { "signature_type": "Line", "id": "CVE-2024-36920-fe116be5", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@429846b4b6ce9853e0d803a2357bb2e55083adf0", "signature_version": "v1", "target": { "file": "include/uapi/scsi/scsi_bsg_mpi3mr.h" }, "digest": { "threshold": 0.9, "line_hashes": [ "149702816995683853108620686572014689049", "207613560510058207459899689150939843549", "291694449306403875223362436902353361939", "231421485681236880092670687585575722194" ] }, "deprecated": false } ]