In the Linux kernel, the following vulnerability has been resolved:
scsi: mpi3mr: Fix issues in mpi3mrgetalltgtinfo()
The function mpi3mrgetalltgtinfo() has four issues:
1) It calculates valid entry length in alltgtinfo assuming the header part of the struct mpi3mrdevicemapinfo would equal to sizeof(u32). The correct size is sizeof(u64).
2) When it calculates the valid entry length kernentrylen, it excludes one entry by subtracting 1 from numdevices.
3) It copies num_device by calling memcpy(). Substitution is enough.
4) It does not specify the calculated length to sgcopyfrombuffer(). Instead, it specifies the payload length which is larger than the alltgtinfo size. It causes "BUG: KASAN: slab-out-of-bounds".
Fix the issues by using the correct header size, removing the subtraction from numdevices, replacing the memcpy() with substitution and specifying the correct length to sgcopyfrombuffer().
[ { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fb428a2005fc1260d18b989cc5199f281617f44d", "target": { "function": "mpi3mr_get_all_tgt_info", "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "signature_version": "v1", "deprecated": false, "digest": { "function_hash": "58206902338918422642390353679053882493", "length": 1967.0 }, "id": "CVE-2023-53320-00e59eb3", "signature_type": "Function" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2f3d3fa5b8ed7d3b147478f42b00b468eeb1ecd2", "target": { "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "signature_version": "v1", "deprecated": false, "digest": { "line_hashes": [ "261643540372754448575269354855289024996", "232560203954095357603895300602404201593", "150577763255568638109940455948681678923", "265488266471283336271810189616041819364", "275327092709101909104044141362238394127", "188903370349185498408091028181041749817", "127683720658357765397000817764982055597", "250629741423942315797487336240809693366", "159895953266099805279392290453120980375", "261908224603768587740752190658996565306", "316862404651083039526170673302619756501", "282398297835421619668074375430049971700", "333147944154616957396707679152253994437", "283731357781907170463767662787339165053", "40267258043009553848614598979159843806", "319902599752871937705435157215910055174", "283192328118606415602869595264175626839", "231940973617834541962183436927575298918", "97720591485486669385724047263462745465", "194382613709283607768431497184718681461", "241167848016586510029349083670403346396", "211922115232546994511533067768489876525", "258541733335681192401661557908795933969" ], "threshold": 0.9 }, "id": "CVE-2023-53320-21659649", "signature_type": "Line" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fb428a2005fc1260d18b989cc5199f281617f44d", "target": { "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "signature_version": "v1", "deprecated": false, "digest": { "line_hashes": [ "261643540372754448575269354855289024996", "232560203954095357603895300602404201593", "150577763255568638109940455948681678923", "265488266471283336271810189616041819364", "275327092709101909104044141362238394127", "188903370349185498408091028181041749817", "127683720658357765397000817764982055597", "250629741423942315797487336240809693366", "159895953266099805279392290453120980375", "261908224603768587740752190658996565306", "316862404651083039526170673302619756501", "282398297835421619668074375430049971700", "333147944154616957396707679152253994437", "283731357781907170463767662787339165053", "40267258043009553848614598979159843806", "319902599752871937705435157215910055174", "283192328118606415602869595264175626839", "231940973617834541962183436927575298918", "97720591485486669385724047263462745465", "194382613709283607768431497184718681461", "241167848016586510029349083670403346396", "211922115232546994511533067768489876525", "258541733335681192401661557908795933969" ], "threshold": 0.9 }, "id": "CVE-2023-53320-6eb8e332", "signature_type": "Line" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ba997b22f2cd5d29aad8c39f6201f7608ed0c04", "target": { "function": "mpi3mr_get_all_tgt_info", "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "signature_version": "v1", "deprecated": false, "digest": { "function_hash": "58206902338918422642390353679053882493", "length": 1967.0 }, "id": "CVE-2023-53320-9706ad78", "signature_type": "Function" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2f3d3fa5b8ed7d3b147478f42b00b468eeb1ecd2", "target": { "function": "mpi3mr_get_all_tgt_info", "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "signature_version": "v1", "deprecated": false, "digest": { "function_hash": "58206902338918422642390353679053882493", "length": 1967.0 }, "id": "CVE-2023-53320-adb4b10d", "signature_type": "Function" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ba997b22f2cd5d29aad8c39f6201f7608ed0c04", "target": { "file": "drivers/scsi/mpi3mr/mpi3mr_app.c" }, "signature_version": "v1", "deprecated": false, "digest": { "line_hashes": [ "261643540372754448575269354855289024996", "232560203954095357603895300602404201593", "150577763255568638109940455948681678923", "265488266471283336271810189616041819364", "275327092709101909104044141362238394127", "188903370349185498408091028181041749817", "127683720658357765397000817764982055597", "250629741423942315797487336240809693366", "159895953266099805279392290453120980375", "261908224603768587740752190658996565306", "316862404651083039526170673302619756501", "282398297835421619668074375430049971700", "333147944154616957396707679152253994437", "283731357781907170463767662787339165053", "40267258043009553848614598979159843806", "319902599752871937705435157215910055174", "283192328118606415602869595264175626839", "231940973617834541962183436927575298918", "97720591485486669385724047263462745465", "194382613709283607768431497184718681461", "241167848016586510029349083670403346396", "211922115232546994511533067768489876525", "258541733335681192401661557908795933969" ], "threshold": 0.9 }, "id": "CVE-2023-53320-e456a91d", "signature_type": "Line" } ]