CVE-2022-48983 Information
Description
In the Linux kernel the following vulnerability has been resolved:
io_uring: Fix a null-ptr-deref in io_tctx_exit_cb()
Syzkaller reports a NULL deref bug as follows:
BUG: KASAN: null-ptr-deref in io_tctx_exit_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:
This happens because the adding of task_work from io_ring_exit_work() 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 io_tctx_exit_cb() 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 io_uring_cancel_generic() 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]
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Reference
https://git.kernel.org/stable/c/f895511de9d27fff71dad2c234ad53b4afd2b06c https://git.kernel.org/stable/c/d91edca1943453aaaba4f380f6f364346222e5cf https://git.kernel.org/stable/c/998b30c3948e4d0b1097e639918c5cff332acac5
Attack Complexity
LOW
Privileges Required
LOW
User Interaction Required
LOW
Scope
NONE
Confidentiality Impact
UNCHANGED
Integrity Impact
NONE
Availability Impact
NONE
Base Score
HIGH
Base Severity
5.5
Share on: