diff options
| author | Iván Ezequiel Rodriguez <ivanrwcm25@gmail.com> | 2026-09-01 10:06:28 -0300 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-09-01 07:38:07 -0700 |
| commit | f84819ef8d66931ee3998fee3c4f03230f4cb6cc (patch) | |
| tree | 771c9f48c51777e5db335abfb02954d5d8c23fd4 /drivers/input/misc/soc_button_array.c | |
| parent | 8b852965b8eaf910c314dc346967ed82c8d4f235 (diff) | |
| download | linux-next-f84819ef8d66931ee3998fee3c4f03230f4cb6cc.tar.gz linux-next-f84819ef8d66931ee3998fee3c4f03230f4cb6cc.zip | |
Input: zero ff_effect before compat copy in input_ff_effect_from_user
In the compat path input_ff_effect_from_user() aliases the caller's
native struct ff_effect with the smaller struct ff_effect_compat and
copies only the compat sized prefix:
compat_effect = (struct ff_effect_compat *)effect;
if (copy_from_user(compat_effect, buffer,
sizeof(struct ff_effect_compat)))
The tail of the native structure is never written. Callers pass an
uninitialized on-stack object, for example evdev_do_ioctl() for
EVIOCSFF, so those bytes keep their previous stack contents.
input_ff_upload() then stores the full native structure in
ff->effects[id], from where a uinput based force feedback daemon can
read it back via UI_BEGIN_FF_UPLOAD, disclosing kernel stack memory to
userspace.
Zero the effect before the compat copy.
Fixes: 2d56f3a32c0e ("Input: refactor evdev 32bit compat to be shareable with uinput")
Cc: stable@vger.kernel.org
Signed-off-by: Iván Ezequiel Rodriguez <ivanrwcm25@gmail.com>
Link: https://patch.msgid.link/20260901130629.24078-3-ivanrwcm25@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc/soc_button_array.c')
0 files changed, 0 insertions, 0 deletions
