Thread (9 messages) 9 messages, 3 authors, 2021-08-05

Re: [PATCH] platform/x86: intel_pmc_core: Fix potential buffer overflows

From: Andy Shevchenko <hidden>
Date: 2021-08-03 18:31:01
Also in: platform-driver-x86

On Tue, Aug 3, 2021 at 9:26 PM Andy Shevchenko
[off-list ref] wrote:
On Tue, Aug 3, 2021 at 9:21 PM Evgeny Novikov [off-list ref] wrote:
quoted
It looks like pmc_core_get_low_power_modes() mixes up modes and
priorities. In addition to invalid behavior, potentially this can
cause buffer overflows since the driver reads priorities from the
register and then it uses them as indexes for array lpm_priority
that can contain 8 elements at most. The patch swaps modes and
priorities.

Found by Linux Driver Verification project (linuxtesting.org).
Seems legit.
Hold on, but then it follows with another loop where actually it reads
modes by priority index. Can you elaborate what exactly is the problem
you think?

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help