Subject: CVE-2024-45008: Input: MT - limit max slots

From: Greg Kroah-Hartman <[email-masked]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

Input: MT - limit max slots

syzbot is reporting too large allocation at input_mt_init_slots(), for
num_slots is supplied from userspace using ioctl(UI_DEV_CREATE).

Since nobody knows possible max slots, this patch chose 1024.

The Linux kernel CVE team has assigned CVE-2024-45008 to this issue.

Affected and fixed versions
===========================

	Fixed in 4.19.321 with commit 2829c8061489
	Fixed in 5.4.283 with commit 87f610a1a7fb
	Fixed in 5.10.225 with commit 05dd9aabd04f
	Fixed in 5.15.166 with commit 95f73d01f547
	Fixed in 6.1.107 with commit 94736334b8a2
	Fixed in 6.6.48 with commit 8f04edd554d1
	Fixed in 6.10.7 with commit cd19f1799c32
	Fixed in 6.11 with commit 99d3bf5f7377

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2024-45008
will be updated if fixes are backported, please check that for the most
up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
	drivers/input/input-mt.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/2829c80614890624456337e47320289112785f3e
	https://git.kernel.org/stable/c/87f610a1a7fbdb1f2e3d90b54c955bd3b8a0c322
	https://git.kernel.org/stable/c/05dd9aabd04f9b5eb04dab9bb83d8c3e982d7549
	https://git.kernel.org/stable/c/95f73d01f547dfc67fda3022c51e377a0454b505
	https://git.kernel.org/stable/c/94736334b8a25e4fae8daa6934e54a31f099be43
	https://git.kernel.org/stable/c/8f04edd554d191834e9e1349ef030318ea6b11ba
	https://git.kernel.org/stable/c/cd19f1799c32ba7b874474b1b968815ce5364f73
	https://git.kernel.org/stable/c/99d3bf5f7377d42f8be60a6b9cb60fb0be34dceb