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-next>] [day] [month] [year] [list]
Message-ID: <0c91d808-b077-408c-b120-99e806efaeb5@EXC03-ATKLA.omicron.at>
Date:   Wed, 18 Mar 2020 21:26:40 +0100
From:   Thomas Graziadei <thomas.graziadei@...cronenergy.com>
To:     <linux-kernel@...r.kernel.org>
CC:     <bigeasy@...utronix.de>, <rostedt@...dmis.org>,
        <tglx@...utronix.de>, <linux-rt-users@...r.kernel.org>,
        Thomas Graziadei <thomas.graziadei@...cronenergy.com>
Subject: [PATCH] powerpc: Fix lazy preemption for powerpc 32bit

From: Thomas Graziadei <thomas.graziadei@...cronenergy.com>

The 32bit powerpc assembler implementation of the lazy preemption
set the _TIF_PERSYSCALL_MASK on the low word. This could lead to
modprobe segfaults and a kernel panic - not syncing: Attempt to
kill init! issue.

Fixed by shifting the mask by 16 bit using andis and lis.

Signed-off-by: Thomas Graziadei <thomas.graziadei@...cronenergy.com>
---
 arch/powerpc/kernel/entry_32.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 172dfb567c25..ab609d63d644 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -533,12 +533,12 @@ syscall_exit_work:
 
 1:	stw	r6,RESULT(r1)	/* Save result */
 	stw	r3,GPR3(r1)	/* Update return value */
-2:	andi.	r0,r9,(_TIF_PERSYSCALL_MASK)@h
+2:	andis.	r0,r9,(_TIF_PERSYSCALL_MASK)@h
 	beq	4f
 
 	/* Clear per-syscall TIF flags if any are set.  */
 
-	li	r11,_TIF_PERSYSCALL_MASK@h
+	lis	r11,(_TIF_PERSYSCALL_MASK)@h
 	addi	r12,r2,TI_FLAGS
 3:	lwarx	r8,0,r12
 	andc	r8,r8,r11
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ