+15
−10
Loading
Sunway inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8CCR7 -------------------------------- If syscall has completed successfully but r0 happens to be equal to one of ERESTART* codes, the syscall restart logic would be triggered incorrectly. To fix this, use syscall_get_error() to make sure we are using an errno, not return value. SW64 has a equivalent of arm bug fixed by commit 653d48b2 ("arm: fix really nasty sigreturn bug"). If signal gets caught by an interrupt that hits when we have the right value in r0 (513) and r19 (1), *and* another signal gets delivered upon sigreturn() or rt_sigreturn() (e.g. included into the blocked mask for the first signal and posted while the handler had been running), the syscall restart logic will see regs->orig_r0 not equal to NO_SYSCALL (we are in a syscall, after all), and r0 and r19 already restored to its original value (513 and 1, which happens to indicate -ERESTARTNOINTR) and assume that we need to apply the usual syscall restart logics. To fix this, call force_successful_syscall_return() in sigreturn() and rt_sigreturn() so the syscall restart logic will not know we are in a syscall. Signed-off-by:Mao Minkai <maominkai@wxiat.com> Reviewed-by:
He Sheng <hesheng@wxiat.com> Signed-off-by:
Gu Zitao <guzitao@wxiat.com>