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 34F2414D2A2 for ; Wed, 19 Jun 2024 13:39:00 +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=1718804341; cv=none; b=IV14pam2sdZ1J3Ai9ZH8KL25aqDmbbqsEr/bpfysHluelNHh8toBW2DAk5KMBLrORhxwoiFebyCCPYnBIoCJMy/cg04bj4tDY8QgrndWXceXJJhXwXoWFrMK1n6W1hRKro9kdlVWhOdEWfZl7BZD7y3Wc+hVvCRwzJkJ0nNoBiE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718804341; c=relaxed/simple; bh=2+eld0CHc5gwatQz1RE/F9ZYrR2VmIwnHTFQnVzY31k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=eiJw7+slYfV3Fbdm5ERYa+YS9Ni+h6BNmeJv4wfoOWgQJKq36pSeG6YrcODwcNXoFnHNFbgRaVb797qZZUP9SKs7mwU40pEnwBfVaBWyC2EGX4htb9gZ/+gVueoLNxTjPtiSTqsZ8Bpbc/B/TEMiRTi6vj75hA1yHIUd2Ji9GvE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1XRFNv0N; 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="1XRFNv0N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69B26C2BBFC; Wed, 19 Jun 2024 13:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718804340; bh=2+eld0CHc5gwatQz1RE/F9ZYrR2VmIwnHTFQnVzY31k=; h=From:To:Cc:Subject:Date:Reply-to:From; b=1XRFNv0NHSxHc7aByBQ3/wC8X1IT7i0UcjkpSwFC3Dv8WZK8C9AKDQHjwjK+Syl+v ku36MpfALPeG5nCMSVU3s+F0J47zM6FI5BEvsKXCXGiOJtu3QcevbNpaTUuO6x/Dls 8ZrcdfK7hxxjo7BKAoGoimUsGQaQPm5zWEXvpxI8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-38582: nilfs2: fix potential hang in nilfs_detach_log_writer() Date: Wed, 19 Jun 2024 15:37:54 +0200 Message-ID: <2024061948-CVE-2024-38582-6165@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=3568; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2+eld0CHc5gwatQz1RE/F9ZYrR2VmIwnHTFQnVzY31k=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlF93X+zFDYWB6Wotb8LGxBQtXnhwcOuodZ1Fnvbplfe W3HE1mmjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIFzGGBZMfvfpVutUqdFtw NX/Q9lv2H/frXGaYpzJ9tdid9r89Nlfsjr+v/Py/ds0meQA= 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: nilfs2: fix potential hang in nilfs_detach_log_writer() Syzbot has reported a potential hang in nilfs_detach_log_writer() called during nilfs2 unmount. Analysis revealed that this is because nilfs_segctor_sync(), which synchronizes with the log writer thread, can be called after nilfs_segctor_destroy() terminates that thread, as shown in the call trace below: nilfs_detach_log_writer nilfs_segctor_destroy nilfs_segctor_kill_thread --> Shut down log writer thread flush_work nilfs_iput_work_func nilfs_dispose_list iput nilfs_evict_inode nilfs_transaction_commit nilfs_construct_segment (if inode needs sync) nilfs_segctor_sync --> Attempt to synchronize with log writer thread *** DEADLOCK *** Fix this issue by changing nilfs_segctor_sync() so that the log writer thread returns normally without synchronizing after it terminates, and by forcing tasks that are already waiting to complete once after the thread terminates. The skipped inode metadata flushout will then be processed together in the subsequent cleanup work in nilfs_segctor_destroy(). The Linux kernel CVE team has assigned CVE-2024-38582 to this issue. Affected and fixed versions =========================== Fixed in 4.19.316 with commit 911d38be1519 Fixed in 5.4.278 with commit bc9cee50a4a4 Fixed in 5.10.219 with commit eff7cdf890b0 Fixed in 5.15.161 with commit 06afce714d87 Fixed in 6.1.93 with commit 1c3844c5f4ea Fixed in 6.6.33 with commit a8799662fed1 Fixed in 6.8.12 with commit 6e5c8e8e024e Fixed in 6.9.3 with commit c516db6ab9ea Fixed in 6.10-rc1 with commit eb85dace897c 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-2024-38582 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/nilfs2/segment.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/911d38be151921a5d152bb55e81fd752384c6830 https://git.kernel.org/stable/c/bc9cee50a4a4ca23bdc49f75ea8242d8a2193b3b https://git.kernel.org/stable/c/eff7cdf890b02596b8d73e910bdbdd489175dbdb https://git.kernel.org/stable/c/06afce714d87c7cd1dcfccbcd800c5c5d2cf1cfd https://git.kernel.org/stable/c/1c3844c5f4eac043954ebf6403fa9fd1f0e9c1c0 https://git.kernel.org/stable/c/a8799662fed1f8747edae87a1937549288baca6a https://git.kernel.org/stable/c/6e5c8e8e024e147b834f56f2115aad241433679b https://git.kernel.org/stable/c/c516db6ab9eabbedbc430b4f93b0d8728e9b427f https://git.kernel.org/stable/c/eb85dace897c5986bc2f36b3c783c6abb8a4292e