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 12F496D1D2 for ; Tue, 21 May 2024 14:38:03 +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=1716302284; cv=none; b=Y+GQpL9lCbY8DjADLF9RMQfK8xzuh/Wj/WhdGmoSML9Q7Ww4gduIdfpM3ZCIqYy0yDSUmvaO0K2x12fvvF/FXw0m+kdYz2P3Ydl2NBDAoOahO9OgcZSaRdaIXy0lanz+YdcP19owZ0DV9Nbfmd/+gUOln9h2eJap0/6cQon2rw0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716302284; c=relaxed/simple; bh=EnHp3wtL5NrlkDnwAoWep9LzN9bt71DcBUvjgmFZods=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LG6bntfs6hGeqDjl/FPraeWzWZjXgDJT+EgeVTzeIv3mLGQ3vvtNAd7JF1CPuUw2zGh2aKALVVQbKkChbLfY9W3Kf6/wD8mHZep8ElEmSJnaZ03wtIWMQP4qPz0n9w/yDa4NZ1ie3ffuy8OKRmiuV6naUEysqvgbq6XKLdy3cuw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aTEORCJk; 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="aTEORCJk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C95BC2BD11; Tue, 21 May 2024 14:38:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716302283; bh=EnHp3wtL5NrlkDnwAoWep9LzN9bt71DcBUvjgmFZods=; h=From:To:Cc:Subject:Date:Reply-to:From; b=aTEORCJkADh6hq3GhHGLkA5L1o3ltdLqURdT/XGIlhWPgzKUt2cAK+kwH4sq/PsvO GFMiSofouY6kS7P8Wje/1anxfn21TNnR3xk1qnaTtNaiWMcm0EEYGLmeQ9JguFe1qk wbSWMPueJR1zpPG3tqFbNwWnnle4CWITl9sFf3io= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47292: io_uring: fix memleak in io_init_wq_offload() Date: Tue, 21 May 2024 16:35:26 +0200 Message-ID: <2024052123-CVE-2021-47292-4c13@gregkh> X-Mailer: git-send-email 2.45.1 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=3396; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=EnHp3wtL5NrlkDnwAoWep9LzN9bt71DcBUvjgmFZods=; b=owGbwMvMwCRo6H6F97bub03G02pJDGk+G7UN1rVJTElT077z5ZC24PwZKirerz9cmRhz8n+5u 7t5zGX2jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIdDXDgqvOUoznbYO27n2Q Y3KPtb0syHSqJ8MsZuPZv/3Zze4nHD+x24ghbZlpTJAmAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: io_uring: fix memleak in io_init_wq_offload() I got memory leak report when doing fuzz test: BUG: memory leak unreferenced object 0xffff888107310a80 (size 96): comm "syz-executor.6", pid 4610, jiffies 4295140240 (age 20.135s) hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N.......... backtrace: [<000000001974933b>] kmalloc include/linux/slab.h:591 [inline] [<000000001974933b>] kzalloc include/linux/slab.h:721 [inline] [<000000001974933b>] io_init_wq_offload fs/io_uring.c:7920 [inline] [<000000001974933b>] io_uring_alloc_task_context+0x466/0x640 fs/io_uring.c:7955 [<0000000039d0800d>] __io_uring_add_tctx_node+0x256/0x360 fs/io_uring.c:9016 [<000000008482e78c>] io_uring_add_tctx_node fs/io_uring.c:9052 [inline] [<000000008482e78c>] __do_sys_io_uring_enter fs/io_uring.c:9354 [inline] [<000000008482e78c>] __se_sys_io_uring_enter fs/io_uring.c:9301 [inline] [<000000008482e78c>] __x64_sys_io_uring_enter+0xabc/0xc20 fs/io_uring.c:9301 [<00000000b875f18f>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<00000000b875f18f>] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 [<000000006b0a8484>] entry_SYSCALL_64_after_hwframe+0x44/0xae CPU0 CPU1 io_uring_enter io_uring_enter io_uring_add_tctx_node io_uring_add_tctx_node __io_uring_add_tctx_node __io_uring_add_tctx_node io_uring_alloc_task_context io_uring_alloc_task_context io_init_wq_offload io_init_wq_offload hash = kzalloc hash = kzalloc ctx->hash_map = hash ctx->hash_map = hash <- one of the hash is leaked When calling io_uring_enter() in parallel, the 'hash_map' will be leaked, add uring_lock to protect 'hash_map'. The Linux kernel CVE team has assigned CVE-2021-47292 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit e941894eae31 and fixed in 5.13.6 with commit 502731a03f27 Issue introduced in 5.12 with commit e941894eae31 and fixed in 5.14 with commit 362a9e652892 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-2021-47292 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: fs/io_uring.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/502731a03f27cba1513fbbff77e508185ffce5bb https://git.kernel.org/stable/c/362a9e65289284f36403058eea2462d0330c1f24