diff options
| author | Aaron Tomlin <atomlin@atomlin.com> | 2026-05-26 17:16:51 +0300 |
|---|---|---|
| committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2026-06-15 13:17:27 +0300 |
| commit | 98e37db4a34d3af3fb2f4648295c25b5e40b20e3 (patch) | |
| tree | 4f26e2b57227169f1f3a41ca5cd7f4c0cd78dc87 /include/linux/debugobjects.h | |
| parent | 1b001b16bc88f3f7817e228acfd91ee01bdcfcce (diff) | |
| download | linux-98e37db4a34d3af3fb2f4648295c25b5e40b20e3.tar.xz | |
mips: sched: Fix CPUMASK_OFFSTACK memory corruption
This patch addresses a critical memory management flaw. When
CONFIG_CPUMASK_OFFSTACK is enabled, cpumask_var_t is a pointer.
Consequently, sizeof(new_mask) evaluates to the pointer size, causing
copy_from_user() to clobber the mask pointer. Furthermore, the old
logic performed copy_from_user() before allocating the mask.
Fix this by allocating new_mask first. To handle variable-sized user
masks correctly, use cpumask_size() to truncate overly large user masks
or pad undersized masks with zeros before copying the data directly into
the allocated buffer.
Fixes: 295cbf6d63165 ("[MIPS] Move FPU affinity code into separate file.")
Cc: stable@vger.kernel.org
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
