Linux: Input: evdev - zero absinfo before partial copy in EVIOCSABS
What fixes it
- 89b6ffa4bc10c436fa9aecc73be105124cd58a35LinuxCVE List
- 30b853a3d71f16bd0aa66b604bc37dd1254a19b3LinuxCVE List
- 71e5619db11dd6429101bd967230d0321ec5ea26LinuxCVE List
- 3dfe48d5307a1ba22c58231d04257737015569caLinuxCVE List
- 8b852965b8eaf910c314dc346967ed82c8d4f235LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
In the Linux kernel, the following vulnerability has been resolved:
Input: evdev - zero absinfo before partial copy in EVIOCSABS
The EVIOCSABS handler copies at most the user supplied ioctl size into an uninitialized on-stack struct input_absinfo:
if (copy_from_user(&abs, p, min_t(size_t, size, sizeof(struct input_absinfo))))
The size comes from _IOC_SIZE() of the ioctl command and is therefore fully controlled by userspace. A short size leaves the trailing part of the structure holding whatever was on the kernel stack, and the whole structure is then stored into the device:
dev->absinfo[t] = abs;
EVIOCGABS hands that back to userspace, disclosing the stale stack bytes. Only the resolution field is currently cleared, which covers the legacy struct layout but not an arbitrarily short size.
Zero the structure before the copy so any part not supplied by the caller reads back as zero. The existing resolution fixup is kept, since it also handles a size that partially overlaps that field.
Text from CVE List
Affected versions 18
- Linuxaffected: 448cd1664a573e69f54bfd32f3bb7220212b6cf5 before c0aebb57b73c7d06ad21731099afe119b113c403CVE List
- Linuxaffected: 448cd1664a573e69f54bfd32f3bb7220212b6cf5 before 89b6ffa4bc10c436fa9aecc73be105124cd58a35CVE List
- Linuxaffected: 448cd1664a573e69f54bfd32f3bb7220212b6cf5 before e834e134a32b6a5c600fa539bb49146f617743abCVE List
- Linuxaffected: 448cd1664a573e69f54bfd32f3bb7220212b6cf5 before af5f7130cbf39e6e12336d0b7a5f6e76e4e1526bCVE List
- Linuxaffected: 448cd1664a573e69f54bfd32f3bb7220212b6cf5 before 30b853a3d71f16bd0aa66b604bc37dd1254a19b3CVE List
- Linuxaffected: 448cd1664a573e69f54bfd32f3bb7220212b6cf5 before 71e5619db11dd6429101bd967230d0321ec5ea26CVE List
- Linuxaffected: 448cd1664a573e69f54bfd32f3bb7220212b6cf5 before 3dfe48d5307a1ba22c58231d04257737015569caCVE List
- Linuxaffected: 448cd1664a573e69f54bfd32f3bb7220212b6cf5 before 8b852965b8eaf910c314dc346967ed82c8d4f235CVE List
- Linuxaffected: 2.6.36CVE List
- Linuxunaffected: all versions before 2.6.36CVE List
- Linuxunaffected: 5.10.271 through 5.10.*CVE List
- Linuxunaffected: 5.15.222 through 5.15.*CVE List
- Linuxunaffected: 6.1.189 through 6.1.*CVE List
- Linuxunaffected: 6.6.158 through 6.6.*CVE List
- Linuxunaffected: 6.12.112 through 6.12.*CVE List
- Linuxunaffected: 6.18.54 through 6.18.*CVE List
- Linuxunaffected: 7.2.8 through 7.2.*CVE List
- Linuxunaffected: 7.3CVE List
References 8
- git.kernel.org/stable/c/c0aebb57b73c7d06ad21731099afe119b113c403Referencevia CVE List
- git.kernel.org/stable/c/89b6ffa4bc10c436fa9aecc73be105124cd58a35Referencevia CVE List
- git.kernel.org/stable/c/e834e134a32b6a5c600fa539bb49146f617743abReferencevia CVE List
- git.kernel.org/stable/c/af5f7130cbf39e6e12336d0b7a5f6e76e4e1526bReferencevia CVE List
- git.kernel.org/stable/c/30b853a3d71f16bd0aa66b604bc37dd1254a19b3Referencevia CVE List
- git.kernel.org/stable/c/71e5619db11dd6429101bd967230d0321ec5ea26Referencevia CVE List
- git.kernel.org/stable/c/3dfe48d5307a1ba22c58231d04257737015569caReferencevia CVE List
- git.kernel.org/stable/c/8b852965b8eaf910c314dc346967ed82c8d4f235Referencevia CVE List