Linux-Hwmon Archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Erhard Furtner <erhard_f@mailbox.org>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: BUG: KASAN: global-out-of-bounds in nct6775_probe+0x5654/0x6fe9 [nct6775_core] (kernel 6.8-rc5, amd64)
Date: Tue, 20 Feb 2024 23:20:27 -0800	[thread overview]
Message-ID: <d51181d1-d26b-42b2-b002-3f5a4037721f@roeck-us.net> (raw)
In-Reply-To: <20240221014152.53b995d4@yea>

On 2/20/24 16:41, Erhard Furtner wrote:
> On Tue, 20 Feb 2024 07:45:18 -0800
> Guenter Roeck <linux@roeck-us.net> wrote:
> 
> 
>> Would it be possible to run the stack trace through scripts/decode/stacktrace.sh ?
>> I am having trouble associating the backtrace with the actual source.
>>
>> Also, did you by any chance try the same configuration on the same system with
>> a pre-6.8 kernel ? The source code locations I did find (unless they are completely
>> off) point to code that wasn't changed on after v6.7, so it would help to understand
>> if this is a new problem or one that is exposed by your board.
> 
> Hi Günter!
> 
> I tried v6.6 just now and got the issue there too.
> 

Thanks for confirming. That makes more sense. Yu should actually see the problem
all the way back to (at least) v5.15.y.

> ./scripts/decode_stacktrace.sh /boot/vmlinuz-6.8.0-rc5-Zen3 < ~ef/dmesg_68-rc5_zen3_v01
> 

The log is again from 6.8, though.

Anyway,

> gives me:
> 
> [...]
> nct6775: Found NCT6798D or compatible chip at 0x2e:0x290
> BTRFS info (device nvme0n1p7: state M): use lzo compression, level 0
> loop: module loaded
> ==================================================================
> BUG: KASAN: global-out-of-bounds in nct6775_probe+0x5654/0x6fe9 nct6775_core

This would be the important location. To get that, you would have to provide the
modules directory as second parameter to decode_stacktrace.

After compiling a kernel with your configuration, it does point me to a line
in the source code (drivers/hwmon/nct6775-core.c:4207).

                        data->reg_temp_config[src - 1] = reg_temp_config[i];

The range of "i" is 0..11, and the size of the reg_temp_config[] array is 2. Oops.

I'll work on a fix.

Thanks,
Guenter


      reply	other threads:[~2024-02-21  7:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 13:01 BUG: KASAN: global-out-of-bounds in nct6775_probe+0x5654/0x6fe9 [nct6775_core] (kernel 6.8-rc5, amd64) Erhard Furtner
2024-02-20 15:45 ` Guenter Roeck
2024-02-21  0:41   ` Erhard Furtner
2024-02-21  7:20     ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d51181d1-d26b-42b2-b002-3f5a4037721f@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=erhard_f@mailbox.org \
    --cc=linux-hwmon@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).