Re: [PATCH] platform/x86: intel_pmc_core: fix out-of-bounds accesses on stack

2017-01-28 Thread Andy Shevchenko
On Fri, Jan 27, 2017 at 6:31 PM, Andrey Ryabinin wrote: > On 01/27/2017 06:42 PM, Andy Shevchenko wrote: >> On Thu, Jan 26, 2017 at 4:27 PM, Andrey Ryabinin >> wrote: >>> #if IS_ENABLED(CONFIG_DEBUG_FS) >>> @@ -234,12 +230,8 @@ static const struct file_operations >>> pmc_core_ppfear_ops = { >>>

Re: [PATCH] platform/x86: intel_pmc_core: fix out-of-bounds accesses on stack

2017-01-27 Thread Andrey Ryabinin
On 01/27/2017 06:42 PM, Andy Shevchenko wrote: > On Thu, Jan 26, 2017 at 4:27 PM, Andrey Ryabinin > wrote: >> #if IS_ENABLED(CONFIG_DEBUG_FS) >> @@ -234,12 +230,8 @@ static const struct file_operations pmc_core_ppfear_ops >> = { >> /* This function should return link status, 0 means ready *

Re: [PATCH] platform/x86: intel_pmc_core: fix out-of-bounds accesses on stack

2017-01-27 Thread Andy Shevchenko
On Thu, Jan 26, 2017 at 4:27 PM, Andrey Ryabinin wrote: > pmc_core_mtpmc_link_status() an pmc_core_check_read_lock_bit() use > test_bit() on local 32-bit variable. This causes out-of-bounds > access since test_bit() expects object at least of 'unsigned long' size: > >BUG: KASAN: stack-out-of-b

[PATCH] platform/x86: intel_pmc_core: fix out-of-bounds accesses on stack

2017-01-26 Thread Andrey Ryabinin
pmc_core_mtpmc_link_status() an pmc_core_check_read_lock_bit() use test_bit() on local 32-bit variable. This causes out-of-bounds access since test_bit() expects object at least of 'unsigned long' size: BUG: KASAN: stack-out-of-bounds in pmc_core_probe+0x3aa/0x3b0 Call Trace: __asan_re