In the Linux kernel, the following vulnerability has been resolved:
scsi: target: core: Fix null-ptr-deref in targetallocdevice()
There is a null-ptr-deref issue reported by KASAN:
BUG: KASAN: null-ptr-deref in targetallocdevice+0xbc4/0xbe0 [targetcoremod] ... kasanreport+0xb9/0xf0 targetallocdevice+0xbc4/0xbe0 [targetcoremod] coredevsetupvirtuallun0+0xef/0x1f0 [targetcoremod] targetcoreinitconfigfs+0x205/0x420 [targetcoremod] dooneinitcall+0xdd/0x4e0 ... entrySYSCALL64afterhwframe+0x76/0x7e
In targetallocdevice(), if allocing memory for dev queues fails, then dev will be freed by dev->transport->free_device(), but dev->transport is not initialized at that time, which will lead to a null pointer reference problem.
Fixing this bug by freeing dev with hba->backend->ops->free_device().
[
{
"id": "CVE-2024-50153-10ba0540",
"deprecated": false,
"digest": {
"length": 3948.0,
"function_hash": "270153132706562942998154451790487979835"
},
"target": {
"file": "drivers/target/target_core_device.c",
"function": "target_alloc_device"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@39e02fa90323243187c91bb3e8f2f5f6a9aacfc7",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50153-35e513bd",
"deprecated": false,
"digest": {
"line_hashes": [
"9796295624056508543570169748014124456",
"135944201524415491999043085396732965779",
"295854896289259583426964603807318953153",
"8004373591857622924963363257476699285"
],
"threshold": 0.9
},
"target": {
"file": "drivers/target/target_core_device.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@39e02fa90323243187c91bb3e8f2f5f6a9aacfc7",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50153-4f0caec6",
"deprecated": false,
"digest": {
"length": 4066.0,
"function_hash": "173544681791544542753282370781121308310"
},
"target": {
"file": "drivers/target/target_core_device.c",
"function": "target_alloc_device"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@14a6a2adb440e4ae97bee73b2360946bd033dadd",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50153-59878d8d",
"deprecated": false,
"digest": {
"length": 3948.0,
"function_hash": "270153132706562942998154451790487979835"
},
"target": {
"file": "drivers/target/target_core_device.c",
"function": "target_alloc_device"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@895ab729425ef9bf3b6d2f8d0853abe64896f314",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50153-63ffe268",
"deprecated": false,
"digest": {
"line_hashes": [
"9796295624056508543570169748014124456",
"135944201524415491999043085396732965779",
"295854896289259583426964603807318953153",
"8004373591857622924963363257476699285"
],
"threshold": 0.9
},
"target": {
"file": "drivers/target/target_core_device.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b80e9bc85bd9af378e7eac83e15dd129557bbdb6",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50153-6a5783d2",
"deprecated": false,
"digest": {
"length": 4001.0,
"function_hash": "194904447991616432191641188238860055396"
},
"target": {
"file": "drivers/target/target_core_device.c",
"function": "target_alloc_device"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b80e9bc85bd9af378e7eac83e15dd129557bbdb6",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50153-7a67b769",
"deprecated": false,
"digest": {
"length": 4066.0,
"function_hash": "173544681791544542753282370781121308310"
},
"target": {
"file": "drivers/target/target_core_device.c",
"function": "target_alloc_device"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fca6caeb4a61d240f031914413fcc69534f6dc03",
"signature_version": "v1",
"signature_type": "Function"
},
{
"id": "CVE-2024-50153-8073733a",
"deprecated": false,
"digest": {
"line_hashes": [
"9796295624056508543570169748014124456",
"135944201524415491999043085396732965779",
"295854896289259583426964603807318953153",
"8004373591857622924963363257476699285"
],
"threshold": 0.9
},
"target": {
"file": "drivers/target/target_core_device.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8c1e6717f60d31f8af3937c23c4f1498529584e1",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50153-8579cbd0",
"deprecated": false,
"digest": {
"line_hashes": [
"9796295624056508543570169748014124456",
"135944201524415491999043085396732965779",
"295854896289259583426964603807318953153",
"8004373591857622924963363257476699285"
],
"threshold": 0.9
},
"target": {
"file": "drivers/target/target_core_device.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@895ab729425ef9bf3b6d2f8d0853abe64896f314",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50153-bc8690e2",
"deprecated": false,
"digest": {
"line_hashes": [
"9796295624056508543570169748014124456",
"135944201524415491999043085396732965779",
"295854896289259583426964603807318953153",
"8004373591857622924963363257476699285"
],
"threshold": 0.9
},
"target": {
"file": "drivers/target/target_core_device.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fca6caeb4a61d240f031914413fcc69534f6dc03",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50153-bf743eba",
"deprecated": false,
"digest": {
"line_hashes": [
"9796295624056508543570169748014124456",
"135944201524415491999043085396732965779",
"295854896289259583426964603807318953153",
"8004373591857622924963363257476699285"
],
"threshold": 0.9
},
"target": {
"file": "drivers/target/target_core_device.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@14a6a2adb440e4ae97bee73b2360946bd033dadd",
"signature_version": "v1",
"signature_type": "Line"
},
{
"id": "CVE-2024-50153-f1f65562",
"deprecated": false,
"digest": {
"length": 3795.0,
"function_hash": "37940184237149736887484006150729614264"
},
"target": {
"file": "drivers/target/target_core_device.c",
"function": "target_alloc_device"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8c1e6717f60d31f8af3937c23c4f1498529584e1",
"signature_version": "v1",
"signature_type": "Function"
}
]