Re: [PATCH] regulator: pfuze100: Fix the global-out-of-bounds access in pfuze100_regulator_probe()

From: Mark Brown
Date: Thu Aug 25 2022 - 07:02:43 EST


On Thu, Aug 25, 2022 at 03:15:41PM +0800, Xiaolei Wang wrote:

> This fixes the out of bounds access bug reported by KASAN.
> BUG: KASAN: global-out-of-bounds in pfuze100_regulator_probe+0x380/0x8b8
> Read of size 3968 at addr c3390640 by task swapper/0/1
>
> CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.0.0-rc1-yocto-standard+ #2
> Hardware name: Freescale i.MX6 SoloX (Device Tree)
> unwind_backtrace from show_stack+0x18/0x1c
> show_stack from dump_stack_lvl+0x68/0x90
> dump_stack_lvl from print_report+0x58/0x4c8
> print_report from kasan_report+0x7c/0x98
> kasan_report from kasan_check_range+0x20/0x170
> kasan_check_range from memcpy+0x28/0x68

Please think hard before including complete backtraces in upstream
reports, they are very large and contain almost no useful information
relative to their size so often obscure the relevant content in your
message. If part of the backtrace is usefully illustrative (it often is
for search engines if nothing else) then it's usually better to pull out
the relevant sections.

Attachment: signature.asc
Description: PGP signature