Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2409274rdb; Tue, 12 Sep 2023 00:20:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKR1+cYhYRuRU3YWbDV+VvAQ3n0Fr+HhAP7ee3ZTscqNOxVBaAV2sTtUTa2ahvd3pizzNh X-Received: by 2002:a05:6a20:13d3:b0:155:6e4f:8c1a with SMTP id ho19-20020a056a2013d300b001556e4f8c1amr4181558pzc.25.1694503226056; Tue, 12 Sep 2023 00:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694503226; cv=none; d=google.com; s=arc-20160816; b=vgQ6NO5bZylJwQCsApkKD9HbGN6hBlW/pfzdsTaWVHp8ZD0XsUPACeLav3ofKfjECV O94K6Ib4nOn1sd1Mt4ZPKdccud9Uv88wT0xnzLjp4vvARzImN1uRQ8xzNczMHYoWNM7G zcICT6t0WqWeXl0WUp8ErSrNF0jjBoD9itrKsHPXwPl3D7SlZmpmP3t3qbiC7G9Ney/d BbLKJ+UHlxUVx8cBx9as63qgfYIUXPWoZFw5aZCXwVmCNcIXUhLqjZqnunp9kNljhAOt AWUianflRZ7bo5y3bokpl9bHIstkazsfG/h+n+dRPc7Jkvf2RnoHEzUx2Ca1RWAGxNfS 9p2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=N/MDe42NHZnQ/lwGoCaI8B93gfZdHVt9xLz00I5UpXc=; fh=Vog5BgrL5SA02+ouX4fFH3lMWoCNbZeTxUIoIuBq/5U=; b=mzVFGUNqd+ez7zBT9xMxfr+s10RXunsH0THFnU1+y3lemeS/KfnyYlm8G2TjpwLcY1 pyXrV6FQwiwmioTwTsPgh+dVw3QXesg1MZsy7LdC5rcEYhdtMg0dTUjG6/Nq5Brqrs2L gBIrw8TeKd82vQZU5xkXwOviLyTWCNulyjzvJ5oMekZzEnD41vHdX3uX6ffl0Z+xM3Al Ix/q5u8skAFCM4eP40lNbtcDDbfnOb6J8jGFp1ms72lVSzI30n3brn1u5zN8lHGmXv5f XjOda3SqLbAXylsKcZFRJV5cpjUu+Nd4RLIpHN3stbQWePFWYCG1jKcE4ZJk54mn0Aet 67ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id g16-20020a056a000b9000b0068fd7cb5864si1807754pfj.263.2023.09.12.00.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 00:20:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 39F98826EE1C; Tue, 12 Sep 2023 00:15:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231452AbjILHO6 (ORCPT + 99 others); Tue, 12 Sep 2023 03:14:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbjILHO4 (ORCPT ); Tue, 12 Sep 2023 03:14:56 -0400 Received: from mxct.zte.com.cn (mxct.zte.com.cn [58.251.27.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF639B9; Tue, 12 Sep 2023 00:14:51 -0700 (PDT) Received: from mxde.zte.com.cn (unknown [10.35.20.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4RlFFz0PmrzCh0p; Tue, 12 Sep 2023 15:14:47 +0800 (CST) Received: from mxhk.zte.com.cn (unknown [192.168.250.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxde.zte.com.cn (FangMail) with ESMTPS id 4RlFFy253qz5qYcG; Tue, 12 Sep 2023 15:14:46 +0800 (CST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4RlFFq3xpSz8XrRP; Tue, 12 Sep 2023 15:14:39 +0800 (CST) Received: from szxlzmapp07.zte.com.cn ([10.5.230.251]) by mse-fl1.zte.com.cn with SMTP id 38C7EPYt080948; Tue, 12 Sep 2023 15:14:25 +0800 (+08) (envelope-from yang.yang29@zte.com.cn) Received: from mapi (szxlzmapp07[null]) by mapi (Zmail) with MAPI id mid14; Tue, 12 Sep 2023 15:14:28 +0800 (CST) Date: Tue, 12 Sep 2023 15:14:28 +0800 (CST) X-Zmail-TransId: 2b0965000fd44f9-59db5 X-Mailer: Zmail v1.0 Message-ID: <202309121514283793475@zte.com.cn> Mime-Version: 1.0 From: To: , , , , Cc: , , , , , , Subject: =?UTF-8?B?W1BBVENIIDUuMTAtcnRdIGFybTY0OiBzaWduYWw6IFVzZSBBUkNIX1JUX0RFTEFZU19TSUdOQUxfU0VORA==?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 38C7EPYt080948 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 65000FE5.001/4RlFFz0PmrzCh0p Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Sep 2023 00:15:01 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email From: Wang Yong The ltp test prompts the following bug information under the 5.10 kernel: BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:969 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 796, name: cat Preemption disabled at: [] do_debug_exception+0x60/0x180 CPU: 3 PID: 796 Comm: cat Not tainted 5.10.59-rt52-KERNEL_VERSION #38 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x0/0x198 show_stack+0x20/0x30 dump_stack+0xf0/0x13c ___might_sleep+0x140/0x178 rt_spin_lock+0x30/0x90 force_sig_info_to_task+0x30/0xe0 force_sig_fault_to_task+0x54/0x78 force_sig_fault+0x1c/0x28 arm64_force_sig_fault+0x48/0x78 send_user_sigtrap+0x4c/0x80 brk_handler+0x3c/0x68 do_debug_exception+0xac/0x180 el0_dbg+0x34/0x58 el0_sync_handler+0x50/0xb8 el0_sync+0x180/0x1c0 It has been fixed by 0c34700de5e7 ("arm64: signal: Use ARCH_RT_DELAYS_SIGNAL_SEND.") in higher versions of the kernel. This patch needs to be compatible with 5.10. 5.10 kernel does not have signal.h file, so adding signal.h file to define ARCH_RT_DELAYS_SIGNAL_SEND. Signed-off-by: Wang Yong Cc: Xuexin Jiang Cc: Yang Yang Cc: Xiaokai Ran --- arch/arm64/include/asm/signal.h | 12 ++++++++++++ arch/arm64/kernel/signal.c | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 arch/arm64/include/asm/signal.h diff --git a/arch/arm64/include/asm/signal.h b/arch/arm64/include/asm/signal.h new file mode 100644 index 000000000..0fb418cf4 --- /dev/null +++ b/arch/arm64/include/asm/signal.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ARM64_ASM_SIGNAL_H +#define __ARM64_ASM_SIGNAL_H + +#include +#include + +#if defined(CONFIG_PREEMPT_RT) +#define ARCH_RT_DELAYS_SIGNAL_SEND +#endif + +#endif diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index fe94a3e1f..538d4aadb 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -927,6 +927,15 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, } else { local_daif_restore(DAIF_PROCCTX); +#ifdef ARCH_RT_DELAYS_SIGNAL_SEND + if (unlikely(current->forced_info.si_signo)) { + struct task_struct *t = current; + + force_sig_info(&t->forced_info); + t->forced_info.si_signo = 0; + } +#endif + if (thread_flags & _TIF_UPROBE) uprobe_notify_resume(regs); -- 2.25.1