diff options
| author | Benjamin Berg <[email protected]> | 2025-02-26 13:31:36 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2025-02-26 14:32:34 +0000 |
| commit | 5d3b81d4d8520efe888536b6906dc10fd1a228a8 (patch) | |
| tree | 66fcceb6fb7c1d7aaaec6c2603e2d0d98c36e58e /drivers/pci/controller/pci-host-common.c | |
| parent | vmlinux.lds.h: Remove entry to place init_task onto init_stack (diff) | |
| download | kernel-5d3b81d4d8520efe888536b6906dc10fd1a228a8.tar.gz kernel-5d3b81d4d8520efe888536b6906dc10fd1a228a8.zip | |
x86/fpu: Avoid copying dynamic FP state from init_task in arch_dup_task_struct()
The init_task instance of struct task_struct is statically allocated and
may not contain the full FP state for userspace. As such, limit the copy
to the valid area of both init_task and 'dst' and ensure all memory is
initialized.
Note that the FP state is only needed for userspace, and as such it is
entirely reasonable for init_task to not contain parts of it.
Fixes: 5aaeb5c01c5b ("x86/fpu, sched: Introduce CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT and use it on x86")
Signed-off-by: Benjamin Berg <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
----
v2:
- Fix code if arch_task_struct_size < sizeof(init_task) by using
memcpy_and_pad.
Diffstat (limited to 'drivers/pci/controller/pci-host-common.c')
0 files changed, 0 insertions, 0 deletions
