lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H7fYA_B+XA2KU2RW7xsQmb=PFv5XFiAV3kCgLirXVijCw@mail.gmail.com>
Date: Sat, 20 Sep 2025 12:16:44 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Yao Zi <ziyao@...root.org>
Cc: WANG Xuerui <kernel@...0n.name>, Thomas Huth <thuth@...hat.com>, 
	Thomas Gleixner <tglx@...utronix.de>, Xi Ruoyao <xry111@...111.site>, loongarch@...ts.linux.dev, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] LoongArch: Fix bitflag conflict for TIF_FIXADE

On Fri, Sep 19, 2025 at 8:58 PM Yao Zi <ziyao@...root.org> wrote:
>
> 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@...root.org>
> ---
>
> Note the problematic commit is contained in next-20250918, but not
> master.
It will be more beautiful if this patch is squashed to the original one.

Huacai

>
>  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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ