mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>, Thomas Huth <thuth@redhat.com>,
	Yao Zi <ziyao@disroot.org>, Thomas Gleixner <tglx@linutronix.de>,
	Xi Ruoyao <xry111@xry111.site>
Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] LoongArch: Fix bitflag conflict for TIF_FIXADE
Date: Fri, 19 Sep 2025 12:58:29 +0000	[thread overview]
Message-ID: <20250919125829.37951-1-ziyao@disroot.org> (raw)

After LoongArch was converted to use the generic TIF bits in commit
f9629891d407 ("loongarch: Use generic TIF bits"), its TIF_FIXADE flag
takes the same bit with TIF_RESTORE_SIGMASK in thread_info.flags.

Such conflict causes TIF_FIXADE being considered cleared when
TIF_RESTORE_SIGMASK is cleared during deliver of a signal. And since
TIF_FIXADE determines whether unaligned access emulation works for a
task, userspace making use of unaligned access will receive unexpected
SIGBUS (and likely terminate) after receiving its first signal.

This conflict looks like a simple typo, let's just switch to a free bit.

Fixes: f9629891d407 ("loongarch: Use generic TIF bits")
Signed-off-by: Yao Zi <ziyao@disroot.org>
---

Note the problematic commit is contained in next-20250918, but not
master.

 arch/loongarch/include/asm/thread_info.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/include/asm/thread_info.h b/arch/loongarch/include/asm/thread_info.h
index def7cb14467e..4d7117fcdc78 100644
--- a/arch/loongarch/include/asm/thread_info.h
+++ b/arch/loongarch/include/asm/thread_info.h
@@ -77,7 +77,7 @@ register unsigned long current_stack_pointer __asm__("$sp");
 #define TIF_NOHZ		16	/* in adaptive nohz mode */
 #define TIF_USEDFPU		17	/* FPU was used by this task this quantum (SMP) */
 #define TIF_USEDSIMD		18	/* SIMD has been used this quantum */
-#define TIF_FIXADE		10	/* Fix address errors in software */
+#define TIF_FIXADE		19	/* Fix address errors in software */
 #define TIF_LOGADE		20	/* Log address errors to syslog */
 #define TIF_32BIT_REGS		21	/* 32-bit general purpose registers */
 #define TIF_32BIT_ADDR		22	/* 32-bit address space */
-- 
2.50.1


             reply	other threads:[~2025-09-19 12:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 12:58 Yao Zi [this message]
2025-09-19 13:21 ` Wentao Guan
2025-09-20  4:16 ` [PATCH] " Huacai Chen
2025-09-20  8:25 ` [tip: core/core] " tip-bot2 for Yao Zi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250919125829.37951-1-ziyao@disroot.org \
    --to=ziyao@disroot.org \
    --cc=chenhuacai@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=tglx@linutronix.de \
    --cc=thuth@redhat.com \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®