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=1796276239; b=ndPv6rApN58EDltB7YWjjEK2Nw3X5TcxSF6/quOOVxWcMQ6X7QsxuDPnVItEcAnI+GdJ z8dY0VZbUjFjTfIpVjGmky+4RxoUDYYLAyEnqQjByYIWN0HmQgbj49+3MsUuN2fwlnQer 5OmX8OpPO2paksoQesUxPfQ5R6ytmOy8gSrbf2xwEtESfqc1f57m6o4dSDngVY3+hdliv DkV51FlJ3Nrw5wLHSoU3nYRsj6xAfKhh5gy/BiYa0Q8X0nreh2u2b+OqeEic1nckuUxvE wdg0usHalQi9o0UPc3WnWuEc5ktbZpx705YRTCUcATG5XKcvpWhYarvO7Djlw6DVUnw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796276239; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=KAwHSefgB3IgOasygwhUWdf6GmzppALjeH8B1KHMQYo=; b=TIuaUYftM9E4F6YeOsnYB/bz2qRbAoF1P7dg24nVM2sa7WxLm9F65dq4DKvVgCSONJ5h 0nYiXwy72eOm5ThwuWCkt1vmHJ7INMZ4MiW2ZiPLa/ggeO30WNSlt2Ok/LB9ZY9dkddB1 pXHJOKBTY5yfDO9XgT/RK9HEUrTvaEYBQzrgEpqO/seyvq8DT+LPn75aLat8xGtrjRVwm X4mMJ5LhxUzIoPOiUmDS2oKDTA/F4wO5+ZYyc9ozSWlQFKxohTQEsSrGAG3d4xO+z4sYD f7O/rNSuPFZAANXhUJ8TkhL5m8nZ2HxMwqd/TfjeuVxC+jZY80q6gpF0JXsYKCRBCJw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=dzYW5Yei; 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 348C3606A322 for ; Thu, 3 Dec 2026 05:37:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=dzYW5Yei Received: by smtp.kernel.org (Postfix) with ESMTPSA id 136F81F000C1; Thu, 3 Dec 2026 05:37:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796276238; bh=KAwHSefgB3IgOasygwhUWdf6GmzppALjeH8B1KHMQYo=; h=Subject:To:Cc:From:Date; b=dzYW5YeiWZmHWi/gEyooYCRXpKKBnpu1Tjvp3d+L7hXL6wILrb2GuzRoeS/Le4xah 78ypOFQ62twwOUROJypYFO1HP1Pb7IgN2V+HD5fknNmseOPqW+z05AlCcYewX4YN8P nf5GiD/gU4sgp5P0u7Lncay2GqphwcDQFwY6n0jY= Subject: FAILED: patch "[PATCH] hwmon: (dell-smm) Reject a fan_max that the BIOS cannot take" failed to apply to 6.1-stable tree To: rosenp@gmail.com,linux@roeck-us.net Cc: From: Date: Thu, 03 Dec 2026 06:36:40 +0100 Message-ID: <2026120340-germless-unfold-0b35@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x 69624d7d821ec7d3f9801e86acf555a8edc82f99 # git commit -s git send-email --to '' --in-reply-to '2026120340-germless-unfold-0b35@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 69624d7d821ec7d3f9801e86acf555a8edc82f99 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 13 Nov 2026 22:20:23 -0800 Subject: [PATCH] hwmon: (dell-smm) Reject a fan_max that the BIOS cannot take The fan_max module parameter is used without any range check, unlike fan_mult. dell_smm_init_hwmon() allocates the nominal speed table with devm_kmalloc_array(dev, data->i8k_fan_max + 1, ...) and fan_max=4294967295 wraps the count to 0. devm_kmalloc() then returns ZERO_SIZE_PTR, which the first successful nominal speed call writes through. Values above 255 are also meaningless: the fan state is passed to the BIOS as fan | (speed << 8), so the higher bits end up in other parts of the request. Large values that do not wrap still cost one SMM call per state and fan while probing. Fail probing if the maximum fan state does not fit in a byte, like the existing check for fan_mult. Fixes: 81474fc2fae9 ("i8k: Add support for configurable maximum fan speed value") cc: stable@vger.kernel.org Signed-off-by: Rosen Penev Link: https://patch.msgid.link/6d3b86acf6713e9286e60ecf788582e840946238.1794633179.git.rosenp@gmail.com Signed-off-by: Guenter Roeck diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c index 5ec487843faa..47c06376aa52 100644 --- a/drivers/hwmon/dell-smm-hwmon.c +++ b/drivers/hwmon/dell-smm-hwmon.c @@ -1248,6 +1248,12 @@ static int dell_smm_init_data(struct device *dev, const struct dell_smm_ops *ops return -EINVAL; } data->i8k_fan_max = fan_max ? : I8K_FAN_HIGH; + /* The BIOS takes the fan state in a single byte */ + if (data->i8k_fan_max > U8_MAX) { + dev_err(dev, "maximum fan state %u is too large (max %u)\n", + data->i8k_fan_max, U8_MAX); + return -EINVAL; + } data->i8k_pwm_mult = DIV_ROUND_UP(255, data->i8k_fan_max); return 0;