]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: dell-wmi-sysman: Avoid buffer overflow in current_password_store()
authorVladimir Moskovkin <Vladimir.Moskovkin@kaspersky.com>
Wed, 14 May 2025 12:12:55 +0000 (12:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:38:06 +0000 (14:38 +0200)
commitfb7cde625872709b8cedad9b241e0ec3d82fa7d3
treec92da5bcf991adcbd36312a7da572ad16124969a
parent0f5d93ee3f8b769b5da16cfb83647cb81a53e293
platform/x86: dell-wmi-sysman: Avoid buffer overflow in current_password_store()

commit 4e89a4077490f52cde652d17e32519b666abf3a6 upstream.

If the 'buf' array received from the user contains an empty string, the
'length' variable will be zero. Accessing the 'buf' array element with
index 'length - 1' will result in a buffer overflow.

Add a check for an empty string.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
Cc: stable@vger.kernel.org
Signed-off-by: Vladimir Moskovkin <Vladimir.Moskovkin@kaspersky.com>
Link: https://lore.kernel.org/r/39973642a4f24295b4a8fad9109c5b08@kaspersky.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/x86/dell/dell-wmi-sysman/passobj-attributes.c