]> Gentwo Git Trees - linux/.git/commit
Input: uinput - zero-initialize uinput_ff_upload_compat to avoid info leak
authorZhen Ni <zhen.ni@easystack.cn>
Sun, 28 Sep 2025 06:37:37 +0000 (14:37 +0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 29 Sep 2025 04:29:03 +0000 (21:29 -0700)
commitd3366a04770eea807f2826cbdb96934dd8c9bf79
treec784d41db269eb74c16f34c8a0ffc1e4867993ca
parent52e06d564ce6a5f03177922b2fa5667781d5ff83
Input: uinput - zero-initialize uinput_ff_upload_compat to avoid info leak

Struct ff_effect_compat is embedded twice inside
uinput_ff_upload_compat, contains internal padding. In particular, there
is a hole after struct ff_replay to satisfy alignment requirements for
the following union member. Without clearing the structure,
copy_to_user() may leak stack data to userspace.

Initialize ff_up_compat to zero before filling valid fields.

Fixes: 2d56f3a32c0e ("Input: refactor evdev 32bit compat to be shareable with uinput")
Cc: stable@vger.kernel.org
Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
Link: https://lore.kernel.org/r/20250928063737.74590-1-zhen.ni@easystack.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/uinput.c