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 E81DF2139CD for ; Wed, 19 Jun 2024 13:46:18 +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=1718804779; cv=none; b=HjP0AwS44bL0X8w5FoWtp/Zx0/FCuDKZmAsn/Pkvj0QHznMCuzOdZSU7XCuekKi7Akz6/TWgqk891dJ4q8yR8+TwOEmaRvcr+uFUPUOy2isaV3a2oi3qasYHRqMe08rmIFRrZstpuLlVq8H2expoSzUW4K3MVuxW4dSn6UvIu2w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718804779; c=relaxed/simple; bh=jAbvqX0jnpkqHiIx8nMWq8U3ReCGiRFi6CrYYCT6C/s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IRa4JTHBduCWXmac6XIh2k7+MZM82mbcuyX6objYQ8gavQnl2QjziQoVZeb0MP6mBPbYJ8y93CoU3mWOO7+ffpRTxI3dI6vcIUR58nT4qjEam0rtv0ev/U40QZpG4/N5bSc2rdffHghiBjPD1BJeapLv+Z/sniHWKWc/52Ks2xE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K0dZalqY; 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="K0dZalqY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57D96C2BBFC; Wed, 19 Jun 2024 13:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718804778; bh=jAbvqX0jnpkqHiIx8nMWq8U3ReCGiRFi6CrYYCT6C/s=; h=From:To:Cc:Subject:Date:Reply-to:From; b=K0dZalqYN8ZOsH2N0SbHExdT1/4gS90of87sJXfkLurqydsFIromZZITtr1DF5MiK xKMH0LkgJA9L89OWPZRVfKu5KIATGl1OUyrl2RQ96C4ApkYa/O3bCulfGH8+XzyQXO twz6ziGDAljoFO/MqOIBelqJ1iJW68aQVTtKB4x4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-38600: ALSA: Fix deadlocks with kctl removals at disconnection Date: Wed, 19 Jun 2024 15:46:06 +0200 Message-ID: <2024061957-CVE-2024-38600-aa7e@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=3102; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=jAbvqX0jnpkqHiIx8nMWq8U3ReCGiRFi6CrYYCT6C/s=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlFD0VrnwnUKS9cdI+XM0Vqg3WEYsKBpYeNzkf+jzp3T PqJ2cmLHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCROd8YFpyse3Jvil3WmYjb 66f/7bEJTrvKf5Nhvpt7ifmcSX0xVWErdY6k/PVgNOT+AAA= 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: ALSA: Fix deadlocks with kctl removals at disconnection In snd_card_disconnect(), we set card->shutdown flag at the beginning, call callbacks and do sync for card->power_ref_sleep waiters at the end. The callback may delete a kctl element, and this can lead to a deadlock when the device was in the suspended state. Namely: * A process waits for the power up at snd_power_ref_and_wait() in snd_ctl_info() or read/write() inside card->controls_rwsem. * The system gets disconnected meanwhile, and the driver tries to delete a kctl via snd_ctl_remove*(); it tries to take card->controls_rwsem again, but this is already locked by the above. Since the sleeper isn't woken up, this deadlocks. An easy fix is to wake up sleepers before processing the driver disconnect callbacks but right after setting the card->shutdown flag. Then all sleepers will abort immediately, and the code flows again. So, basically this patch moves the wait_event() call at the right timing. While we're at it, just to be sure, call wait_event_all() instead of wait_event(), although we don't use exclusive events on this queue for now. The Linux kernel CVE team has assigned CVE-2024-38600 to this issue. Affected and fixed versions =========================== Fixed in 5.15.161 with commit ff80185e7b7b Fixed in 6.1.93 with commit c2fb439f4f14 Fixed in 6.6.33 with commit 2f103287ef79 Fixed in 6.8.12 with commit 88ce3fe255d5 Fixed in 6.9.3 with commit 6b55e879e7bd Fixed in 6.10-rc1 with commit 87988a534d8e 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-38600 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: sound/core/init.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/ff80185e7b7b547a0911fcfc8aefc61c3e8304d7 https://git.kernel.org/stable/c/c2fb439f4f1425a961d20bec818fed2c2d9ef70a https://git.kernel.org/stable/c/2f103287ef7960854808930499d1181bd0145d68 https://git.kernel.org/stable/c/88ce3fe255d58a93624b467af036dc3519f309c7 https://git.kernel.org/stable/c/6b55e879e7bd023a03888fc6c8339edf82f576f4 https://git.kernel.org/stable/c/87988a534d8e12f2e6fc01fe63e6c1925dc5307c