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 141203B182 for ; Wed, 19 Jun 2024 14:55:43 +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=1718808943; cv=none; b=uNfNHj9alUIkl/asYm92vQiT/kQY0snhM2L+l2MKmiCzTwwXTmYmbtLhnRkFsbxYgghRQwWP/peF3VL1Bgl10uvjKe6Eue4H00RfnnbrN/xXyE9+6IsOkhphumusa66E565YUBgz6oNyuU1zcSSYfjYVdsKsLEro+/lOMCtfmLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718808943; c=relaxed/simple; bh=1dW9MQxtbeL37b1ZhvrXgJGCy+bRNMuD7HBsCfxn/aY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WK+0E5lsfG/oOqyTMRzYBOuRpeKI9R2PdzYNcZO0D14kxqb2FS1cmaBW8RuRGpiy0xzcHYYyO1uUhRbT93gbdajgeUlAxpTFc9mTgaP4cKfOfcn3tQvS6eT9OGqexIsRuAwzpvVJKv1SpWsSejYevrm4rKAhrnCiR6bdR+p193U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kNapj6Hp; 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="kNapj6Hp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80889C2BBFC; Wed, 19 Jun 2024 14:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718808942; bh=1dW9MQxtbeL37b1ZhvrXgJGCy+bRNMuD7HBsCfxn/aY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=kNapj6HpSLdK4+1jghcHoQOwcC7XS1ACO15WA99VnnZTZ5NJi3gMeHZgRdjvLukA2 9hhmV61NHPzWRWeBmVd5teg6mf80JhpNuC3h+FTG05hn+Hn7Omz1vdTCGCX6PNMAVv eZHu/tzHK2CIsAHejoh0sH8if+kUz5du6YSEcSvg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47577: io-wq: check for wq exit after adding new worker task_work Date: Wed, 19 Jun 2024 16:54:16 +0200 Message-ID: <2024061915-CVE-2021-47577-c4c7@gregkh> X-Mailer: git-send-email 2.45.2 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=2063; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=1dW9MQxtbeL37b1ZhvrXgJGCy+bRNMuD7HBsCfxn/aY=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlFH8UbGDmUwi0uJZ1Yzye7SmCBk5Z1YwV3AMfheN1aO xmFqz4dsSwMgkwMsmKKLF+28RzdX3FI0cvQ9jTMHFYmkCEMXJwCMJHrUQzz4y8y9id85NOIm7La vPFg22PTYzeXMCzYKqS/4mam5JZtAY5SXq59v42qUhcBAA== 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-wq: check for wq exit after adding new worker task_work We check IO_WQ_BIT_EXIT before attempting to create a new worker, and wq exit cancels pending work if we have any. But it's possible to have a race between the two, where creation checks exit finding it not set, but we're in the process of exiting. The exit side will cancel pending creation task_work, but there's a gap where we add task_work after we've canceled existing creations at exit time. Fix this by checking the EXIT bit post adding the creation task_work. If it's set, run the same cancelation that exit does. The Linux kernel CVE team has assigned CVE-2021-47577 to this issue. Affected and fixed versions =========================== Fixed in 5.15.11 with commit 4b4e5bbf9386 Fixed in 5.16 with commit 71a85387546e 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-47577 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-wq.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/4b4e5bbf9386d4ec21d91c0cb0fd60b9bba778ec https://git.kernel.org/stable/c/71a85387546e50b1a37b0fa45dadcae3bfb35cf6