Skip to content
Commit 37bd59d3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Hans de Goede
Browse files

platform/x86: intel_pmc_core: Uninitialized data in pmc_core_lpm_latch_mode_write()



The simple_write_to_buffer() can return success if even a single byte
is copied from user space.  In this case it can result in using
uninitalized data if the buf[] array is not fully initialized.  Really
we should only succeed if the whole buffer is copied.

Just using copy_from_user() is simpler and more appropriate.

Fixes: 8074a79f ("platform/x86: intel_pmc_core: Add option to set/clear LPM mode")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YIBCf+G9Ef8wrGJw@mwanda


Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent f75bf693
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment