CVE-2022-48801

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48801
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48801.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-48801
Downstream
Related
Published
2024-07-16T11:43:54Z
Modified
2025-10-08T06:03:31.343667Z
Summary
iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL
Details

In the Linux kernel, the following vulnerability has been resolved:

iio: buffer: Fix file related error handling in IIOBUFFERGETFDIOCTL

If we fail to copy the just created file descriptor to userland, we try to clean up by putting back 'fd' and freeing 'ib'. The code uses putunusedfd() for the former which is wrong, as the file descriptor was already published by fdinstall() which gets called internally by anoninode_getfd().

This makes the error handling code leaving a half cleaned up file descriptor table around and a partially destructed 'file' object, allowing userland to play use-after-free tricks on us, by abusing the still usable fd and making the code operate on a dangling 'file->private_data' pointer.

Instead of leaving the kernel in a partially corrupted state, don't attempt to explicitly clean up and leave this to the process exit path that'll release any still valid fds, including the one created by the previous call to anoninodegetfd(). Simply return -EFAULT to indicate the error.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f73f7f4da581875f9b1f2fb8ebd1ab15ed634488
Fixed
b7f54894aa7517d2b6c797a499b9f491e9db9083
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f73f7f4da581875f9b1f2fb8ebd1ab15ed634488
Fixed
202071d2518537866d291aa7cf26af54e674f4d4
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f73f7f4da581875f9b1f2fb8ebd1ab15ed634488
Fixed
c72ea20503610a4a7ba26c769357d31602769c01

Affected versions

v5.*

v5.12
v5.12-rc3
v5.12-rc4
v5.12-rc5
v5.12-rc6
v5.12-rc7
v5.12-rc8
v5.13
v5.13-rc1
v5.13-rc2
v5.13-rc3
v5.13-rc4
v5.13-rc5
v5.13-rc6
v5.13-rc7
v5.14
v5.14-rc1
v5.14-rc2
v5.14-rc3
v5.14-rc4
v5.14-rc5
v5.14-rc6
v5.14-rc7
v5.15
v5.15-rc1
v5.15-rc2
v5.15-rc3
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.15.1
v5.15.10
v5.15.11
v5.15.12
v5.15.13
v5.15.14
v5.15.15
v5.15.16
v5.15.17
v5.15.18
v5.15.19
v5.15.2
v5.15.20
v5.15.21
v5.15.22
v5.15.23
v5.15.3
v5.15.4
v5.15.5
v5.15.6
v5.15.7
v5.15.8
v5.15.9
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.16.1
v5.16.2
v5.16.3
v5.16.4
v5.16.5
v5.16.6
v5.16.7
v5.16.8
v5.16.9
v5.17-rc1
v5.17-rc2

Database specific

{
    "vanir_signatures": [
        {
            "signature_version": "v1",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "301122312972433265234772120402470779541",
                    "64335343018732127695719652569978248204",
                    "264398821793910729362348294405771485325",
                    "39758495730352335464886463145767007609",
                    "87231476189576324233007713818222408840",
                    "100380576301240915543582502726427414881"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@202071d2518537866d291aa7cf26af54e674f4d4",
            "deprecated": false,
            "target": {
                "file": "drivers/iio/industrialio-buffer.c"
            },
            "signature_type": "Line",
            "id": "CVE-2022-48801-627fe3bd"
        },
        {
            "signature_version": "v1",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "301122312972433265234772120402470779541",
                    "64335343018732127695719652569978248204",
                    "264398821793910729362348294405771485325",
                    "39758495730352335464886463145767007609",
                    "87231476189576324233007713818222408840",
                    "100380576301240915543582502726427414881"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b7f54894aa7517d2b6c797a499b9f491e9db9083",
            "deprecated": false,
            "target": {
                "file": "drivers/iio/industrialio-buffer.c"
            },
            "signature_type": "Line",
            "id": "CVE-2022-48801-9a75e73a"
        },
        {
            "signature_version": "v1",
            "digest": {
                "threshold": 0.9,
                "line_hashes": [
                    "301122312972433265234772120402470779541",
                    "64335343018732127695719652569978248204",
                    "264398821793910729362348294405771485325",
                    "39758495730352335464886463145767007609",
                    "87231476189576324233007713818222408840",
                    "100380576301240915543582502726427414881"
                ]
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c72ea20503610a4a7ba26c769357d31602769c01",
            "deprecated": false,
            "target": {
                "file": "drivers/iio/industrialio-buffer.c"
            },
            "signature_type": "Line",
            "id": "CVE-2022-48801-a617bbf0"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 1054.0,
                "function_hash": "228524007776727460721823370064340453690"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@202071d2518537866d291aa7cf26af54e674f4d4",
            "deprecated": false,
            "target": {
                "file": "drivers/iio/industrialio-buffer.c",
                "function": "iio_device_buffer_getfd"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48801-abffd186"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 1054.0,
                "function_hash": "228524007776727460721823370064340453690"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b7f54894aa7517d2b6c797a499b9f491e9db9083",
            "deprecated": false,
            "target": {
                "file": "drivers/iio/industrialio-buffer.c",
                "function": "iio_device_buffer_getfd"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48801-e2a8b42e"
        },
        {
            "signature_version": "v1",
            "digest": {
                "length": 1054.0,
                "function_hash": "228524007776727460721823370064340453690"
            },
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c72ea20503610a4a7ba26c769357d31602769c01",
            "deprecated": false,
            "target": {
                "file": "drivers/iio/industrialio-buffer.c",
                "function": "iio_device_buffer_getfd"
            },
            "signature_type": "Function",
            "id": "CVE-2022-48801-efd9254b"
        }
    ]
}

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.13.0
Fixed
5.15.24
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.10