Input: zero ff_effect before compat copy in input_ff_effect_from_user
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2d56f3a32c0e62f99c043d2579840f9731fe5855 · < 0d05b43b55d4784a42ce8fb318175f8ad7d9af5a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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.
From the CVE record · Linux
The Linux kernel’s compat force feedback path leaves part of an effect structure uninitialized. When a caller submits an effect through EVIOCSFF, a uinput-based force feedback daemon can read back kernel stack contents through UI_BEGIN_FF_UPLOAD. This requires local interaction with those interfaces; authentication requirements are not specified.
Anyone running a Linux kernel that uses the compat force feedback input path should check whether their kernel includes the fix; affected versions are not specified.