Skip to content

Commit 4964368

Browse files
author
Richard Henderson
committed
[ALPHA] Fixup fallout from force_successful_syscall_return change.
1 parent 7200169 commit 4964368

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

arch/alpha/kernel/asm-offsets.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void foo(void)
3131
DEFINE(TASK_TGID, offsetof(struct task_struct, tgid));
3232
BLANK();
3333

34+
DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
3435
DEFINE(PT_PTRACED, PT_PTRACED);
3536
DEFINE(CLONE_VM, CLONE_VM);
3637
DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);

arch/alpha/kernel/head.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <linux/config.h>
1111
#include <asm/system.h>
12+
#include <asm/asm_offsets.h>
1213

1314
.globl swapper_pg_dir
1415
.globl _stext
@@ -25,7 +26,7 @@ __start:
2526
/* We need to get current_task_info loaded up... */
2627
lda $8,init_thread_union
2728
/* ... and find our stack ... */
28-
lda $30,0x4000($8)
29+
lda $30,0x4000 - SIZEOF_PT_REGS($8)
2930
/* ... and then we can start the kernel. */
3031
jsr $26,start_kernel
3132
call_pal PAL_halt

include/asm-alpha/ptrace.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,8 @@ struct switch_stack {
7171
#define instruction_pointer(regs) ((regs)->pc)
7272
extern void show_regs(struct pt_regs *);
7373

74-
/*
75-
* TODO: if kernel-only threads do not have a dummy pt_regs structure at the
76-
* top of the stack, this would cause kernel stack corruption. Either check
77-
* first that we're not dealing with a kernel thread or change the kernel
78-
* stacks to allocate a dummy pt_regs structure.
79-
*/
80-
81-
#define alpha_task_regs(task) ((struct pt_regs *) \
82-
((long) task->thread_info + PAGE_SIZE) - 1)
74+
#define alpha_task_regs(task) \
75+
((struct pt_regs *) ((long) (task)->thread_info + 2*PAGE_SIZE) - 1)
8376

8477
#define force_successful_syscall_return() (alpha_task_regs(current)->r0 = 0)
8578

0 commit comments

Comments
 (0)