[PATCH 3/3] x86: avoid copying dynamic FP state from init_task

2024-12-17 Thread Benjamin Berg
From: Benjamin Berg 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 init_task and fill the rest with zero. Note that the FP state is only needed for userspace, and as such it is

[PATCH 0/3] KASAN fix for arch_dup_task_struct (x86, um)

2024-12-17 Thread Benjamin Berg
From: Benjamin Berg On the x86 and um architectures struct task_struct is dynamically sized depending on the size required to store the floating point registers. After adding this feature to UML it sometimes triggered KASAN errors as the memcpy in arch_dup_task_struct read past init_task. In my

[PATCH 2/3] um: avoid copying FP state from init_task

2024-12-17 Thread Benjamin Berg
From: Benjamin Berg The init_task instance of struct task_struct is statically allocated and does not contain the dynamic area for the userspace FP registers. As such, limit the copy to the valid area of init_task and fill the rest with zero. Note that the FP state is only needed for userspace,

[PATCH 1/3] vmlinux.lds.h: remove entry to place init_task onto init_stack

2024-12-17 Thread Benjamin Berg
From: Benjamin Berg Since commit 0eb5085c3874 ("arch: remove ARCH_TASK_STRUCT_ON_STACK") there is no option that would allow placing task_struct on the stack. Remove the unused linker script entry. Signed-off-by: Benjamin Berg --- include/asm-generic/vmlinux.lds.h | 1 - 1 file changed, 1 dele

[PATCH] um: rtc: use RTC time when calculating the alarm

2024-12-17 Thread Benjamin Berg
From: Benjamin Berg The kernel realtime and the current RTC time may have a (small) offset. Should the kernel time be slightly in the future, then the timeout is zero. This is problematic in time-travel mode, as a zero timeout can be correctly configured and time never advances. Replace the kern

Re: [PATCH v5 02/13] x86/um: nommu: elf loader for fdpic

2024-12-17 Thread Kees Cook
On Thu, Dec 12, 2024 at 07:12:09PM +0900, Hajime Tazaki wrote: > As UML supports CONFIG_MMU=n case, it has to use an alternate ELF > loader, FDPIC ELF loader. In this commit, we added necessary > definitions in the arch, as UML has not been used so far. It also > updates Kconfig file to use BINFM