In the Linux kernel, the following vulnerability has been resolved:
misc: fastrpc: avoid double fput() on failed usercopy
If the copy back to userland fails for the FASTRPCIOCTLALLOCDMABUFF ioctl(), we shouldn't assume that 'buf->dmabuf' is still valid. In fact, dmabuffd() called fd_install() before, i.e. "consumed" one reference, leaving us with none.
Calling dmabufput() will therefore put a reference we no longer own, leading to a valid file descritor table entry for an already released 'file' object which is a straight use-after-free.
Simply avoid calling dmabufput() and rely on the process exit code to do the necessary cleanup, if needed, i.e. if the file descriptor is still valid.
[
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"118529568268496662204075427919550477053",
"277975563693845351362700394932496362281",
"133747492291865891590471646689613585070",
"221942164988366753297935990746258932621"
]
},
"target": {
"file": "drivers/misc/fastrpc.c"
},
"signature_version": "v1",
"id": "CVE-2022-48821-052d5690",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a5ce7ee5fcc07583159f54ab4af5164de00148f5"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"118529568268496662204075427919550477053",
"277975563693845351362700394932496362281",
"133747492291865891590471646689613585070",
"221942164988366753297935990746258932621"
]
},
"target": {
"file": "drivers/misc/fastrpc.c"
},
"signature_version": "v1",
"id": "CVE-2022-48821-156008cf",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@76f85c307ef9f10aa2cef1b1d5ee654c1f3345fc"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "102352420481384876481416284214821709871",
"length": 799.0
},
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_dmabuf_alloc"
},
"signature_version": "v1",
"id": "CVE-2022-48821-2bd7d27d",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a5ce7ee5fcc07583159f54ab4af5164de00148f5"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "102352420481384876481416284214821709871",
"length": 799.0
},
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_dmabuf_alloc"
},
"signature_version": "v1",
"id": "CVE-2022-48821-30bee12c",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@76f85c307ef9f10aa2cef1b1d5ee654c1f3345fc"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "102352420481384876481416284214821709871",
"length": 799.0
},
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_dmabuf_alloc"
},
"signature_version": "v1",
"id": "CVE-2022-48821-351fcf9a",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e4382d0a39f9a1e260d62fdc079ddae5293c037d"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"118529568268496662204075427919550477053",
"277975563693845351362700394932496362281",
"133747492291865891590471646689613585070",
"221942164988366753297935990746258932621"
]
},
"target": {
"file": "drivers/misc/fastrpc.c"
},
"signature_version": "v1",
"id": "CVE-2022-48821-50416d7d",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e4382d0a39f9a1e260d62fdc079ddae5293c037d"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"118529568268496662204075427919550477053",
"277975563693845351362700394932496362281",
"133747492291865891590471646689613585070",
"221942164988366753297935990746258932621"
]
},
"target": {
"file": "drivers/misc/fastrpc.c"
},
"signature_version": "v1",
"id": "CVE-2022-48821-6661c798",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@46963e2e0629cb31c96b1d47ddd89dc3d8990b34"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "102352420481384876481416284214821709871",
"length": 799.0
},
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_dmabuf_alloc"
},
"signature_version": "v1",
"id": "CVE-2022-48821-891816e8",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@46963e2e0629cb31c96b1d47ddd89dc3d8990b34"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"118529568268496662204075427919550477053",
"277975563693845351362700394932496362281",
"133747492291865891590471646689613585070",
"221942164988366753297935990746258932621"
]
},
"target": {
"file": "drivers/misc/fastrpc.c"
},
"signature_version": "v1",
"id": "CVE-2022-48821-a04dad43",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4e6fd2b5fcf8e7119305a6042bd92e7f2b9ed215"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "102352420481384876481416284214821709871",
"length": 799.0
},
"target": {
"file": "drivers/misc/fastrpc.c",
"function": "fastrpc_dmabuf_alloc"
},
"signature_version": "v1",
"id": "CVE-2022-48821-ad319756",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4e6fd2b5fcf8e7119305a6042bd92e7f2b9ed215"
}
]