From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796327759; b=Ac7oTuJKPwOc0mjtv0phFXV1c9d5R5KD3zv1Dj13akl/x1/bM+2gj9mAv+tj9sEwMF/I u5/8dyL+h7xUbObpj02kKCP4WzGwFcCaA17vVHovScsOT/Y9Zc25lPmFkdDP6G4/oCXUX E6kpXnApcebRq2Wfog0TYIiR2NKAp9NHV14yzIj0bQ2hst1TcqGZa8G+JQnF/znT51ry6 k1loIRgD7fISTc+5Ickl7cosCqeCSIBGxL43Uwb0i3q3sONjj0X/bWOffGUVgfdJtlDkC aV7qaCVF3OR9LUupzrartJJfTHZaAsYd9rHCm9Dckz5e7T/hlIiTwEefcwZ6+S9aFMg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796327759; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=KMYp1lgn6ovcZYyu3idfwbGObWukF624ZiY9jua4INQ=; b=x0Ze35bATS38JXeck75BG13w2uzmuckChzMSOzt0C49paE5BA/2hS3gz7fRiyfJKNaMt nesYm2O6BApFwBWEBN1uty+t0psx1TScEbuzYmW3MGrNlQM3N4HsTSpiMmVllXMOazWto MrlvqC1dQgc5SFtFE++00qoesnbIJ88gM4XSRQOxv3t6bOLlr0vzAlFzQV/g9gitbzgjK 4FAW3rAvLSSktmbeCDW9haYbDzbZi6uXomGtq1tMNUQsKqu/rYbvZSmYCz6NoeLDyxvyD dzgMmznxzBAvUsiYD/4hk7uDuNYP+1wQY2bSZGADuDFXo1I4cLQunCl7oTVvpEBzjcg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D4lfVuTL; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34807606A322; Thu, 3 Dec 2026 19:55:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=D4lfVuTL Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49D811F0092B; Thu, 3 Dec 2026 19:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796327758; bh=KMYp1lgn6ovcZYyu3idfwbGObWukF624ZiY9jua4INQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=D4lfVuTL/NkNz7bEieIaMC90iOyykxoU2oYRDhUhXWx2bspP4MWQS6BJSFlpvA+OZ ZjLfj2c8969uwslhtUn1POJ9tdTv2bUQ++gTHlkYRSQStlyJkYQaRmaaOYVtV3KVj1 Z5krZjV0yD7g2q7lTZGS9Lhbq/jt/R0qfeBMZknSkETa1NsvumQ3JxcDQSj9BNans+ YyRdO9V0GfobGF3YCz38XeD/NVbavKl4F1mgL6WMamUuxdH+5VjTJkzIthyGJEpbTV PCEABXSPgpgxxa1Vd4egcFNfuXr033eAdGhXVPaAuNbC6kVXHZa61Z9e5cJVtPeDhM B4s1b9NjdMEpA== From: Lee Jones To: lee@kernel.org, "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Matthew Garrett , linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 03/10] thermal: int3400: Clean up ODVP attributes after unregistering thermal zone Date: Thu, 3 Dec 2026 19:54:14 +0000 Message-ID: <20261203195529.3063246-4-lee@kernel.org> X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog In-Reply-To: <20261203195529.3063246-1-lee@kernel.org> References: <20261203195529.3063246-1-lee@kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit int3400_thermal_remove() calls cleanup_odvp() before thermal_zone_device_unregister(). A concurrent sysfs mode write can still invoke int3400_thermal_change_mode() -> evaluate_odvp(), recreating the odvpN sysfs attributes before priv is freed and leaving dangling attributes that trigger a use-after-free in odvp_show(). Move cleanup_odvp() after thermal_zone_device_unregister(), matching the probe error path. Fixes: 006f006f1e5c ("thermal/int340x_thermal: Export OEM vendor variables") Closes: https://sashiko.dev/#/bug/linux-fb387528-ad8f-418c-b2af-878f7ad81af1 Cc: stable@vger.kernel.org Signed-off-by: Lee Jones --- drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 5d70301d4a3d..7cd533414973 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -668,8 +668,6 @@ static void int3400_thermal_remove(struct platform_device *pdev) priv->adev->handle, ACPI_DEVICE_NOTIFY, int3400_notify); - cleanup_odvp(priv); - if (!priv->rel_misc_dev_res) acpi_thermal_rel_misc_device_remove(priv->adev->handle); @@ -678,6 +676,7 @@ static void int3400_thermal_remove(struct platform_device *pdev) sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group); sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group); thermal_zone_device_unregister(priv->thermal); + cleanup_odvp(priv); kfree(priv->data_vault); kfree(priv->trts); kfree(priv->arts); -- 2.56.1.911.g883d8bcb20-goog