Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp40632lqt; Thu, 18 Apr 2024 07:59:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3BJ4txUdmls2i4E9HXtPN1ToCWr2bPleWM9d5C4J6ESgz+2pNixiacMT25CzEfXBbaKcQwW6/EK6jbNxobLAwC95yWTgnkRJ6zBfrHA== X-Google-Smtp-Source: AGHT+IEA3+pHyeygmdWLMbx8UdlgLvVJ0JqFK2bCAKzWt02uwNw2hJV8qjil29VQfUTG3ApDIDl8 X-Received: by 2002:a50:ab50:0:b0:56e:23e3:bdc3 with SMTP id t16-20020a50ab50000000b0056e23e3bdc3mr1891262edc.16.1713452391213; Thu, 18 Apr 2024 07:59:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713452391; cv=pass; d=google.com; s=arc-20160816; b=YZD5QJMlY++dUWxAdvwKhDk/i9hxVJXd8CiwztVERxUwhNBffwzerD1WEq5gA7lUgw fq2r7jXYvXGS4/zJoyxB4nB9fDf/nvxmu9/pjo3ksOKV6qwNjwiYnE1yUQPj58oQNchI mJ2gI7AhIPjsEKG/CPqVo0eDd4Z+vkpWB+tzBO39hO2ubbgtDHW2Yp/hyyqo+zI0rA3T r/Ub94aRAf8wqV9xlZE0+UELjkxOGJ9L6URFG+OrLZ+Tdgr6TAaQId6EgcFFExQ2SV33 dKERpJYt3dniN22zzQn1Jq6e7994FFgPRv6aPieCFSB+2sfkQzRuU6WfwDbkKTlCMxdP KRxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ACogZJEdtOdVhnIJMZHR3R6Fxs3G1Qimb9cYbUq4sdM=; fh=DM/k3nnZYFJ7VKecDTTtHMnjFKhpkJ4DIXszbeIAJCw=; b=ce8k6yuwUAoLtbkmmSooga1n33on3GAPsQJG8GCVacnmVM5+RKOFOIeDBaAn3CB/PW SL8BdKrodkSHIL9sybzRg7ivCOzDRBSZrHPGzaRi2AYY4ohKbHnFJuG7nk7ynqMLHXce KBfFGatk7KaDCqAQ18xGsMYsdnvU+r1RoU8oojfUQpNHOeUn/WAoUfYIyJGri8Dbyoh3 R7in4X/HAJWXmtoJYdzDBknYnn3S3F5Z9Z5gqo7vCATh2OZeMEV0hVf8JbzbZF9qtYdG 6zLRKpXrEE18Krj73bFiu9VOe1zQVj57t3rpxuZWcRAxHN8ugrRXxgFjyz4mzTBtXe8n TKNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DRe7Yp8g; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-150354-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k9-20020aa7d8c9000000b005701fd5ff43si380636eds.198.2024.04.18.07.59.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 07:59:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150354-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DRe7Yp8g; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-150354-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DE53A1F2299A for ; Thu, 18 Apr 2024 14:59:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F08D16F8E4; Thu, 18 Apr 2024 14:58:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DRe7Yp8g" 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 6F03C16ABD8; Thu, 18 Apr 2024 14:58:12 +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=1713452292; cv=none; b=U/9CSqAPz1QrpabgyXWhpqQzniGpLqligLzUhuuBCcjKEHxWgXvHDe/V6baBvd4083lPRzkn5ONMrS+vrjSFgpzekwXOmR+oGilDX2Vw/t0PmJUObjSE5xwz2asmsqZv8HyCE+SMmS6yYHx8GxGPMstZ2WDh2xlogccVcAicaUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713452292; c=relaxed/simple; bh=/5oSkuDJAArud9gZ/VsWUrH2hogQeBaRQ8aAYn5k1LA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=A4iOYddMWoC/ljRGJMacMeQzEcgyBQaCtcHc748lMxHZqBIT3KP+quwdXizOFjgEmBqA95z8lJP4AhFle3tMTtmReYtAJwR56AfWE6aT8dorTcOfuzGe9JJwWjN5EON3/ijCyOcdUbqntnmHm3vFPqwXz73TgGwBRpJ6Zw2lkeQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DRe7Yp8g; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A44AC113CC; Thu, 18 Apr 2024 14:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713452292; bh=/5oSkuDJAArud9gZ/VsWUrH2hogQeBaRQ8aAYn5k1LA=; h=From:To:Cc:Subject:Date:From; b=DRe7Yp8gRTlxSZYk0T1zV0fioZNAZpn1yIKERsk4VphLKcSrt+qBNlQYN/Lv0Aqb5 P46Me0GZZjur9BldXbznMkPIDMj2DFrvh0xsGeAZC/+8Ggq55eXcdgZxT2PF9EZRTo 8T4Xg4Gq02AnhuTjhwb/ZAhozLoc14gGv+bgeSkN5LmRBnndGao5VX98YR14eU+Pfq 0i07vhwXfXaVhOpUCQbAwiQO1dGcdnyb8VkTeq5QDCz1UGFy/Ci5gTAChT6+ESBCXT 2MzBO2L2o/FM1pk4w1HQM56CHqmGlP6os14syMD9HbVta2l5BmhK3Q7JdaTTfleWV2 ZvUeHTWipKKuw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rxTDJ-000000001DP-3MOl; Thu, 18 Apr 2024 16:58:14 +0200 From: Johan Hovold To: Bryan O'Donoghue , Heikki Krogerus Cc: Bjorn Andersson , Konrad Dybcio , Greg Kroah-Hartman , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 0/2] usb: typec: qcom-pmic: fix use-after-free on late probe errors Date: Thu, 18 Apr 2024 16:57:28 +0200 Message-ID: <20240418145730.4605-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When reviewing a patch updating the qcom-pmic typec driver, I noticed that the error handling is broken and can lead to use-after-free. This series addresses the use-after-free and also fixes the error handling in the pdphy_start() callback which failed to disable its supply in all error paths. The latter fix is not marked for stable on purpose as its not a critical fix (I'm sure autosel will disagree). Johan Johan Hovold (2): usb: typec: qcom-pmic: fix use-after-free on late probe errors usb: typec: qcom-pmic: fix pdphy start() error handling drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c | 8 ++++++-- drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_pdphy.c | 11 +++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) -- 2.43.2