• [PATCH 1/1] s390/signal: fix endless loop in do_signal

    From Sumanth Korikkar@21:1/5 to All on Wed Feb 15 13:30:01 2023
    XPost: linux.debian.ports.s390

    No upstream commit exists.

    Thread flag is set to TIF_NOTIFY_SIGNAL for io_uring work. The io work
    user or syscall calls do_signal when either one of the TIF_SIGPENDING or TIF_NOTIFY_SIGNAL flag is set. However, do_signal does consider only TIF_SIGPENDING signal and ignores TIF_NOTIFY_SIGNAL condition. This
    means get_signal is never invoked for TIF_NOTIFY_SIGNAL and hence the
    flag is not cleared, which results in an endless do_signal loop.

    Reference: 'commit 788d0824269b ("io_uring: import 5.15-stable io_uring")' Fixes: 75309018a24d ("s390: add support for TIF_NOTIFY_SIGNAL")
    Cc: stable@vger.kernel.org # 5.10.162
    Acked-by: Heiko Carstens <hca@linux.ibm.com>
    Acked-by: Sven Schnelle <svens@linux.ibm.com>
    Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
    ---
    arch/s390/kernel/signal.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
    index b27b6c1f058d..9e900a8977bd 100644
    --- a/arch/s390/kernel/signal.c
    +++ b/arch/s390/kernel/signal.c
    @@ -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 (test_thread_flag(TIF_SIGPENDING) && get_signal(&ksig)) {
    + if (get_signal(&ksig)) {
    /* Whee! Actually deliver the signal. */
    if (current->thread.system_call) {
    regs->int_code = current->thread.system_call;
    --
    2.37.2

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg KH@21:1/5 to Sumanth Korikkar on Wed Feb 15 15:00:01 2023
    XPost: linux.debian.ports.s390

    On Wed, Feb 15, 2023 at 01:04:13PM +0100, Sumanth Korikkar wrote:
    No upstream commit exists.

    Why not? Please explain how this was fixed in Linus's tree and why we
    can't take the same change here as well.

    thanks,

    greg k-h

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)