In the Linux kernel, the following vulnerability has been resolved:
misc: fastrpc: Fix use-after-free race condition for maps
It is possible that in between calling fastrpcmapget() until map->fl->lock is taken in fastrpcfreemap(), another thread can call fastrpcmaplookup() and get a reference to a map that is about to be deleted.
Rewrite fastrpcmapget() to only increase the reference count of a map if it's non-zero. Propagate this to callers so they can know if a map is about to be deleted.
Fixes this warning: refcountt: addition on 0; use-after-free. WARNING: CPU: 5 PID: 10100 at lib/refcount.c:25 refcountwarnsaturate ... Call trace: refcountwarnsaturate [fastrpcmapget inlined] [fastrpcmaplookup inlined] fastrpcmapcreate fastrpcinternalinvoke fastrpcdeviceioctl _arm64sysioctl invoke_syscall
[
{
"signature_version": "v1",
"digest": {
"length": 91.0,
"function_hash": "245421493454284050264583754092885606831"
},
"signature_type": "Function",
"id": "CVE-2022-48872-0bf754fc",
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_map_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@556dfdb226ce1e5231d8836159b23f8bb0395bf4",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 91.0,
"function_hash": "245421493454284050264583754092885606831"
},
"signature_type": "Function",
"id": "CVE-2022-48872-1a0679b9",
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_map_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@61a0890cb95afec5c8a2f4a879de2b6220984ef1",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"26631712104425587117936640061801269608",
"255261818338216448767479529387041697636",
"330262804528915546271275589238222307223",
"182201231387761933748816421967270044811",
"179722066082401702573768705707600519514",
"9778627962716292038863884095422195081",
"38249521469296646452428431518260721076"
]
},
"signature_type": "Line",
"id": "CVE-2022-48872-428b7550",
"target": {
"file": "drivers/misc/fastrpc.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@61a0890cb95afec5c8a2f4a879de2b6220984ef1",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"26631712104425587117936640061801269608",
"255261818338216448767479529387041697636",
"330262804528915546271275589238222307223",
"182201231387761933748816421967270044811",
"179722066082401702573768705707600519514",
"30111731605652313993943748736012539615",
"120576493713803407098717095542368805152"
]
},
"signature_type": "Line",
"id": "CVE-2022-48872-4ba5690e",
"target": {
"file": "drivers/misc/fastrpc.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@96b328d119eca7563c1edcc4e1039a62e6370ecb",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"26631712104425587117936640061801269608",
"255261818338216448767479529387041697636",
"330262804528915546271275589238222307223",
"182201231387761933748816421967270044811",
"179722066082401702573768705707600519514",
"9778627962716292038863884095422195081",
"38249521469296646452428431518260721076"
]
},
"signature_type": "Line",
"id": "CVE-2022-48872-51a04be5",
"target": {
"file": "drivers/misc/fastrpc.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b171d0d2cf1b8387c72c8d325c5d5746fa271e39",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"26631712104425587117936640061801269608",
"255261818338216448767479529387041697636",
"330262804528915546271275589238222307223",
"182201231387761933748816421967270044811",
"179722066082401702573768705707600519514",
"30111731605652313993943748736012539615",
"120576493713803407098717095542368805152"
]
},
"signature_type": "Line",
"id": "CVE-2022-48872-8f6d4f81",
"target": {
"file": "drivers/misc/fastrpc.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@079c78c68714f7d8d58e66c477b0243b31806907",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 91.0,
"function_hash": "245421493454284050264583754092885606831"
},
"signature_type": "Function",
"id": "CVE-2022-48872-9a507289",
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_map_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@079c78c68714f7d8d58e66c477b0243b31806907",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 91.0,
"function_hash": "245421493454284050264583754092885606831"
},
"signature_type": "Function",
"id": "CVE-2022-48872-a9739649",
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_map_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b171d0d2cf1b8387c72c8d325c5d5746fa271e39",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 91.0,
"function_hash": "245421493454284050264583754092885606831"
},
"signature_type": "Function",
"id": "CVE-2022-48872-d3a84fd8",
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_map_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@96b328d119eca7563c1edcc4e1039a62e6370ecb",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"26631712104425587117936640061801269608",
"255261818338216448767479529387041697636",
"330262804528915546271275589238222307223",
"182201231387761933748816421967270044811",
"179722066082401702573768705707600519514",
"9778627962716292038863884095422195081",
"38249521469296646452428431518260721076"
]
},
"signature_type": "Line",
"id": "CVE-2022-48872-dbe3bf96",
"target": {
"file": "drivers/misc/fastrpc.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@556dfdb226ce1e5231d8836159b23f8bb0395bf4",
"deprecated": false
}
]