Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C25E340D90 for ; Mon, 15 Sep 2025 14:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757947741; cv=none; b=C1DYND0AMFyuinDTASmbsjweIR354m41pAnUFgCpKESvTIZkRljun/ZO1aKlzntj/l1R7qIwsLqnl5fEbek/XgA8aN12XGS/LYu0TkSoSfb39tGDr2AXWsKx5i6w76VO/BF6nbnogA+yFvSDXusDdAjl6r9w5awq8nVnvP0YoNs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757947741; c=relaxed/simple; bh=A1bJUKS3yh/lc52mM04yQoQZcymkNGZTV8Z4XIA84xA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jvNUXSI+ZV/hoh/k5xpMxf2Geh5KgIpBNBHiFyOH8SzqgxiyplvM88P5OTzB/TMYcp6ztWJNaRAOTRiicM67AscTGHxy/uJQU5n23C+SgINSz6S6BKqc7du/6vNLWy2v68uc931zDtpGNJ4A+AI5wFhWv7i2yaLUvvvajtt6Z6U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=M470upQg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="M470upQg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5B25C4CEF1; Mon, 15 Sep 2025 14:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757947741; bh=A1bJUKS3yh/lc52mM04yQoQZcymkNGZTV8Z4XIA84xA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=M470upQgWxS5Aw2bdbpPWF6PiiQxgoVW0j9RW7mT2rdt9N9r5EvQGUyYxP0QO6HpL 94XZgEOGS/68/FVh6W6/OM3LOvH7HlojBLZ5LW7Yf1aZbsqdoBGAuonrj9s9oDwAIb mbrD2RC2cQ7lyau2gzfyK8RQr4GCu/wIn0jzTt3k= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50295: io_uring/msg_ring: Fix NULL pointer dereference in io_msg_send_fd() Date: Mon, 15 Sep 2025 16:45:57 +0200 Message-ID: <2025091557-CVE-2022-50295-8141@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3129; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0dgmSrXXAh62LF9Eud0ZE6+8ojEYm1ldxnsqGXPM3Ak=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkn1JbuXP/g774/Ms9/Zab8vzGByV38rdqNN/mmSzbI3 Ji39/tE7Y5YFgZBJgZZMUWWL9t4ju6vOKToZWh7GmYOKxPIEAYuTgGYiOw5hgXrIkyEt02+w/9O yvhs+a64lk2vSx0Y5mf9Xfd8ZdeFY3dz90kfszD1FZ+03w4A X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: io_uring/msg_ring: Fix NULL pointer dereference in io_msg_send_fd() Syzkaller produced the below call trace: BUG: KASAN: null-ptr-deref in io_msg_ring+0x3cb/0x9f0 Write of size 8 at addr 0000000000000070 by task repro/16399 CPU: 0 PID: 16399 Comm: repro Not tainted 6.1.0-rc1 #28 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 Call Trace: dump_stack_lvl+0xcd/0x134 ? io_msg_ring+0x3cb/0x9f0 kasan_report+0xbc/0xf0 ? io_msg_ring+0x3cb/0x9f0 kasan_check_range+0x140/0x190 io_msg_ring+0x3cb/0x9f0 ? io_msg_ring_prep+0x300/0x300 io_issue_sqe+0x698/0xca0 io_submit_sqes+0x92f/0x1c30 __do_sys_io_uring_enter+0xae4/0x24b0 .... RIP: 0033:0x7f2eaf8f8289 RSP: 002b:00007fff40939718 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2eaf8f8289 RDX: 0000000000000000 RSI: 0000000000006f71 RDI: 0000000000000004 RBP: 00007fff409397a0 R08: 0000000000000000 R09: 0000000000000039 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004006d0 R13: 00007fff40939880 R14: 0000000000000000 R15: 0000000000000000 Kernel panic - not syncing: panic_on_warn set ... We don't have a NULL check on file_ptr in io_msg_send_fd() function, so when file_ptr is NUL src_file is also NULL and get_file() dereferences a NULL pointer and leads to above crash. Add a NULL check to fix this issue. The Linux kernel CVE team has assigned CVE-2022-50295 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit e6130eba8a848a7a6ba6c534bd8f6d60749ae1a9 and fixed in 6.0.6 with commit 0163e04ea64cc3dfaa12390286e5f2f481c3b2e3 Issue introduced in 6.0 with commit e6130eba8a848a7a6ba6c534bd8f6d60749ae1a9 and fixed in 6.1 with commit 16bbdfe5fb0e78e0acb13e45fc127e9a296913f2 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-50295 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: io_uring/msg_ring.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/0163e04ea64cc3dfaa12390286e5f2f481c3b2e3 https://git.kernel.org/stable/c/16bbdfe5fb0e78e0acb13e45fc127e9a296913f2