In the Linux kernel, the following vulnerability has been resolved:
dma-buf/dma-resv: Stop leaking on krealloc() failure
Currently dmaresvgetfences() will leak the previously allocated array if the fence iteration got restarted and the kreallocarray() fails.
Free the old array by hand, and make sure we still clear the returned *fences so the caller won't end up accessing freed memory. Some (but not all) of the callers of dmaresvgetfences() seem to still trawl through the array even when dmaresvgetfences() failed. And let's zero out *num_fences as well for good measure.
{ "vanir_signatures": [ { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/dma-buf/dma-resv.c", "function": "dma_resv_get_fences" }, "signature_version": "v1", "digest": { "length": 605.0, "function_hash": "156492106239727701739928683099522473518" }, "id": "CVE-2023-53181-0063df68", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@05abb3be91d8788328231ee02973ab3d47f5e3d2" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/dma-buf/dma-resv.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "217519021540712100480791986335717191264", "128742270580323602259258180975464069321", "336182759583220440578706912712026988329", "71294354548981674930064285507999956274", "216399413338972364509352577791932376329", "215298313851397293358727487454954010666", "319212981479384136679493776051656338707", "100093276184667221098876498987095020491", "253249948697840369899460959870932591547", "150444377400003713431658298210231585878", "834906256950465014843450315035921228", "28951727050832737085344834538150440544", "19216561765939985830384061792567134957", "302294126381700270599360106992760199208" ], "threshold": 0.9 }, "id": "CVE-2023-53181-1132e2f4", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@19e7b9f1f7e1cb92a4cc53b4c064f7fb4b1f1983" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/dma-buf/dma-resv.c", "function": "dma_resv_get_fences" }, "signature_version": "v1", "digest": { "length": 605.0, "function_hash": "156492106239727701739928683099522473518" }, "id": "CVE-2023-53181-373d4d47", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@819656cc03dec7f7f7800274dfbc8eb49f888e9f" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/dma-buf/dma-resv.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "217519021540712100480791986335717191264", "128742270580323602259258180975464069321", "336182759583220440578706912712026988329", "71294354548981674930064285507999956274", "216399413338972364509352577791932376329", "215298313851397293358727487454954010666", "319212981479384136679493776051656338707", "100093276184667221098876498987095020491", "253249948697840369899460959870932591547", "150444377400003713431658298210231585878", "834906256950465014843450315035921228", "28951727050832737085344834538150440544", "19216561765939985830384061792567134957", "302294126381700270599360106992760199208" ], "threshold": 0.9 }, "id": "CVE-2023-53181-6d94596a", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@819656cc03dec7f7f7800274dfbc8eb49f888e9f" }, { "deprecated": false, "signature_type": "Line", "target": { "file": "drivers/dma-buf/dma-resv.c" }, "signature_version": "v1", "digest": { "line_hashes": [ "217519021540712100480791986335717191264", "128742270580323602259258180975464069321", "336182759583220440578706912712026988329", "71294354548981674930064285507999956274", "216399413338972364509352577791932376329", "215298313851397293358727487454954010666", "319212981479384136679493776051656338707", "100093276184667221098876498987095020491", "253249948697840369899460959870932591547", "150444377400003713431658298210231585878", "834906256950465014843450315035921228", "28951727050832737085344834538150440544", "19216561765939985830384061792567134957", "302294126381700270599360106992760199208" ], "threshold": 0.9 }, "id": "CVE-2023-53181-7961aaf4", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@05abb3be91d8788328231ee02973ab3d47f5e3d2" }, { "deprecated": false, "signature_type": "Function", "target": { "file": "drivers/dma-buf/dma-resv.c", "function": "dma_resv_get_fences" }, "signature_version": "v1", "digest": { "length": 605.0, "function_hash": "156492106239727701739928683099522473518" }, "id": "CVE-2023-53181-bd8c7855", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@19e7b9f1f7e1cb92a4cc53b4c064f7fb4b1f1983" } ] }