From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 EF1F7390C90; Fri, 7 Aug 2026 14:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786114021; cv=none; b=cI9Io+ji9PrcFIkPAaepOIDgp02MCgyUlBCMQRJ4ceRnPeKCbucsTlaXTuOcZEfhTVdWBXik/qSfa7XoaPyrJEeUVemwu3IvXkOP3qY1ARDUsOII6qi5cjIHilQzEPXAa2G5yxjRNlzxQKd4PqhRrQkxwFdjowcxcKaBfeq0AW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786114021; c=relaxed/simple; bh=6X2/7MXBWsOZoq601zvTm/WqlCf3eeNMDlwyi+oWVLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WN9QjvQWQh8ckt1fXnp052mL0I/4N5WNMwlFgLxvqC/eSIpGefG8cje1WUqO3TFr9K//aO+zCk+FnxwLOTyO6+GNPLihyZRuSopW0jr6qBF8PYfeA1pPMceKyEOLozCX/O/W3A/YPiu2WG3cwryAajUtcwygqSzVyh1huhB+U7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jsE2kUJU; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jsE2kUJU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74F2D1F00A3A; Fri, 7 Aug 2026 14:46:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786114017; bh=RbLmPyWB+WdpnAd3dLH8mH62xeZrBEdRY+8La+ssHV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jsE2kUJU4peO/5HCU+SdMHScF+BF06L5QD22wsN+m9LrmwoLdVqdPy0I33A7IDX12 aOcmfSqFRgGKksutwPDW/leTVFwrirsucxsJPM61oo7E+3sYv6aF8pCxkcH7ANskCk OfjKybq79qOB/P1PqmYAzy7MAQKXkPHJi0Yn75+k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, sashiko-bot@kernel.org, Luiz Angelo Daros de Luca , Guenter Roeck , Sasha Levin Subject: [PATCH 6.12 078/337] hwmon: (adt7470) Fix busy-loop and I2C flooding in update thread Date: Fri, 7 Aug 2026 16:34:41 +0200 Message-ID: <20260807143420.204838359@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260807143418.516897842@linuxfoundation.org> References: <20260807143418.516897842@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luiz Angelo Daros de Luca [ Upstream commit cb0b7f9c43b0abbd422a7e4c2c85e91db429207c ] When userspace configures 'auto_update_interval' to 0 via sysfs, the background kthread executes schedule_timeout_interruptible(0), which returns immediately. If 'num_temp_sensors' is concurrently or previously set to 0, the msleep_interruptible() delay inside adt7470_read_temperatures() also becomes 0. This combination forces the background thread into a tight, unbounded busy-loop, hogging the CPU and flooding the I2C bus with a continuous stream of transactions. Fix this vulnerability by raising the lower limit of the clamp_val in auto_update_interval_store() from 0 to 500 milliseconds. This guarantees a reasonable minimum sleep window between sensor updates, protecting the system from intentional or accidental I2C bus denial of service. Reported-by: sashiko-bot@kernel.org Closes: https://lore.kernel.org/r/20260716213252.EACA71F000E9@smtp.kernel.org Fixes: 89fac11cb3e7 ("adt7470: make automatic fan control really work") Signed-off-by: Luiz Angelo Daros de Luca Link: https://lore.kernel.org/r/20260727-adt7470_fixes-v2-3-598e38a46ba6@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- drivers/hwmon/adt7470.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c index 06b19fd382457..a927e0b6d3319 100644 --- a/drivers/hwmon/adt7470.c +++ b/drivers/hwmon/adt7470.c @@ -509,7 +509,7 @@ static ssize_t auto_update_interval_store(struct device *dev, if (kstrtol(buf, 10, &temp)) return -EINVAL; - temp = clamp_val(temp, 0, 60000); + temp = clamp_val(temp, 500, 60000); mutex_lock(&data->lock); data->auto_update_interval = temp; -- 2.53.0