Skip to content

Commit 61baf15

Browse files
author
Scott Wood
committed
powerpc/64e: Don't place the stack beyond TASK_SIZE
Commit f4ea6dc ("powerpc/mm: Enable mappings above 128TB") increased the task size on book3s, and introduced a mechanism to dynamically control whether a task uses these larger addresses. While the change to the task size itself was ifdef-protected to only apply on book3s, the change to STACK_TOP_USER64 was not. On book3e, this had the effect of trying to use addresses up to 128TiB for the stack despite a 64TiB task size limit -- which broke 64-bit userspace producing the following errors: Starting init: /sbin/init exists but couldn't execute it (error -14) Starting init: /bin/sh exists but couldn't execute it (error -14) Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. Fixes: f4ea6dc ("powerpc/mm: Enable mappings above 128TB") Cc: Aneesh Kumar K.V <[email protected]> Signed-off-by: Scott Wood <[email protected]>
1 parent 726bd22 commit 61baf15

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/powerpc/include/asm/processor.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,13 @@ void release_thread(struct task_struct *);
151151

152152
#ifdef __powerpc64__
153153

154+
#ifdef CONFIG_PPC_BOOK3S_64
154155
/* Limit stack to 128TB */
155156
#define STACK_TOP_USER64 TASK_SIZE_128TB
157+
#else
158+
#define STACK_TOP_USER64 TASK_SIZE_USER64
159+
#endif
160+
156161
#define STACK_TOP_USER32 TASK_SIZE_USER32
157162

158163
#define STACK_TOP (is_32bit_task() ? \

0 commit comments

Comments
 (0)