From mboxrd@z Thu Jan 1 00:00:00 1970 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 7D0F4263F23 for ; Tue, 8 Apr 2025 08:18:36 +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=1744100316; cv=none; b=Nz1FYXKAtMNIQ1IXjwklKNutyq98wmVx3V7hZbIISYOGaMqgXt4Cepn99usGEnnwtDr4/FEdkOPegeKpZo/JPdB9zQnA0t63VQssVKhk8XqXwxNp70xz713ym4wl2g1yQPpy2JxgD0QbMK0jMoiUrNdbmaKRcnVSyylGf7dvTPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744100316; c=relaxed/simple; bh=Hv4YdNmarcD67gOan56hwUWAIVjgmbijen3cn2nUbT0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=apaQwceYa1hQI9LaleKq5DkHvE9AhIm/Eony+fbDn//zQPG23mts2x1b1oHUzUPt4QuvYMdeJJuGZsIWOK8hTmlP4pymCifaqf4dcRwZeLRH/Q5ZrF3iKPLFrvxA9G0T0kiXPqQvABP3n/EEhTLp+KnlE9j1/B8ebTAkNRIDNHs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rwvZt8+6; 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="rwvZt8+6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BD34C4CEE9; Tue, 8 Apr 2025 08:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744100315; bh=Hv4YdNmarcD67gOan56hwUWAIVjgmbijen3cn2nUbT0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=rwvZt8+6L0Idg05/rXszE6XmVhprr1WRrPRI8X5R5QW0NcIKzqApqVruFTaAJGnjG rSKIYzBeNmfIFTsnLqEDedIJcqp4jEEdrw1lnlS8My4+Ldt1EcLC+tTwg+jTBJ3vzd NsMJuHcqeU3iRGUkQCb6dOXgGuuT4hzixxJKMy0A= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-22014: soc: qcom: pdr: Fix the potential deadlock Date: Tue, 8 Apr 2025 10:16:48 +0200 Message-ID: <2025040843-CVE-2025-22014-9c4f@gregkh> X-Mailer: git-send-email 2.49.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=4134; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Hv4YdNmarcD67gOan56hwUWAIVjgmbijen3cn2nUbT0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlfbmc/D+rQPCWwQDM0ZFpAT56MxP69qumPns/Y+UXoj JTIvxOXO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiNwoZ5gfU/Sq8dEtiitq3 uLzo3xzz9C51HGGY73nYYOIUw6k8xVP3PVtbcHDKm4/RIQA= 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: soc: qcom: pdr: Fix the potential deadlock When some client process A call pdr_add_lookup() to add the look up for the service and does schedule locator work, later a process B got a new server packet indicating locator is up and call pdr_locator_new_server() which eventually sets pdr->locator_init_complete to true which process A sees and takes list lock and queries domain list but it will timeout due to deadlock as the response will queued to the same qmi->wq and it is ordered workqueue and process B is not able to complete new server request work due to deadlock on list lock. Fix it by removing the unnecessary list iteration as the list iteration is already being done inside locator work, so avoid it here and just call schedule_work() here. Process A Process B process_scheduled_works() pdr_add_lookup() qmi_data_ready_work() process_scheduled_works() pdr_locator_new_server() pdr->locator_init_complete=true; pdr_locator_work() mutex_lock(&pdr->list_lock); pdr_locate_service() mutex_lock(&pdr->list_lock); pdr_get_domain_list() pr_err("PDR: %s get domain list txn wait failed: %d\n", req->service_name, ret); Timeout error log due to deadlock: " PDR: tms/servreg get domain list txn wait failed: -110 PDR: service lookup for msm/adsp/sensor_pd:tms/servreg failed: -110 " Thanks to Bjorn and Johan for letting me know that this commit also fixes an audio regression when using the in-kernel pd-mapper as that makes it easier to hit this race. [1] The Linux kernel CVE team has assigned CVE-2025-22014 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit fbe639b44a82755d639df1c5d147c93f02ac5a0f and fixed in 6.1.132 with commit 0a566a79aca9851fae140536e0fc5b0853c90a90 Issue introduced in 5.7 with commit fbe639b44a82755d639df1c5d147c93f02ac5a0f and fixed in 6.6.85 with commit f2bbfd50e95bc117360f0f59e629aa03d821ebd6 Issue introduced in 5.7 with commit fbe639b44a82755d639df1c5d147c93f02ac5a0f and fixed in 6.12.21 with commit f4489260f5713c94e1966e5f20445bff262876f4 Issue introduced in 5.7 with commit fbe639b44a82755d639df1c5d147c93f02ac5a0f and fixed in 6.13.9 with commit 02612f1e4c34d94d6c8ee75bf7d254ed697e22d4 Issue introduced in 5.7 with commit fbe639b44a82755d639df1c5d147c93f02ac5a0f and fixed in 6.14 with commit 2eeb03ad9f42dfece63051be2400af487ddb96d2 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-2025-22014 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: drivers/soc/qcom/pdr_interface.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/0a566a79aca9851fae140536e0fc5b0853c90a90 https://git.kernel.org/stable/c/f2bbfd50e95bc117360f0f59e629aa03d821ebd6 https://git.kernel.org/stable/c/f4489260f5713c94e1966e5f20445bff262876f4 https://git.kernel.org/stable/c/02612f1e4c34d94d6c8ee75bf7d254ed697e22d4 https://git.kernel.org/stable/c/2eeb03ad9f42dfece63051be2400af487ddb96d2