Linux 5.10.162
Greg Kroah-Hartman
maintainerMakefile +2 -2
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 10 -SUBLEVEL = 161 +SUBLEVEL = 162 EXTRAVERSION = NAME = Dare mighty things
@@ -1128,7 +1128,7 @@ export MODORDER := $(extmod-prefix)modules.order export MODULES_NSDEPS := $(extmod-prefix)modules.nsdeps ifeq ($(KBUILD_EXTMOD),) -core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ +core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/ io_uring/ vmlinux-dirs := $(patsubst %/,%,$(filter %/, \ $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
arch/alpha/include/asm/thread_info.h +3 -1
@@ -62,6 +62,7 @@ register struct thread_info *__current_thread_info __asm__("$8");#define TIF_SIGPENDING 2/* signal pending */ #define TIF_NEED_RESCHED 3/* rescheduling necessary */ #define TIF_SYSCALL_AUDIT 4/* syscall audit active */ +#define TIF_NOTIFY_SIGNAL 5/* signal notifications exist */ #define TIF_DIE_IF_KERNEL 9/* dik recursion lock */ #define TIF_MEMDIE 13/* is terminating due to OOM killer */ #define TIF_POLLING_NRFLAG 14/* idle is polling for TIF_NEED_RESCHED */
@@ -71,11 +72,12 @@ register struct thread_info *__current_thread_info __asm__("$8");#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) +#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)/* Work to do on interrupt/exception return. */ #define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ - _TIF_NOTIFY_RESUME) + _TIF_NOTIFY_RESUME | _TIF_NOTIFY_SIGNAL)/* Work to do on any return to userspace. */ #define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
arch/alpha/kernel/entry.S +1 -1
@@ -544,7 +544,7 @@ $ret_success: .align 4 .type work_pending, @function work_pending: - and $17, _TIF_NOTIFY_RESUME | _TIF_SIGPENDING, $2 + and $17, _TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL, $2 bne $2, $work_notifysig $work_resched:
arch/alpha/kernel/process.c +1 -1
@@ -249,7 +249,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, childti->pcb.ksp = (unsigned long ) childstack; childti->pcb.flags =1 ;/* set FEN, clear everything else */ -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {/* kernel thread */ memset (childstack,0 ,sizeof (struct switch_stack ) +sizeof (struct pt_regs ));
arch/alpha/kernel/signal.c +1 -1
@@ -527,7 +527,7 @@ do_work_pending(struct pt_regs *regs, unsigned long thread_flags,schedule (); }else {local_irq_enable (); -if (thread_flags & _TIF_SIGPENDING) { +if (thread_flags & (_TIF_SIGPENDING|_TIF_NOTIFY_SIGNAL)) {do_signal (regs, r0, r19); r0 =0 ; }else {
arch/arc/include/asm/thread_info.h +3 -1
@@ -79,6 +79,7 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)#define TIF_SIGPENDING 2/* signal pending */ #define TIF_NEED_RESCHED 3/* rescheduling necessary */ #define TIF_SYSCALL_AUDIT 4/* syscall auditing active */ +#define TIF_NOTIFY_SIGNAL 5/* signal notifications exist */ #define TIF_SYSCALL_TRACE 15/* syscall trace active */ /* true if poll_idle() is polling TIF_NEED_RESCHED */
@@ -89,11 +90,12 @@ static inline __attribute_const__ struct thread_info *current_thread_info(void)#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) +#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)#define _TIF_MEMDIE (1<<TIF_MEMDIE)/* work to do on interrupt/exception return */ #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ - _TIF_NOTIFY_RESUME) + _TIF_NOTIFY_RESUME | _TIF_NOTIFY_SIGNAL)/* * _TIF_ALLWORK_MASK includes SYSCALL_TRACE, but we don't need it.
arch/arc/kernel/entry.S +2 -1
@@ -308,7 +308,8 @@ resume_user_mode_begin: mov r0, sp ; pt_regs for arg to do_signal()/do_notify_resume() GET_CURR_THR_INFO_FLAGS r9 - bbit0 r9, TIF_SIGPENDING, .Lchk_notify_resume + and.f 0, r9, _TIF_SIGPENDING|_TIF_NOTIFY_SIGNAL + bz .Lchk_notify_resume ; Normal Trap/IRQ entry only saves Scratch (caller-saved) regs ; in pt_reg since the "C" ABI (kernel code) will automatically
arch/arc/kernel/process.c +1 -1
@@ -191,7 +191,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, childksp[0 ] =0 ;/* fp */ childksp[1 ] = (unsigned long )ret_from_fork;/* blink */ -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (c_regs,0 ,sizeof (struct pt_regs )); c_callee->r13 = kthread_arg;
arch/arc/kernel/signal.c +1 -1
@@ -405,7 +405,7 @@ void do_signal(struct pt_regs *regs) restart_scall =in_syscall (regs) &&syscall_restartable (regs); -if (get_signal (&ksig)) { +if (test_thread_flag (TIF_SIGPENDING ) &&get_signal (&ksig)) {if (restart_scall) {arc_restart_syscall (&ksig.ka, regs);syscall_wont_restart (regs);/* No more restarts */
arch/arm/include/asm/thread_info.h +6 -1
@@ -126,6 +126,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp *,* thread information flags: * TIF_USEDFPU - FPU was used by this task this quantum (SMP) * TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED +* +* Any bit in the range of 0..15 will cause do_work_pending() to be invoked. */ #define TIF_SIGPENDING 0/* signal pending */ #define TIF_NEED_RESCHED 1/* rescheduling necessary */
@@ -135,6 +137,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *,#define TIF_SYSCALL_AUDIT 5/* syscall auditing active */ #define TIF_SYSCALL_TRACEPOINT 6/* syscall tracepoint instrumentation */ #define TIF_SECCOMP 7/* seccomp syscall filtering active */ +#define TIF_NOTIFY_SIGNAL 8/* signal notifications exist */ #define TIF_USING_IWMMXT 17#define TIF_MEMDIE 18/* is terminating due to OOM killer */
@@ -148,6 +151,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *,#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)#define _TIF_SECCOMP (1 << TIF_SECCOMP) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT)/* Checks for any syscall work in entry-common.S */
@@ -158,7 +162,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp *,* Change these and you break ASM code in entry-common.S */ #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ - _TIF_NOTIFY_RESUME | _TIF_UPROBE) + _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ + _TIF_NOTIFY_SIGNAL)#endif /* __KERNEL__ */ #endif /* __ASM_ARM_THREAD_INFO_H */
arch/arm/kernel/entry-common.S +3 -3
@@ -53,7 +53,7 @@ __ret_fast_syscall: cmp r2, #TASK_SIZE blne addr_limit_check_failed ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing - tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK + movs r1, r1, lsl #16 bne fast_work_pending
@@ -90,7 +90,7 @@ __ret_fast_syscall: cmp r2, #TASK_SIZE blne addr_limit_check_failed ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing - tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK + movs r1, r1, lsl #16 beq no_work_pending UNWIND(.fnend ) ENDPROC(ret_fast_syscall)
@@ -131,7 +131,7 @@ ENTRY(ret_to_user_from_irq) cmp r2, #TASK_SIZE blne addr_limit_check_failed ldr r1, [tsk, #TI_FLAGS] - tst r1, #_TIF_WORK_MASK + movs r1, r1, lsl #16 bne slow_work_pending no_work_pending: asm_trace_hardirqs_on save = 0
arch/arm/kernel/entry-v7m.S +1 -1
@@ -59,7 +59,7 @@ __irq_entry: get_thread_info tsk ldr r2, [tsk, #TI_FLAGS] - tst r2, #_TIF_WORK_MASK + movs r2, r2, lsl #16 beq 2f @ no work pending mov r0, #V7M_SCB_ICSR_PENDSVSET str r0, [r1, V7M_SCB_ICSR] @ raise PendSV
arch/arm/kernel/process.c +1 -1
@@ -243,7 +243,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start, thread->cpu_domain =get_domain ();#endif -if (likely (!(p->flags &PF_KTHREAD ))) { +if (likely (!(p->flags & (PF_KTHREAD |PF_IO_WORKER )))) { *childregs = *current_pt_regs (); childregs->ARM_r0 =0 ;if (stack_start)
arch/arm/kernel/signal.c +1 -1
@@ -655,7 +655,7 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)if (unlikely (!user_mode (regs)))return 0 ;local_irq_enable (); -if (thread_flags & _TIF_SIGPENDING) { +if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) {int restart =do_signal (regs, syscall);if (unlikely (restart)) {/*
arch/arm64/include/asm/thread_info.h +4 -1
@@ -68,6 +68,7 @@ void arch_release_task_struct(struct task_struct *tsk);#define TIF_UPROBE 4/* uprobe breakpoint or singlestep */ #define TIF_FSCHECK 5/* Check FS is USER_DS on return */ #define TIF_MTE_ASYNC_FAULT 6/* MTE Asynchronous Tag Check Fault */ +#define TIF_NOTIFY_SIGNAL 7/* signal notifications exist */ #define TIF_SYSCALL_TRACE 8/* syscall trace active */ #define TIF_SYSCALL_AUDIT 9/* syscall auditing */ #define TIF_SYSCALL_TRACEPOINT 10/* syscall tracepoint for ftrace */
@@ -98,10 +99,12 @@ void arch_release_task_struct(struct task_struct *tsk);#define _TIF_32BIT (1 << TIF_32BIT)#define _TIF_SVE (1 << TIF_SVE)#define _TIF_MTE_ASYNC_FAULT (1 << TIF_MTE_ASYNC_FAULT) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \ - _TIF_UPROBE | _TIF_FSCHECK | _TIF_MTE_ASYNC_FAULT) + _TIF_UPROBE | _TIF_FSCHECK | _TIF_MTE_ASYNC_FAULT | \ + _TIF_NOTIFY_SIGNAL)#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \
arch/arm64/kernel/process.c +1 -1
@@ -398,7 +398,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,ptrauth_thread_init_kernel (p); -if (likely (!(p->flags &PF_KTHREAD ))) { +if (likely (!(p->flags & (PF_KTHREAD |PF_IO_WORKER )))) { *childregs = *current_pt_regs (); childregs->regs[0 ] =0 ;
arch/arm64/kernel/signal.c +1 -1
@@ -938,7 +938,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, (void __user *)NULL, current); } -if (thread_flags & _TIF_SIGPENDING) +if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs);if (thread_flags & _TIF_NOTIFY_RESUME) {
arch/c6x/include/asm/thread_info.h +1 -0
@@ -82,6 +82,7 @@ struct thread_info *current_thread_info(void)#define TIF_SIGPENDING 2/* signal pending */ #define TIF_NEED_RESCHED 3/* rescheduling necessary */ #define TIF_RESTORE_SIGMASK 4/* restore signal mask in do_signal() */ +#define TIF_NOTIFY_SIGNAL 5/* signal notifications exist */ #define TIF_MEMDIE 17/* OOM killer killed process */
arch/c6x/kernel/asm-offsets.c +1 -0
@@ -116,6 +116,7 @@ void foo(void)DEFINE (_TIF_NOTIFY_RESUME, (1 <<TIF_NOTIFY_RESUME ));DEFINE (_TIF_SIGPENDING, (1 <<TIF_SIGPENDING ));DEFINE (_TIF_NEED_RESCHED, (1 <<TIF_NEED_RESCHED )); +DEFINE (_TIF_NOTIFY_SIGNAL, (1 <<TIF_NOTIFY_SIGNAL ));DEFINE (_TIF_ALLWORK_MASK,TIF_ALLWORK_MASK );DEFINE (_TIF_WORK_MASK,TIF_WORK_MASK );
arch/c6x/kernel/signal.c +2 -1
@@ -13,6 +13,7 @@#include <linux/syscalls.h> #include <linux/tracehook.h> +#include <asm/asm-offsets.h> #include <asm/ucontext.h> #include <asm/cacheflush.h>
@@ -313,7 +314,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags, int syscall) {/* deal with pending signal delivery */ -if (thread_info_flags & (1 <<TIF_SIGPENDING )) +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs, syscall);if (thread_info_flags & (1 <<TIF_NOTIFY_RESUME ))
arch/csky/include/asm/thread_info.h +4 -1
@@ -64,6 +64,7 @@ static inline struct thread_info *current_thread_info(void)#define TIF_SYSCALL_TRACE 4/* syscall trace active */ #define TIF_SYSCALL_TRACEPOINT 5/* syscall tracepoint instrumentation */ #define TIF_SYSCALL_AUDIT 6/* syscall auditing */ +#define TIF_NOTIFY_SIGNAL 7/* signal notifications exist */ #define TIF_POLLING_NRFLAG 16/* poll_idle() is TIF_NEED_RESCHED */ #define TIF_MEMDIE 18/* is terminating due to OOM killer */ #define TIF_RESTORE_SIGMASK 20/* restore signal mask in do_signal() */
@@ -75,6 +76,7 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_UPROBE (1 << TIF_UPROBE)#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)#define _TIF_MEMDIE (1 << TIF_MEMDIE)
@@ -82,7 +84,8 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_SECCOMP (1 << TIF_SECCOMP)#define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ - _TIF_NOTIFY_RESUME | _TIF_UPROBE) + _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ + _TIF_NOTIFY_SIGNAL)#define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP)
arch/csky/kernel/process.c +1 -1
@@ -49,7 +49,7 @@ int copy_thread(unsigned long clone_flags,/* setup thread.sp for switch_to !!! */ p->thread.sp = (unsigned long )childstack; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (childregs,0 ,sizeof (struct pt_regs )); childstack->r15 = (unsigned long ) ret_from_kernel_thread; childstack->r10 = kthread_arg;
arch/csky/kernel/signal.c +1 -1
@@ -261,7 +261,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,uprobe_notify_resume (regs);/* Handle pending signal delivery */ -if (thread_info_flags & _TIF_SIGPENDING) +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs);if (thread_info_flags & _TIF_NOTIFY_RESUME) {
arch/h8300/include/asm/thread_info.h +3 -1
@@ -73,6 +73,7 @@ static inline struct thread_info *current_thread_info(void)#define TIF_SYSCALL_AUDIT 7/* syscall auditing active */ #define TIF_SYSCALL_TRACEPOINT 8/* for ftrace syscall instrumentation */ #define TIF_POLLING_NRFLAG 9/* true if poll_idle() is polling TIF_NEED_RESCHED */ +#define TIF_NOTIFY_SIGNAL 10/* signal notifications exist */ /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
@@ -83,6 +84,7 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)/* work to do in syscall trace */ #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \
@@ -92,7 +94,7 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \ _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \ _TIF_SINGLESTEP | _TIF_NOTIFY_RESUME | \ - _TIF_SYSCALL_TRACEPOINT) + _TIF_SYSCALL_TRACEPOINT | _TIF_NOTIFY_SIGNAL)/* work to do on interrupt/exception return */ #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \
arch/h8300/kernel/process.c +1 -1
@@ -112,7 +112,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, childregs = (struct pt_regs *) (THREAD_SIZE +task_stack_page (p)) -1 ; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (childregs,0 ,sizeof (struct pt_regs )); childregs->retpc = (unsigned long ) ret_from_kernel_thread; childregs->er4 = topstk;/* arg */
arch/h8300/kernel/signal.c +1 -1
@@ -279,7 +279,7 @@ static void do_signal(struct pt_regs *regs) asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags) { -if (thread_info_flags & _TIF_SIGPENDING) +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs);if (thread_info_flags & _TIF_NOTIFY_RESUME)
arch/hexagon/include/asm/thread_info.h +2 -0
@@ -95,6 +95,7 @@ register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);#define TIF_NEED_RESCHED 3/* rescheduling necessary */ #define TIF_SINGLESTEP 4/* restore ss @ return to usr mode */ #define TIF_RESTORE_SIGMASK 6/* restore sig mask in do_signal() */ +#define TIF_NOTIFY_SIGNAL 7/* signal notifications exist */ /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_MEMDIE 17/* OOM killer killed process */
@@ -103,6 +104,7 @@ register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)/* work to do on interrupt/exception return - All but TIF_SYSCALL_TRACE */ #define _TIF_WORK_MASK (0x0000FFFF & ~_TIF_SYSCALL_TRACE)
arch/hexagon/kernel/process.c +2 -2
@@ -73,7 +73,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg, sizeof(*ss)); ss->lr = (unsigned long )ret_from_fork; p->thread.switch_sp = ss; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (childregs,0 ,sizeof (struct pt_regs ));/* r24 <- fn, r25 <- arg */ ss->r24 = usp;
@@ -174,7 +174,7 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)return 1 ; } -if (thread_info_flags & _TIF_SIGPENDING) { +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) {do_signal (regs);return 1 ; }
arch/ia64/include/asm/thread_info.h +3 -1
@@ -103,6 +103,7 @@ struct thread_info {#define TIF_SYSCALL_TRACE 2/* syscall trace active */ #define TIF_SYSCALL_AUDIT 3/* syscall auditing active */ #define TIF_SINGLESTEP 4/* restore singlestep on return to user mode */ +#define TIF_NOTIFY_SIGNAL 5/* signal notification exist */ #define TIF_NOTIFY_RESUME 6/* resumption notification requested */ #define TIF_MEMDIE 17/* is terminating due to OOM killer */ #define TIF_MCA_INIT 18/* this task is processing MCA or INIT */
@@ -115,6 +116,7 @@ struct thread_info {#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)#define _TIF_MCA_INIT (1 << TIF_MCA_INIT)
@@ -124,7 +126,7 @@ struct thread_info {/* "work to do on user-return" bits */ #define TIF_ALLWORK_MASK (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\ - _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE) + _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_NOTIFY_SIGNAL)/* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */ #define TIF_WORK_MASK (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))
arch/ia64/kernel/process.c +3 -2
@@ -171,7 +171,8 @@ do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long in_syscall) }/* deal with pending signal delivery */ -if (test_thread_flag (TIF_SIGPENDING )) { +if (test_thread_flag (TIF_SIGPENDING ) || +test_thread_flag (TIF_NOTIFY_SIGNAL )) {local_irq_enable ();/* force interrupt enable */ ia64_do_signal (scr, in_syscall); }
@@ -337,7 +338,7 @@ copy_thread(unsigned long clone_flags, unsigned long user_stack_base,ia64_drop_fpu (p);/* don't pick up stale state from a CPU's fph */ -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {if (unlikely (!user_stack_base)) {/* fork_idle() called us */ return 0 ;
arch/ia64/kernel/signal.c +2 -1
@@ -341,7 +341,8 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)* need to push through a forced SIGSEGV. */ while (1 ) { -get_signal (&ksig); +if (!get_signal (&ksig)) +break ;/* * get_signal() may have run a debugger (via notify_parent())
arch/m68k/include/asm/thread_info.h +1 -0
@@ -60,6 +60,7 @@ static inline struct thread_info *current_thread_info(void)* bits 0-7 are tested at every exception exit * bits 8-15 are also tested at syscall exit */ +#define TIF_NOTIFY_SIGNAL 4#define TIF_NOTIFY_RESUME 5/* callback before returning to user */ #define TIF_SIGPENDING 6/* signal pending */ #define TIF_NEED_RESCHED 7/* rescheduling necessary */
arch/m68k/kernel/process.c +1 -1
@@ -157,7 +157,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,*/ p->thread.fs =get_fs ().seg; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {/* kernel thread */ memset (frame,0 ,sizeof (struct fork_frame )); frame->regs.sr =PS_S ;
arch/m68k/kernel/signal.c +2 -1
@@ -1129,7 +1129,8 @@ static void do_signal(struct pt_regs *regs)void do_notify_resume (struct pt_regs *regs) { -if (test_thread_flag (TIF_SIGPENDING )) +if (test_thread_flag (TIF_NOTIFY_SIGNAL ) || +test_thread_flag (TIF_SIGPENDING ))do_signal (regs);if (test_thread_flag (TIF_NOTIFY_RESUME ))
arch/microblaze/include/asm/thread_info.h +2 -0
@@ -107,6 +107,7 @@ static inline struct thread_info *current_thread_info(void)#define TIF_NEED_RESCHED 3/* rescheduling necessary */ /* restore singlestep on return to user mode */ #define TIF_SINGLESTEP 4 +#define TIF_NOTIFY_SIGNAL 5/* signal notifications exist */ #define TIF_MEMDIE 6/* is terminating due to OOM killer */ #define TIF_SYSCALL_AUDIT 9/* syscall auditing active */ #define TIF_SECCOMP 10/* secure computing */
@@ -119,6 +120,7 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)#define _TIF_SECCOMP (1 << TIF_SECCOMP)
arch/microblaze/kernel/process.c +1 -1
@@ -59,7 +59,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,struct pt_regs *childregs =task_pt_regs (p);struct thread_info *ti =task_thread_info (p); -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {/* if we're creating a new kernel thread then just zeroing all * the registers. That's OK for a brand new thread.*/ memset (childregs,0 ,sizeof (struct pt_regs ));
arch/microblaze/kernel/signal.c +2 -1
@@ -313,7 +313,8 @@ static void do_signal(struct pt_regs *regs, int in_syscall) asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall) { -if (test_thread_flag (TIF_SIGPENDING )) +if (test_thread_flag (TIF_SIGPENDING ) || +test_thread_flag (TIF_NOTIFY_SIGNAL ))do_signal (regs, in_syscall);if (test_thread_flag (TIF_NOTIFY_RESUME ))
arch/mips/include/asm/thread_info.h +3 -1
@@ -115,6 +115,7 @@ static inline struct thread_info *current_thread_info(void)#define TIF_SECCOMP 4/* secure computing */ #define TIF_NOTIFY_RESUME 5/* callback before returning to user */ #define TIF_UPROBE 6/* breakpointed or singlestepping */ +#define TIF_NOTIFY_SIGNAL 7/* signal notifications exist */ #define TIF_RESTORE_SIGMASK 9/* restore signal mask in do_signal() */ #define TIF_USEDFPU 16/* FPU was used by this task this quantum (SMP) */ #define TIF_MEMDIE 18/* is terminating due to OOM killer */
@@ -139,6 +140,7 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_SECCOMP (1<<TIF_SECCOMP)#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)#define _TIF_UPROBE (1<<TIF_UPROBE) +#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)#define _TIF_USEDFPU (1<<TIF_USEDFPU)#define _TIF_NOHZ (1<<TIF_NOHZ)#define _TIF_FIXADE (1<<TIF_FIXADE)
@@ -164,7 +166,7 @@ static inline struct thread_info *current_thread_info(void)/* work to do on interrupt/exception return */ #define _TIF_WORK_MASK \ (_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_NOTIFY_RESUME | \ - _TIF_UPROBE) + _TIF_UPROBE | _TIF_NOTIFY_SIGNAL)/* work to do on any return to u-space */ #define _TIF_ALLWORK_MASK (_TIF_NOHZ | _TIF_WORK_MASK | \ _TIF_WORK_SYSCALL_EXIT | \
arch/mips/kernel/process.c +1 -1
@@ -135,7 +135,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,/* Put the stack after the struct pt_regs. */ childksp = (unsigned long ) childregs; p->thread.cp0_status = (read_c0_status () & ~(ST0_CU2 |ST0_CU1 )) |ST0_KERNEL_CUMASK ; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {/* kernel thread */ unsigned long status = p->thread.cp0_status;memset (childregs,0 ,sizeof (struct pt_regs ));
arch/mips/kernel/signal.c +1 -1
@@ -903,7 +903,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,uprobe_notify_resume (regs);/* deal with pending signal delivery */ -if (thread_info_flags & _TIF_SIGPENDING) +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs);if (thread_info_flags & _TIF_NOTIFY_RESUME) {
arch/nds32/include/asm/thread_info.h +2 -0
@@ -48,6 +48,7 @@ struct thread_info {#define TIF_NEED_RESCHED 2#define TIF_SINGLESTEP 3#define TIF_NOTIFY_RESUME 4/* callback before returning to user */ +#define TIF_NOTIFY_SIGNAL 5/* signal notifications exist */ #define TIF_SYSCALL_TRACE 8#define TIF_POLLING_NRFLAG 17#define TIF_MEMDIE 18
@@ -57,6 +58,7 @@ struct thread_info {#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
arch/nds32/kernel/ex-exit.S +1 -1
@@ -120,7 +120,7 @@ work_pending: andi $p1, $r1, #_TIF_NEED_RESCHED bnez $p1, work_resched - andi $p1, $r1, #_TIF_SIGPENDING|#_TIF_NOTIFY_RESUME + andi $p1, $r1, #_TIF_SIGPENDING|#_TIF_NOTIFY_RESUME|#_TIF_NOTIFY_SIGNAL beqz $p1, no_work_pending move $r0, $sp ! 'regs'
arch/nds32/kernel/process.c +1 -1
@@ -156,7 +156,7 @@ int copy_thread(unsigned long clone_flags, unsigned long stack_start,memset (&p->thread.cpu_context,0 ,sizeof (struct cpu_context )); -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (childregs,0 ,sizeof (struct pt_regs ));/* kernel thread fn */ p->thread.cpu_context.r6 = stack_start;
arch/nds32/kernel/signal.c +1 -1
@@ -376,7 +376,7 @@ static void do_signal(struct pt_regs *regs) asmlinkage voiddo_notify_resume (struct pt_regs *regs,unsigned int thread_flags) { -if (thread_flags & _TIF_SIGPENDING) +if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs);if (thread_flags & _TIF_NOTIFY_RESUME)
arch/nios2/include/asm/thread_info.h +2 -0
@@ -86,6 +86,7 @@ static inline struct thread_info *current_thread_info(void)#define TIF_MEMDIE 4/* is terminating due to OOM killer */ #define TIF_SECCOMP 5/* secure computing */ #define TIF_SYSCALL_AUDIT 6/* syscall auditing active */ +#define TIF_NOTIFY_SIGNAL 7/* signal notifications exist */ #define TIF_RESTORE_SIGMASK 9/* restore signal mask in do_signal() */ #define TIF_POLLING_NRFLAG 16/* true if poll_idle() is polling
@@ -97,6 +98,7 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)#define _TIF_SECCOMP (1 << TIF_SECCOMP)#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
arch/nios2/kernel/process.c +1 -1
@@ -109,7 +109,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,struct switch_stack *childstack = ((struct switch_stack *)childregs) -1 ; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (childstack,0 ,sizeof (struct switch_stack ) +sizeof (struct pt_regs ));
arch/nios2/kernel/signal.c +2 -1
@@ -309,7 +309,8 @@ asmlinkage int do_notify_resume(struct pt_regs *regs)if (!user_mode (regs))return 0 ; -if (test_thread_flag (TIF_SIGPENDING )) { +if (test_thread_flag (TIF_SIGPENDING ) || +test_thread_flag (TIF_NOTIFY_SIGNAL )) {int restart =do_signal (regs);if (unlikely (restart)) {
arch/openrisc/include/asm/thread_info.h +2 -0
@@ -98,6 +98,7 @@ register struct thread_info *current_thread_info_reg asm("r10");#define TIF_SINGLESTEP 4/* restore singlestep on return to user * mode */ +#define TIF_NOTIFY_SIGNAL 5/* signal notifications exist */ #define TIF_SYSCALL_TRACEPOINT 8/* for ftrace syscall instrumentation */ #define TIF_RESTORE_SIGMASK 9#define TIF_POLLING_NRFLAG 16/* true if poll_idle() is polling * TIF_NEED_RESCHED
@@ -109,6 +110,7 @@ register struct thread_info *current_thread_info_reg asm("r10");#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) +#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
arch/openrisc/kernel/process.c +1 -1
@@ -167,7 +167,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg, sp -=sizeof (struct pt_regs ); kregs = (struct pt_regs *)sp; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (kregs,0 ,sizeof (struct pt_regs )); kregs->gpr[20 ] = usp;/* fn, kernel thread */ kregs->gpr[22 ] = arg;
arch/openrisc/kernel/signal.c +1 -1
@@ -299,7 +299,7 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)if (unlikely (!user_mode (regs)))return 0 ;local_irq_enable (); -if (thread_flags & _TIF_SIGPENDING) { +if (thread_flags & (_TIF_SIGPENDING|_TIF_NOTIFY_SIGNAL)) {int restart =do_signal (regs, syscall);if (unlikely (restart)) {/*
arch/parisc/include/asm/thread_info.h +3 -1
@@ -52,6 +52,7 @@ struct thread_info {#define TIF_POLLING_NRFLAG 3/* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_32BIT 4/* 32 bit binary */ #define TIF_MEMDIE 5/* is terminating due to OOM killer */ +#define TIF_NOTIFY_SIGNAL 6/* signal notifications exist */ #define TIF_SYSCALL_AUDIT 7/* syscall auditing active */ #define TIF_NOTIFY_RESUME 8/* callback before returning to user */ #define TIF_SINGLESTEP 9/* single stepping? */
@@ -61,6 +62,7 @@ struct thread_info {#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)#define _TIF_32BIT (1 << TIF_32BIT)
@@ -72,7 +74,7 @@ struct thread_info {#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \ - _TIF_NEED_RESCHED) + _TIF_NEED_RESCHED | _TIF_NOTIFY_SIGNAL)#define _TIF_SYSCALL_TRACE_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ _TIF_BLOCKSTEP | _TIF_SYSCALL_AUDIT | \ _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
arch/parisc/kernel/process.c +1 -1
@@ -200,7 +200,7 @@ copy_thread(unsigned long clone_flags, unsigned long usp,extern void *const ret_from_kernel_thread;extern void *const child_return; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {/* kernel thread */ memset (cregs,0 ,sizeof (struct pt_regs ));if (!usp)/* idle thread */
arch/parisc/kernel/signal.c +2 -1
@@ -609,7 +609,8 @@ do_signal(struct pt_regs *regs, long in_syscall)void do_notify_resume (struct pt_regs *regs,long in_syscall) { -if (test_thread_flag (TIF_SIGPENDING )) +if (test_thread_flag (TIF_SIGPENDING ) || +test_thread_flag (TIF_NOTIFY_SIGNAL ))do_signal (regs, in_syscall);if (test_thread_flag (TIF_NOTIFY_RESUME ))
arch/powerpc/include/asm/thread_info.h +4 -1
@@ -96,6 +96,7 @@ void arch_setup_new_exec(void);#define TIF_SYSCALL_TRACE 0/* syscall trace active */ #define TIF_SIGPENDING 1/* signal pending */ #define TIF_NEED_RESCHED 2/* rescheduling necessary */ +#define TIF_NOTIFY_SIGNAL 3/* signal notifications exist */ #define TIF_SYSCALL_EMU 4/* syscall emulation active */ #define TIF_RESTORE_TM 5/* need to restore TM FP/VEC/VSX */ #define TIF_PATCH_PENDING 6/* pending live patching update */
@@ -121,6 +122,7 @@ void arch_setup_new_exec(void);#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) +#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)#define _TIF_32BIT (1<<TIF_32BIT)#define _TIF_RESTORE_TM (1<<TIF_RESTORE_TM)
@@ -142,7 +144,8 @@ void arch_setup_new_exec(void);#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ - _TIF_RESTORE_TM | _TIF_PATCH_PENDING) + _TIF_RESTORE_TM | _TIF_PATCH_PENDING | \ + _TIF_NOTIFY_SIGNAL)#define _TIF_PERSYSCALL_MASK (_TIF_RESTOREALL|_TIF_NOERROR)/* Bits in local_flags */
arch/powerpc/kernel/process.c +1 -1
@@ -1684,7 +1684,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,/* Copy registers */ sp -=sizeof (struct pt_regs ); childregs = (struct pt_regs *) sp; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {/* kernel thread */ memset (childregs,0 ,sizeof (struct pt_regs )); childregs->gpr[1 ] = sp +sizeof (struct pt_regs );
arch/powerpc/kernel/signal.c +1 -1
@@ -318,7 +318,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)if (thread_info_flags & _TIF_PATCH_PENDING)klp_update_patch_state (current); -if (thread_info_flags & _TIF_SIGPENDING) { +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) {BUG_ON (regs != current->thread.regs);do_signal (current); }
arch/riscv/include/asm/thread_info.h +4 -1
@@ -80,6 +80,7 @@ struct thread_info {#define TIF_SYSCALL_TRACEPOINT 6/* syscall tracepoint instrumentation */ #define TIF_SYSCALL_AUDIT 7/* syscall auditing */ #define TIF_SECCOMP 8/* syscall secure computing */ +#define TIF_NOTIFY_SIGNAL 9/* signal notifications exist */ #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
@@ -88,9 +89,11 @@ struct thread_info {#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)#define _TIF_SECCOMP (1 << TIF_SECCOMP) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_WORK_MASK \ - (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED) + (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED | \ + _TIF_NOTIFY_SIGNAL)#define _TIF_SYSCALL_WORK \ (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_TRACEPOINT | _TIF_SYSCALL_AUDIT | \
arch/riscv/kernel/process.c +1 -1
@@ -114,7 +114,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg,memset (&p->thread.s,0 ,sizeof (p->thread.s));/* p->thread holds context to be restored by __switch_to() */ -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {/* Kernel thread */ memset (childregs,0 ,sizeof (struct pt_regs )); childregs->gp = gp_in_global;
arch/riscv/kernel/signal.c +1 -1
@@ -312,7 +312,7 @@ asmlinkage __visible void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) {/* Handle pending signal delivery */ -if (thread_info_flags & _TIF_SIGPENDING) +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs);if (thread_info_flags & _TIF_NOTIFY_RESUME)
arch/s390/include/asm/thread_info.h +2 -0
@@ -65,6 +65,7 @@ void arch_setup_new_exec(void);#define TIF_GUARDED_STORAGE 4/* load guarded storage control block */ #define TIF_PATCH_PENDING 5/* pending live patching update */ #define TIF_PGSTE 6/* New mm's will use 4K page tables */ +#define TIF_NOTIFY_SIGNAL 7/* signal notifications exist */ #define TIF_ISOLATE_BP 8/* Run process with isolated BP */ #define TIF_ISOLATE_BP_GUEST 9/* Run KVM guests with isolated BP */
@@ -82,6 +83,7 @@ void arch_setup_new_exec(void);#define TIF_SYSCALL_TRACEPOINT 27/* syscall tracepoint instrumentation */ #define _TIF_NOTIFY_RESUME BIT(TIF_NOTIFY_RESUME) +#define _TIF_NOTIFY_SIGNAL BIT(TIF_NOTIFY_SIGNAL)#define _TIF_SIGPENDING BIT(TIF_SIGPENDING)#define _TIF_NEED_RESCHED BIT(TIF_NEED_RESCHED)#define _TIF_UPROBE BIT(TIF_UPROBE)
arch/s390/kernel/entry.S +6 -5
@@ -52,7 +52,8 @@ STACK_SIZE = 1 << STACK_SHIFT STACK_INIT = STACK_SIZE - STACK_FRAME_OVERHEAD - __PT_SIZE _TIF_WORK = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ - _TIF_UPROBE | _TIF_GUARDED_STORAGE | _TIF_PATCH_PENDING) + _TIF_UPROBE | _TIF_GUARDED_STORAGE | _TIF_PATCH_PENDING | \ + _TIF_NOTIFY_SIGNAL) _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ _TIF_SYSCALL_TRACEPOINT) _CIF_WORK = (_CIF_ASCE_PRIMARY | _CIF_ASCE_SECONDARY | _CIF_FPU)
@@ -481,8 +482,8 @@ ENTRY(system_call) #endif TSTMSK __PT_FLAGS(%r11),_PIF_SYSCALL_RESTART jo .Lsysc_syscall_restart - TSTMSK __TI_flags(%r12),_TIF_SIGPENDING - jo .Lsysc_sigpending + TSTMSK __TI_flags(%r12),(_TIF_SIGPENDING|_TIF_NOTIFY_SIGNAL) + jnz .Lsysc_sigpending TSTMSK __TI_flags(%r12),_TIF_NOTIFY_RESUME jo .Lsysc_notify_resume TSTMSK __LC_CPU_FLAGS,(_CIF_ASCE_PRIMARY|_CIF_ASCE_SECONDARY)
@@ -863,8 +864,8 @@ ENTRY(io_int_handler) TSTMSK __TI_flags(%r12),_TIF_PATCH_PENDING jo .Lio_patch_pending #endif - TSTMSK __TI_flags(%r12),_TIF_SIGPENDING - jo .Lio_sigpending + TSTMSK __TI_flags(%r12),(_TIF_SIGPENDING|_TIF_NOTIFY_SIGNAL) + jnz .Lio_sigpending TSTMSK __TI_flags(%r12),_TIF_NOTIFY_RESUME jo .Lio_notify_resume TSTMSK __TI_flags(%r12),_TIF_GUARDED_STORAGE
arch/s390/kernel/process.c +1 -1
@@ -127,7 +127,7 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp, frame->sf.gprs[9 ] = (unsigned long ) frame;/* Store access registers to kernel stack of new process. */ -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {/* kernel thread */ memset (&frame->childregs,0 ,sizeof (struct pt_regs )); frame->childregs.psw.mask = PSW_KERNEL_BITS | PSW_MASK_DAT |
arch/s390/kernel/signal.c +1 -1
@@ -472,7 +472,7 @@ void do_signal(struct pt_regs *regs) current->thread.system_call =test_pt_regs_flag (regs,PIF_SYSCALL ) ? regs->int_code :0 ; -if (get_signal (&ksig)) { +if (test_thread_flag (TIF_SIGPENDING ) &&get_signal (&ksig)) {/* Whee! Actually deliver the signal. */ if (current->thread.system_call) { regs->int_code = current->thread.system_call;
arch/sh/include/asm/thread_info.h +3 -1
@@ -105,6 +105,7 @@ extern void init_thread_xstate(void);#define TIF_SYSCALL_TRACE 0/* syscall trace active */ #define TIF_SIGPENDING 1/* signal pending */ #define TIF_NEED_RESCHED 2/* rescheduling necessary */ +#define TIF_NOTIFY_SIGNAL 3/* signal notifications exist */ #define TIF_SINGLESTEP 4/* singlestepping active */ #define TIF_SYSCALL_AUDIT 5/* syscall auditing active */ #define TIF_SECCOMP 6/* secure computing */
@@ -116,6 +117,7 @@ extern void init_thread_xstate(void);#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)#define _TIF_SECCOMP (1 << TIF_SECCOMP)
@@ -132,7 +134,7 @@ extern void init_thread_xstate(void);#define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \ _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \ _TIF_SINGLESTEP | _TIF_NOTIFY_RESUME | \ - _TIF_SYSCALL_TRACEPOINT) + _TIF_SYSCALL_TRACEPOINT | _TIF_NOTIFY_SIGNAL)/* work to do on interrupt/exception return */ #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \
arch/sh/kernel/process_32.c +1 -1
@@ -114,7 +114,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, unsigned long arg, childregs =task_pt_regs (p); p->thread.sp = (unsigned long ) childregs; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (childregs,0 ,sizeof (struct pt_regs )); p->thread.pc = (unsigned long ) ret_from_kernel_thread; childregs->regs[4 ] = arg;
arch/sh/kernel/signal_32.c +1 -1
@@ -499,7 +499,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, unsigned long thread_info_flags) {/* deal with pending signal delivery */ -if (thread_info_flags & _TIF_SIGPENDING) +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs, save_r0);if (thread_info_flags & _TIF_NOTIFY_RESUME)
arch/sparc/include/asm/thread_info_32.h +3 -1
@@ -104,6 +104,7 @@ register struct thread_info *current_thread_info_reg asm("g6");#define TIF_SIGPENDING 2/* signal pending */ #define TIF_NEED_RESCHED 3/* rescheduling necessary */ #define TIF_RESTORE_SIGMASK 4/* restore signal mask in do_signal() */ +#define TIF_NOTIFY_SIGNAL 5/* signal notifications exist */ #define TIF_USEDFPU 8/* FPU was used by this task * this quantum (SMP) */ #define TIF_POLLING_NRFLAG 9/* true if poll_idle() is polling
@@ -115,11 +116,12 @@ register struct thread_info *current_thread_info_reg asm("g6");#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) +#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)#define _TIF_USEDFPU (1<<TIF_USEDFPU)#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \ - _TIF_SIGPENDING) + _TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)#define is_32bit_task () (1)
arch/sparc/include/asm/thread_info_64.h +4 -2
@@ -180,7 +180,7 @@ extern struct thread_info *current_thread_info(void);#define TIF_NOTIFY_RESUME 1/* callback before returning to user */ #define TIF_SIGPENDING 2/* signal pending */ #define TIF_NEED_RESCHED 3/* rescheduling necessary */ -/* flag bit 4 is available */ +#define TIF_NOTIFY_SIGNAL 4/* signal notifications exist */ #define TIF_UNALIGNED 5/* allowed to do unaligned accesses */ #define TIF_UPROBE 6/* breakpointed or singlestepped */ #define TIF_32BIT 7/* 32-bit binary */
@@ -200,6 +200,7 @@ extern struct thread_info *current_thread_info(void);#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) +#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)#define _TIF_UNALIGNED (1<<TIF_UNALIGNED)#define _TIF_UPROBE (1<<TIF_UPROBE)#define _TIF_32BIT (1<<TIF_32BIT)
@@ -213,7 +214,8 @@ extern struct thread_info *current_thread_info(void); _TIF_DO_NOTIFY_RESUME_MASK | \ _TIF_NEED_RESCHED)#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \ - _TIF_SIGPENDING | _TIF_UPROBE) + _TIF_SIGPENDING | _TIF_UPROBE | \ + _TIF_NOTIFY_SIGNAL)#define is_32bit_task () (test_thread_flag(TIF_32BIT))
arch/sparc/kernel/process_32.c +1 -1
@@ -309,7 +309,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, ti->ksp = (unsigned long ) new_stack; p->thread.kregs = childregs; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {extern int nwindows;unsigned long psr;memset (new_stack,0 ,STACKFRAME_SZ +TRACEREG_SZ );
arch/sparc/kernel/process_64.c +1 -1
@@ -597,7 +597,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, sizeof(struct sparc_stackf)); t->fpsaved[0 ] =0 ; -if (unlikely (p->flags &PF_KTHREAD )) { +if (unlikely (p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {memset (child_trap_frame,0 , child_stack_sz);__thread_flag_byte_ptr (t)[TI_FLAG_BYTE_CWP ] = (current_pt_regs ()->tstate +1 ) &TSTATE_CWP ;
arch/sparc/kernel/signal_32.c +1 -1
@@ -521,7 +521,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)void do_notify_resume (struct pt_regs *regs,unsigned long orig_i0,unsigned long thread_info_flags) { -if (thread_info_flags & _TIF_SIGPENDING) +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs, orig_i0);if (thread_info_flags & _TIF_NOTIFY_RESUME)tracehook_notify_resume (regs);
arch/sparc/kernel/signal_64.c +1 -1
@@ -549,7 +549,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned longuser_exit ();if (thread_info_flags & _TIF_UPROBE)uprobe_notify_resume (regs); -if (thread_info_flags & _TIF_SIGPENDING) +if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))do_signal (regs, orig_i0);if (thread_info_flags & _TIF_NOTIFY_RESUME)tracehook_notify_resume (regs);
arch/um/include/asm/thread_info.h +2 -0
@@ -57,6 +57,7 @@ static inline struct thread_info *current_thread_info(void)#define TIF_SYSCALL_TRACE 0/* syscall trace active */ #define TIF_SIGPENDING 1/* signal pending */ #define TIF_NEED_RESCHED 2/* rescheduling necessary */ +#define TIF_NOTIFY_SIGNAL 3/* signal notifications exist */ #define TIF_RESTART_BLOCK 4#define TIF_MEMDIE 5/* is terminating due to OOM killer */ #define TIF_SYSCALL_AUDIT 6
@@ -68,6 +69,7 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_MEMDIE (1 << TIF_MEMDIE)#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)#define _TIF_SECCOMP (1 << TIF_SECCOMP)
arch/um/kernel/process.c +3 -2
@@ -99,7 +99,8 @@ void interrupt_end(void)if (need_resched ())schedule (); -if (test_thread_flag (TIF_SIGPENDING )) +if (test_thread_flag (TIF_SIGPENDING ) || +test_thread_flag (TIF_NOTIFY_SIGNAL ))do_signal (regs);if (test_thread_flag (TIF_NOTIFY_RESUME ))tracehook_notify_resume (regs);
@@ -156,7 +157,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, struct task_struct * p, unsigned long tls) { void (*handler)(void); -int kthread = current->flags &PF_KTHREAD ; +int kthread = current->flags & (PF_KTHREAD |PF_IO_WORKER );int ret =0 ; p->thread = (struct thread_struct )INIT_THREAD ;
arch/x86/include/asm/thread_info.h +2 -0
@@ -93,6 +93,7 @@ struct thread_info {#define TIF_NOTSC 16/* TSC is not accessible in userland */ #define TIF_IA32 17/* IA32 compatibility process */ #define TIF_SLD 18/* Restore split lock detection on context switch */ +#define TIF_NOTIFY_SIGNAL 19/* signal notifications exist */ #define TIF_MEMDIE 20/* is terminating due to OOM killer */ #define TIF_POLLING_NRFLAG 21/* idle is polling for TIF_NEED_RESCHED */ #define TIF_IO_BITMAP 22/* uses I/O bitmap */
@@ -121,6 +122,7 @@ struct thread_info {#define _TIF_NOCPUID (1 << TIF_NOCPUID)#define _TIF_NOTSC (1 << TIF_NOTSC)#define _TIF_IA32 (1 << TIF_IA32) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)#define _TIF_SLD (1 << TIF_SLD)#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)#define _TIF_IO_BITMAP (1 << TIF_IO_BITMAP)
arch/x86/kernel/process.c +17 -0
@@ -178,6 +178,23 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg,task_user_gs (p) =get_user_gs (current_pt_regs ());#endif +if (unlikely (p->flags &PF_IO_WORKER )) { +/* +* An IO thread is a user space thread, but it doesn't +* return to ret_after_fork(). +* +* In order to indicate that to tools like gdb, +* we reset the stack and instruction pointers. +* +* It does the same kernel frame setup to return to a kernel +* function that a kernel thread does. +*/ + childregs->sp =0 ; + childregs->ip =0 ; +kthread_frame_init (frame, sp, arg); +return 0 ; + } +/* Set a new TLS for the child thread? */ if (clone_flags &CLONE_SETTLS ) ret =set_new_tls (p, tls);
arch/x86/kernel/signal.c +2 -2
@@ -798,11 +798,11 @@ static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs)* want to handle. Thus you cannot kill init even with a SIGKILL even by * mistake. */ -void arch_do_signal (struct pt_regs *regs) +void arch_do_signal_or_restart (struct pt_regs *regs,bool has_signal) {struct ksignal ksig; -if (get_signal (&ksig)) { +if (has_signal &&get_signal (&ksig)) {/* Whee! Actually deliver the signal. */ handle_signal (&ksig, regs);return ;
arch/xtensa/include/asm/thread_info.h +4 -1
@@ -111,18 +111,21 @@ static inline struct thread_info *current_thread_info(void)#define TIF_NEED_RESCHED 2/* rescheduling necessary */ #define TIF_SINGLESTEP 3/* restore singlestep on return to user mode */ #define TIF_SYSCALL_TRACEPOINT 4/* syscall tracepoint instrumentation */ -#define TIF_MEMDIE 5/* is terminating due to OOM killer */ +#define TIF_NOTIFY_SIGNAL 5/* signal notifications exist */ #define TIF_RESTORE_SIGMASK 6/* restore signal mask in do_signal() */ #define TIF_NOTIFY_RESUME 7/* callback before returning to user */ #define TIF_DB_DISABLED 8/* debug trap disabled for syscall */ #define TIF_SYSCALL_AUDIT 9/* syscall auditing active */ #define TIF_SECCOMP 10/* secure computing */ +#define TIF_MEMDIE 11/* is terminating due to OOM killer */ #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT) +#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL) +#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)#define _TIF_SECCOMP (1<<TIF_SECCOMP)
arch/xtensa/kernel/entry.S +2 -2
@@ -500,8 +500,8 @@ common_exception_return: */ _bbsi.l a4, TIF_NEED_RESCHED, 3f - _bbsi.l a4, TIF_NOTIFY_RESUME, 2f - _bbci.l a4, TIF_SIGPENDING, 5f + movi a2, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NOTIFY_SIGNAL + bnone a4, a2, 5f 2: l32i a4, a1, PT_DEPC bgeui a4, VALID_DOUBLE_EXCEPTION_ADDRESS, 4f
arch/xtensa/kernel/process.c +1 -1
@@ -217,7 +217,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn, p->thread.sp = (unsigned long )childregs; -if (!(p->flags &PF_KTHREAD )) { +if (!(p->flags & (PF_KTHREAD |PF_IO_WORKER ))) {struct pt_regs *regs =current_pt_regs ();unsigned long usp = usp_thread_fn ? usp_thread_fn : regs->areg[1 ];
arch/xtensa/kernel/signal.c +2 -1
@@ -498,7 +498,8 @@ static void do_signal(struct pt_regs *regs)void do_notify_resume (struct pt_regs *regs) { -if (test_thread_flag (TIF_SIGPENDING )) +if (test_thread_flag (TIF_SIGPENDING ) || +test_thread_flag (TIF_NOTIFY_SIGNAL ))do_signal (regs);if (test_thread_flag (TIF_NOTIFY_RESUME ))
drivers/android/binder.c +1 -1
@@ -2255,7 +2255,7 @@ static void binder_deferred_fd_close(int fd)if (!twcb)return ;init_task_work (&twcb->twork, binder_do_fd_close); -__close_fd_get_file (fd, &twcb->file); +close_fd_get_file (fd, &twcb->file);if (twcb->file) {filp_close (twcb->file, current->files);task_work_add (current, &twcb->twork,TWA_RESUME );
fs/Makefile +0 -2
@@ -32,8 +32,6 @@ obj-$(CONFIG_TIMERFD) += timerfd.o obj-$(CONFIG_EVENTFD) += eventfd.o obj-$(CONFIG_USERFAULTFD) += userfaultfd.o obj-$(CONFIG_AIO) += aio.o -obj-$(CONFIG_IO_URING) += io_uring.o -obj-$(CONFIG_IO_WQ) += io-wq.o obj-$(CONFIG_FS_DAX) += dax.o obj-$(CONFIG_FS_ENCRYPTION) += crypto/ obj-$(CONFIG_FS_VERITY) += verity/
fs/coredump.c +1 -1
@@ -523,7 +523,7 @@ static bool dump_interrupted(void)* but then we need to teach dump_write() to restart and clear * TIF_SIGPENDING. */ -return signal_pending (current); +return fatal_signal_pending (current) ||freezing (current); }static void wait_for_dump_helpers (struct file *file)
fs/eventfd.c +21 -16
@@ -45,21 +45,7 @@ struct eventfd_ctx {int id; }; -/** -* eventfd_signal - Adds @n to the eventfd counter. -* @ctx: [in] Pointer to the eventfd context. -* @n: [in] Value of the counter to be added to the eventfd internal counter. -* The value cannot be negative. -* -* This function is supposed to be called by the kernel in paths that do not -* allow sleeping. In this function we allow the counter to reach the ULLONG_MAX -* value, and we signal this as overflow condition by returning a EPOLLERR -* to poll(2). -* -* Returns the amount by which the counter was incremented. This will be less -* than @n if the counter has overflowed. -*/ -__u64 eventfd_signal (struct eventfd_ctx *ctx,__u64 n) +__u64 eventfd_signal_mask (struct eventfd_ctx *ctx,__u64 n,unsigned mask) {unsigned long flags;
@@ -80,12 +66,31 @@ __u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n) n =ULLONG_MAX - ctx->count; ctx->count += n;if (waitqueue_active (&ctx->wqh)) -wake_up_locked_poll (&ctx->wqh,EPOLLIN ); +wake_up_locked_poll (&ctx->wqh,EPOLLIN | mask);this_cpu_dec (eventfd_wake_count);spin_unlock_irqrestore (&ctx->wqh.lock, flags);return n; } + +/** +* eventfd_signal - Adds @n to the eventfd counter. +* @ctx: [in] Pointer to the eventfd context. +* @n: [in] Value of the counter to be added to the eventfd internal counter. +* The value cannot be negative. +* +* This function is supposed to be called by the kernel in paths that do not +* allow sleeping. In this function we allow the counter to reach the ULLONG_MAX +* value, and we signal this as overflow condition by returning a EPOLLERR +* to poll(2). +* +* Returns the amount by which the counter was incremented. This will be less +* than @n if the counter has overflowed. +*/ +__u64 eventfd_signal (struct eventfd_ctx *ctx,__u64 n) +{ +return eventfd_signal_mask (ctx, n,0 ); +}EXPORT_SYMBOL_GPL (eventfd_signal);static void eventfd_free_ctx (struct eventfd_ctx *ctx)
fs/eventpoll.c +10 -8
@@ -548,7 +548,8 @@ static int ep_call_nested(struct nested_calls *ncalls,*/ #ifdef CONFIG_DEBUG_LOCK_ALLOC -static void ep_poll_safewake (struct eventpoll *ep,struct epitem *epi) +static void ep_poll_safewake (struct eventpoll *ep,struct epitem *epi, +unsigned pollflags) {struct eventpoll *ep_src;unsigned long flags;
@@ -579,16 +580,17 @@ static void ep_poll_safewake(struct eventpoll *ep, struct epitem *epi) }spin_lock_irqsave_nested (&ep->poll_wait.lock, flags, nests); ep->nests = nests +1 ; -wake_up_locked_poll (&ep->poll_wait,EPOLLIN ); +wake_up_locked_poll (&ep->poll_wait,EPOLLIN | pollflags); ep->nests =0 ;spin_unlock_irqrestore (&ep->poll_wait.lock, flags); }#else -static void ep_poll_safewake (struct eventpoll *ep,struct epitem *epi) +static void ep_poll_safewake (struct eventpoll *ep,struct epitem *epi, +unsigned pollflags) { -wake_up_poll (&ep->poll_wait,EPOLLIN ); +wake_up_poll (&ep->poll_wait,EPOLLIN | pollflags); }#endif
@@ -815,7 +817,7 @@ static void ep_free(struct eventpoll *ep)/* We need to release all tasks waiting for these file */ if (waitqueue_active (&ep->poll_wait)) -ep_poll_safewake (ep,NULL ); +ep_poll_safewake (ep,NULL ,0 );/* * We need to lock this because we could be hit by
@@ -1284,7 +1286,7 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v/* We have to call this outside the lock */ if (pwake) -ep_poll_safewake (ep, epi); +ep_poll_safewake (ep, epi, pollflags &EPOLL_URING_WAKE );if (!(epi->event.events &EPOLLEXCLUSIVE )) ewake =1 ;
@@ -1589,7 +1591,7 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,/* We have to call this outside the lock */ if (pwake) -ep_poll_safewake (ep,NULL ); +ep_poll_safewake (ep,NULL ,0 );return 0 ;
@@ -1692,7 +1694,7 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi,/* We have to call this outside the lock */ if (pwake) -ep_poll_safewake (ep,NULL ); +ep_poll_safewake (ep,NULL ,0 );return 0 ; }
fs/file.c +24 -10
@@ -22,6 +22,8 @@#include <linux/close_range.h> #include <net/sock.h> +#include "internal.h" +unsigned int sysctl_nr_open__read_mostly =1024 *1024 ;unsigned int sysctl_nr_open_min =BITS_PER_LONG ;/* our min() is unusable in constant expressions ;-/ */
@@ -780,9 +782,8 @@ int __close_range(unsigned fd, unsigned max_fd, unsigned int flags) }/* -* variant of __close_fd that gets a ref on the file for later fput. -* The caller must ensure that filp_close() called on the file, and then -* an fput(). +* See close_fd_get_file() below, this variant assumes current->files->file_lock +* is held. */ int __close_fd_get_file (unsigned int fd,struct file **res) {
@@ -790,26 +791,39 @@ int __close_fd_get_file(unsigned int fd, struct file **res)struct file *file;struct fdtable *fdt; -spin_lock (&files->file_lock); fdt =files_fdtable (files);if (fd >= fdt->max_fds) - goto out_unlock; + goto out_err; file = fdt->fd[fd];if (!file) - goto out_unlock; + goto out_err;rcu_assign_pointer (fdt->fd[fd],NULL );__put_unused_fd (files, fd); -spin_unlock (&files->file_lock);get_file (file); *res = file;return 0 ; - -out_unlock: -spin_unlock (&files->file_lock); +out_err: *res =NULL ;return -ENOENT ; } +/* +* variant of close_fd that gets a ref on the file for later fput. +* The caller must ensure that filp_close() called on the file, and then +* an fput(). +*/ +int close_fd_get_file (unsigned int fd,struct file **res) +{ +struct files_struct *files = current->files; +int ret; + +spin_lock (&files->file_lock); + ret =__close_fd_get_file (fd, res); +spin_unlock (&files->file_lock); + +return ret; +} +void do_close_on_exec (struct files_struct *files) {unsigned i;
fs/internal.h +3 -0
@@ -77,6 +77,8 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *,long do_rmdir (int dfd,struct filename *name);long do_unlinkat (int dfd,struct filename *name);int may_linkat (struct path *link); +int do_renameat2 (int olddfd,struct filename *oldname,int newdfd, +struct filename *newname,unsigned int flags);/* * namespace.c
@@ -132,6 +134,7 @@ extern struct file *do_file_open_root(struct dentry *, struct vfsmount *, const char *, const struct open_flags *);extern struct open_how build_open_how (int flags,umode_t mode);extern int build_open_flags (const struct open_how *how,struct open_flags *op); +extern int __close_fd_get_file (unsigned int fd,struct file **res);long do_sys_ftruncate (unsigned int fd,loff_t length,int small);int chmod_common (const struct path *path,umode_t mode);
fs/io-wq.c deleted +0 -1242
1,242 lines not on this page · raw message
fs/io-wq.h deleted +0 -157
157 lines not on this page · raw message
fs/io_uring.c deleted +0 -9971
370 lines not on this page · raw message
fs/namei.c +50 -34
84 lines not on this page · raw message
include/linux/io_uring.h +8 -38
46 lines not on this page · raw message
include/trace/events/io_uring.h +79 -42
121 lines not on this page · raw message
include/uapi/linux/io_uring.h +100 -15
115 lines not on this page · raw message
io_uring/io-wq.c new file +1398 -0
1,398 lines not on this page · raw message
io_uring/io-wq.h new file +160 -0
160 lines not on this page · raw message
io_uring/io_uring.c new file +10958 -0
10,958 lines not on this page · raw message
kernel/signal.c +28 -25
53 lines not on this page · raw message
kernel/task_work.c +29 -19
48 lines not on this page · raw message
lib/iov_iter.c +33 -19
52 lines not on this page · raw message
net/socket.c +48 -44
92 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.10.162 kernel.
All users of the 5.10 kernel series must upgrade.
The updated 5.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 4 arch/alpha/include/asm/thread_info.h | 4 arch/alpha/kernel/entry.S | 2 arch/alpha/kernel/process.c | 2 arch/alpha/kernel/signal.c | 2 arch/arc/include/asm/thread_info.h | 4 arch/arc/kernel/entry.S | 3 arch/arc/kernel/process.c | 2 arch/arc/kernel/signal.c | 2 arch/arm/include/asm/thread_info.h | 7 arch/arm/kernel/entry-common.S | 6 arch/arm/kernel/entry-v7m.S | 2 arch/arm/kernel/process.c | 2 arch/arm/kernel/signal.c | 2 arch/arm64/include/asm/thread_info.h | 5 arch/arm64/kernel/process.c | 2 arch/arm64/kernel/signal.c | 2 arch/c6x/include/asm/thread_info.h | 1 arch/c6x/kernel/asm-offsets.c | 1 arch/c6x/kernel/signal.c | 3 arch/csky/include/asm/thread_info.h | 5 arch/csky/kernel/process.c | 2 arch/csky/kernel/signal.c | 2 arch/h8300/include/asm/thread_info.h | 4 arch/h8300/kernel/process.c | 2 arch/h8300/kernel/signal.c | 2 arch/hexagon/include/asm/thread_info.h | 2 arch/hexagon/kernel/process.c | 4 arch/ia64/include/asm/thread_info.h | 4 arch/ia64/kernel/process.c | 5 arch/ia64/kernel/signal.c | 3 arch/m68k/include/asm/thread_info.h | 1 arch/m68k/kernel/process.c | 2 arch/m68k/kernel/signal.c | 3 arch/microblaze/include/asm/thread_info.h | 2 arch/microblaze/kernel/process.c | 2 arch/microblaze/kernel/signal.c | 3 arch/mips/include/asm/thread_info.h | 4 arch/mips/kernel/process.c | 2 arch/mips/kernel/signal.c | 2 arch/nds32/include/asm/thread_info.h | 2 arch/nds32/kernel/ex-exit.S | 2 arch/nds32/kernel/process.c | 2 arch/nds32/kernel/signal.c | 2 arch/nios2/include/asm/thread_info.h | 2 arch/nios2/kernel/process.c | 2 arch/nios2/kernel/signal.c | 3 arch/openrisc/include/asm/thread_info.h | 2 arch/openrisc/kernel/process.c | 2 arch/openrisc/kernel/signal.c | 2 arch/parisc/include/asm/thread_info.h | 4 arch/parisc/kernel/process.c | 2 arch/parisc/kernel/signal.c | 3 arch/powerpc/include/asm/thread_info.h | 5 arch/powerpc/kernel/process.c | 2 arch/powerpc/kernel/signal.c | 2 arch/riscv/include/asm/thread_info.h | 5 arch/riscv/kernel/process.c | 2 arch/riscv/kernel/signal.c | 2 arch/s390/include/asm/thread_info.h | 2 arch/s390/kernel/entry.S | 11 arch/s390/kernel/process.c | 2 arch/s390/kernel/signal.c | 2 arch/sh/include/asm/thread_info.h | 4 arch/sh/kernel/process_32.c | 2 arch/sh/kernel/signal_32.c | 2 arch/sparc/include/asm/thread_info_32.h | 4 arch/sparc/include/asm/thread_info_64.h | 6 arch/sparc/kernel/process_32.c | 2 arch/sparc/kernel/process_64.c | 2 arch/sparc/kernel/signal_32.c | 2 arch/sparc/kernel/signal_64.c | 2 arch/um/include/asm/thread_info.h | 2 arch/um/kernel/process.c | 5 arch/x86/include/asm/thread_info.h | 2 arch/x86/kernel/process.c | 17 arch/x86/kernel/signal.c | 4 arch/xtensa/include/asm/thread_info.h | 5 arch/xtensa/kernel/entry.S | 4 arch/xtensa/kernel/process.c | 2 arch/xtensa/kernel/signal.c | 3 drivers/android/binder.c | 2 fs/Makefile | 2 fs/coredump.c | 2 fs/eventfd.c | 37 fs/eventpoll.c | 18 fs/file.c | 34 fs/internal.h | 3 fs/io-wq.c | 1242 --- fs/io-wq.h | 157 fs/io_uring.c | 9971 --------------------------- fs/namei.c | 84 fs/open.c | 6 fs/proc/self.c | 7 fs/proc/thread_self.c | 7 include/linux/entry-common.h | 7 include/linux/entry-kvm.h | 4 include/linux/eventfd.h | 7 include/linux/fcntl.h | 2 include/linux/fdtable.h | 2 include/linux/io_uring.h | 46 include/linux/namei.h | 1 include/linux/net.h | 3 include/linux/sched.h | 3 include/linux/sched/jobctl.h | 4 include/linux/sched/signal.h | 18 include/linux/sched/task.h | 2 include/linux/socket.h | 4 include/linux/syscalls.h | 2 include/linux/task_work.h | 2 include/linux/tracehook.h | 23 include/linux/uio.h | 15 include/trace/events/io_uring.h | 121 include/uapi/linux/eventpoll.h | 6 include/uapi/linux/io_uring.h | 115 include/uapi/linux/openat2.h | 4 io_uring/Makefile | 6 io_uring/io-wq.c | 1398 +++ io_uring/io-wq.h | 160 io_uring/io_uring.c |10958 ++++++++++++++++++++++++++++++ kernel/entry/common.c | 14 kernel/entry/kvm.c | 2 kernel/events/uprobes.c | 2 kernel/exit.c | 2 kernel/fork.c | 33 kernel/sched/core.c | 2 kernel/signal.c | 53 kernel/task_work.c | 48 lib/iov_iter.c | 52 net/ipv4/af_inet.c | 1 net/ipv6/af_inet6.c | 1 net/socket.c | 92 tools/include/uapi/linux/openat2.h | 4 133 files changed, 13273 insertions(+), 11767 deletions(-)
Al Viro (4):
saner calling conventions for unlazy_child()
fix handling of nd->depth on LOOKUP_CACHED failures in try_to_unlazy* Make sure nd->path.mnt and nd->path.dentry are always valid pointers
alpha: fix TIF_NOTIFY_SIGNAL handling
Arnaldo Carvalho de Melo (1):
tools headers UAPI: Sync openat2.h with the kernel sources
Eric W. Biederman (2):
file: Rename __close_fd_get_file close_fd_get_file
coredump: Limit what can interrupt coredumps
Greg Kroah-Hartman (1):
Linux 5.10.162
Jens Axboe (52):
kernel: provide create_io_thread() helper
iov_iter: add helper to save iov_iter state
fs: add support for LOOKUP_CACHED
fs: expose LOOKUP_CACHED through openat2() RESOLVE_CACHED
net: provide __sys_shutdown_sock() that takes a socket
signal: Add task_sigpending() helper
fs: make do_renameat2() take struct filename
fs: provide locked helper variant of close_fd_get_file()
entry: Add support for TIF_NOTIFY_SIGNAL
task_work: Use TIF_NOTIFY_SIGNAL if available
x86: Wire up TIF_NOTIFY_SIGNAL
arc: add support for TIF_NOTIFY_SIGNAL
arm64: add support for TIF_NOTIFY_SIGNAL
m68k: add support for TIF_NOTIFY_SIGNAL
nios32: add support for TIF_NOTIFY_SIGNAL
parisc: add support for TIF_NOTIFY_SIGNAL
powerpc: add support for TIF_NOTIFY_SIGNAL
mips: add support for TIF_NOTIFY_SIGNAL
s390: add support for TIF_NOTIFY_SIGNAL
um: add support for TIF_NOTIFY_SIGNAL
sh: add support for TIF_NOTIFY_SIGNAL
openrisc: add support for TIF_NOTIFY_SIGNAL
csky: add support for TIF_NOTIFY_SIGNAL
hexagon: add support for TIF_NOTIFY_SIGNAL
microblaze: add support for TIF_NOTIFY_SIGNAL
arm: add support for TIF_NOTIFY_SIGNAL
xtensa: add support for TIF_NOTIFY_SIGNAL
alpha: add support for TIF_NOTIFY_SIGNAL
c6x: add support for TIF_NOTIFY_SIGNAL
h8300: add support for TIF_NOTIFY_SIGNAL
ia64: add support for TIF_NOTIFY_SIGNAL
nds32: add support for TIF_NOTIFY_SIGNAL
riscv: add support for TIF_NOTIFY_SIGNAL
sparc: add support for TIF_NOTIFY_SIGNAL
ia64: don't call handle_signal() unless there's actually a signal queued
task_work: remove legacy TWA_SIGNAL path
kernel: remove checking for TIF_NOTIFY_SIGNAL
kernel: allow fork with TIF_NOTIFY_SIGNAL pending
arch: setup PF_IO_WORKER threads like PF_KTHREAD
arch: ensure parisc/powerpc handle PF_IO_WORKER in copy_thread()
kernel: stop masking signals in create_io_thread()
kernel: don't call do_exit() for PF_IO_WORKER threads
task_work: add helper for more targeted task_work canceling
io_uring: import 5.15-stable io_uring
signal: kill JOBCTL_TASK_WORK
task_work: unconditionally run task_work from get_signal()
net: remove cmsg restriction from io_uring based send/recvmsg calls Revert "proc: don't allow async path resolution of /proc/thread-self components" Revert "proc: don't allow async path resolution of /proc/self components"
eventpoll: add EPOLL_URING_WAKE poll wakeup flag
eventfd: provide a eventfd_signal_mask() helper
io_uring: pass in EPOLL_URING_WAKE for eventfd signaling and wakeups
Pavel Begunkov (1):
net: add accept helper not installing fd
Seth Forshee (1):
entry/kvm: Exit to user mode when TIF_NOTIFY_SIGNAL is set
Stefan Metzmacher (1):
x86/process: setup io_threads more like normal user space threads
Vineet Gupta (1):
ARC: unbork 5.11 bootup: fix snafu in _TIF_NOTIFY_SIGNAL handling