Re: [PATCH] nct6775: Fix access to temperature configuration registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 2/21/24 13:31, Ahmad Khalifa wrote:
On 21/02/2024 14:13, Guenter Roeck wrote:
The number of temperature configuration registers does
not always match the total number of temperature registers.
This can result in access errors reported if KASAN is enabled.

BUG: KASAN: global-out-of-bounds in nct6775_probe+0x5654/0x6fe9 nct6775_core

Reported-by: Erhard Furtner <erhard_f@xxxxxxxxxxx>
Closes: https://lore.kernel.org/linux-hwmon/d51181d1-d26b-42b2-b002-3f5a4037721f@xxxxxxxxxxxx/
Fixes: 578ab5f0e4b1 ("hwmon: (nct6775) Add support for NCT6791D")
Fixes: b7f1f7b2523a ("hwmon: (nct6775) Additional TEMP registers for nct6799")
Cc: Ahmad Khalifa <ahmad@xxxxxxxxxx>
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---

Tested-by: Ahmad Khalifa <ahmad@xxxxxxxxxx>


Tested on nct6799D-R without KASAN - nothing to report.

Thanks for testing. Note that you would only see the problem if KASAN is enabled
(otherwise the code just sets a more or less random register address). On top of
that it depends on the chip configuration.

Tiny note, i is in the range of 0..7 on nct6798/nct6799 if I
follow correctly? Still 8 > 2, well caught.

Sorry, I don't understand your comment. Yes, i is in the range of 0..7 on
nct6798/nct6799, which triggers the failure if i >= 2 because the code uses
the NCT6779_REG_TEMP_CONFIG array to identify configuration registers,
and that array only has two entries.

Thanks,
Guenter





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux