Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fix from Ingo Molnar:
"Fix x86 syscall exit code bug that resulted in spurious non-execution
of TIF-driven user-return worklets, causing big trouble for things
like KVM that rely on user notifiers for correctness of their vcpu
model, causing crashes like double faults"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/asm/entry: Check for syscall exit work with IRQs disabled

+14 -4
+14 -4
arch/x86/kernel/entry_64.S
··· 364 364 * Has incomplete stack frame and undefined top of stack. 365 365 */ 366 366 ret_from_sys_call: 367 - testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) 368 - jnz int_ret_from_sys_call_fixup /* Go the the slow path */ 369 - 370 367 LOCKDEP_SYS_EXIT 371 368 DISABLE_INTERRUPTS(CLBR_NONE) 372 369 TRACE_IRQS_OFF 370 + 371 + /* 372 + * We must check ti flags with interrupts (or at least preemption) 373 + * off because we must *never* return to userspace without 374 + * processing exit work that is enqueued if we're preempted here. 375 + * In particular, returning to userspace with any of the one-shot 376 + * flags (TIF_NOTIFY_RESUME, TIF_USER_RETURN_NOTIFY, etc) set is 377 + * very bad. 378 + */ 379 + testl $_TIF_ALLWORK_MASK,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) 380 + jnz int_ret_from_sys_call_fixup /* Go the the slow path */ 381 + 373 382 CFI_REMEMBER_STATE 374 383 /* 375 384 * sysretq will re-enable interrupts: ··· 395 386 396 387 int_ret_from_sys_call_fixup: 397 388 FIXUP_TOP_OF_STACK %r11, -ARGOFFSET 398 - jmp int_ret_from_sys_call 389 + jmp int_ret_from_sys_call_irqs_off 399 390 400 391 /* Do syscall tracing */ 401 392 tracesys: ··· 441 432 GLOBAL(int_ret_from_sys_call) 442 433 DISABLE_INTERRUPTS(CLBR_NONE) 443 434 TRACE_IRQS_OFF 435 + int_ret_from_sys_call_irqs_off: 444 436 movl $_TIF_ALLWORK_MASK,%edi 445 437 /* edi: mask to check */ 446 438 GLOBAL(int_with_check)