Re: [PATCH] kasan: fix unit tests with CONFIG_UBSAN_LOCAL_BOUNDS enabled

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

 



On Thu,  6 May 2021 14:20:25 -0700 Peter Collingbourne <pcc@xxxxxxxxxx> wrote:

> These tests deliberately access these arrays out of bounds,
> which will cause the dynamic local bounds checks inserted by
> CONFIG_UBSAN_LOCAL_BOUNDS to fail and panic the kernel. To avoid this
> problem, access the arrays via volatile pointers, which will prevent
> the compiler from being able to determine the array bounds.

Huh.  Is this use of volatile the official way of suppressing the
generation of the checking code or is it just something which happened
to work?  I'm wondering if this workaround should be formalized in some
fashion (presumably a wrapper) rather than mysteriously and
unexplainedly open-coding it like this.




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux