CVE-2022-48983

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-48983
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48983.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-48983
Downstream
Related
Published
2024-10-21T20:06:00Z
Modified
2025-10-21T08:04:52.822064Z
Summary
io_uring: Fix a null-ptr-deref in io_tctx_exit_cb()
Details

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

iouring: Fix a null-ptr-deref in iotctxexitcb()

Syzkaller reports a NULL deref bug as follows:

BUG: KASAN: null-ptr-deref in iotctxexit_cb+0x53/0xd3 Read of size 4 at addr 0000000000000138 by task file1/1955

CPU: 1 PID: 1955 Comm: file1 Not tainted 6.1.0-rc7-00103-gef4d3ea40565 #75 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 Call Trace: <TASK> dumpstacklvl+0xcd/0x134 ? iotctxexitcb+0x53/0xd3 kasanreport+0xbb/0x1f0 ? iotctxexitcb+0x53/0xd3 kasancheckrange+0x140/0x190 iotctxexitcb+0x53/0xd3 taskworkrun+0x164/0x250 ? taskworkcancel+0x30/0x30 getsignal+0x1c3/0x2440 ? lockdowngrade+0x6e0/0x6e0 ? lockdowngrade+0x6e0/0x6e0 ? exitsignals+0x8b0/0x8b0 ? dorawreadunlock+0x3b/0x70 ? dorawspinunlock+0x50/0x230 archdosignalorrestart+0x82/0x2470 ? kmemcachefree+0x260/0x4b0 ? putname+0xfe/0x140 ? getsigframesize+0x10/0x10 ? doexecveatcommon.isra.0+0x226/0x710 ? lockdephardirqson+0x79/0x100 ? putname+0xfe/0x140 ? doexecveatcommon.isra.0+0x238/0x710 exittousermodeprepare+0x15f/0x250 syscallexittousermode+0x19/0x50 dosyscall64+0x42/0xb0 entrySYSCALL64afterhwframe+0x63/0xcd RIP: 0023:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 002b:00000000fffb7790 EFLAGS: 00000200 ORIGRAX: 000000000000000b RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 </TASK> Kernel panic - not syncing: panicon_warn set ...

This happens because the adding of taskwork from ioringexitwork() isn't synchronized with canceling all work items from eg exec. The execution of the two are ordered in that they are both run by the task itself, but if iotctxexitcb() is queued while we're canceling all work items off exec AND gets executed when the task exits to userspace rather than in the main loop in iouringcancelgeneric(), then we can find current->io_uring == NULL and hit the above crash.

It's safe to add this NULL check here, because the execution of the two paths are done by the task itself.

[axboe: add code comment and also put an explanation in the commit msg]

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
d56d938b4bef3e1421a42023cdcd6e13c1f50831
Fixed
f895511de9d27fff71dad2c234ad53b4afd2b06c
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d56d938b4bef3e1421a42023cdcd6e13c1f50831
Fixed
d91edca1943453aaaba4f380f6f364346222e5cf
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d56d938b4bef3e1421a42023cdcd6e13c1f50831
Fixed
998b30c3948e4d0b1097e639918c5cff332acac5

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.24
v5.15.25
v5.15.26
v5.15.27
v5.15.28
v5.15.29
v5.15.3
v5.15.30
v5.15.31
v5.15.32
v5.15.33
v5.15.34
v5.15.35
v5.15.36
v5.15.37
v5.15.38
v5.15.39
v5.15.4
v5.15.40
v5.15.41
v5.15.42
v5.15.43
v5.15.44
v5.15.45
v5.15.46
v5.15.47
v5.15.48
v5.15.49
v5.15.5
v5.15.50
v5.15.51
v5.15.52
v5.15.53
v5.15.54
v5.15.55
v5.15.56
v5.15.57
v5.15.58
v5.15.59
v5.15.6
v5.15.60
v5.15.61
v5.15.62
v5.15.63
v5.15.64
v5.15.65
v5.15.66
v5.15.67
v5.15.68
v5.15.69
v5.15.7
v5.15.70
v5.15.71
v5.15.72
v5.15.73
v5.15.74
v5.15.75
v5.15.76
v5.15.77
v5.15.78
v5.15.79
v5.15.8
v5.15.80
v5.15.81
v5.15.82
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.17
v5.17-rc1
v5.17-rc2
v5.17-rc3
v5.17-rc4
v5.17-rc5
v5.17-rc6
v5.17-rc7
v5.17-rc8
v5.18
v5.18-rc1
v5.18-rc2
v5.18-rc3
v5.18-rc4
v5.18-rc5
v5.18-rc6
v5.18-rc7
v5.19
v5.19-rc1
v5.19-rc2
v5.19-rc3
v5.19-rc4
v5.19-rc5
v5.19-rc6
v5.19-rc7
v5.19-rc8

v6.*

v6.0
v6.0-rc1
v6.0-rc2
v6.0-rc3
v6.0-rc4
v6.0-rc5
v6.0-rc6
v6.0-rc7
v6.0.1
v6.0.10
v6.0.11
v6.0.12
v6.0.2
v6.0.3
v6.0.4
v6.0.5
v6.0.6
v6.0.7
v6.0.8
v6.0.9
v6.1-rc1

Database specific

vanir_signatures

[
    {
        "id": "CVE-2022-48983-3b861de4",
        "signature_type": "Function",
        "digest": {
            "length": 263.0,
            "function_hash": "176974500423648126644583959781299050645"
        },
        "signature_version": "v1",
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d91edca1943453aaaba4f380f6f364346222e5cf",
        "target": {
            "function": "io_tctx_exit_cb",
            "file": "io_uring/io_uring.c"
        }
    },
    {
        "id": "CVE-2022-48983-50caa2e8",
        "signature_type": "Line",
        "digest": {
            "line_hashes": [
                "242774128364383249604009974015777971409",
                "190856780515309647128128611607754830829",
                "104538179676119217591051952472180331598",
                "114508713123324123567158854219761330639"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@998b30c3948e4d0b1097e639918c5cff332acac5",
        "target": {
            "file": "io_uring/io_uring.c"
        }
    },
    {
        "id": "CVE-2022-48983-b559bff7",
        "signature_type": "Line",
        "digest": {
            "line_hashes": [
                "242774128364383249604009974015777971409",
                "190856780515309647128128611607754830829",
                "104538179676119217591051952472180331598",
                "114508713123324123567158854219761330639"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f895511de9d27fff71dad2c234ad53b4afd2b06c",
        "target": {
            "file": "io_uring/io_uring.c"
        }
    },
    {
        "id": "CVE-2022-48983-bc459cfb",
        "signature_type": "Line",
        "digest": {
            "line_hashes": [
                "242774128364383249604009974015777971409",
                "190856780515309647128128611607754830829",
                "104538179676119217591051952472180331598",
                "114508713123324123567158854219761330639"
            ],
            "threshold": 0.9
        },
        "signature_version": "v1",
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d91edca1943453aaaba4f380f6f364346222e5cf",
        "target": {
            "file": "io_uring/io_uring.c"
        }
    },
    {
        "id": "CVE-2022-48983-cd741c37",
        "signature_type": "Function",
        "digest": {
            "length": 263.0,
            "function_hash": "176974500423648126644583959781299050645"
        },
        "signature_version": "v1",
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f895511de9d27fff71dad2c234ad53b4afd2b06c",
        "target": {
            "function": "io_tctx_exit_cb",
            "file": "io_uring/io_uring.c"
        }
    },
    {
        "id": "CVE-2022-48983-cf546b56",
        "signature_type": "Function",
        "digest": {
            "length": 263.0,
            "function_hash": "176974500423648126644583959781299050645"
        },
        "signature_version": "v1",
        "deprecated": false,
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@998b30c3948e4d0b1097e639918c5cff332acac5",
        "target": {
            "function": "io_tctx_exit_cb",
            "file": "io_uring/io_uring.c"
        }
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.12.0
Fixed
5.15.83
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.0.13