Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2d9f177 authored by Lars Persson's avatar Lars Persson Committed by Ralf Baechle
Browse files

MIPS: Fix syscall_get_nr for the syscall exit tracing.



Register 2 is alredy overwritten by the return value when
syscall_trace_leave() is called.

Signed-off-by: default avatarLars Persson <larper@axis.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9187/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 26f7c4bd
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -29,13 +29,7 @@
static inline long syscall_get_nr(struct task_struct *task,
static inline long syscall_get_nr(struct task_struct *task,
				  struct pt_regs *regs)
				  struct pt_regs *regs)
{
{
	/* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
	return current_thread_info()->syscall;
	if ((config_enabled(CONFIG_32BIT) ||
	    test_tsk_thread_flag(task, TIF_32BIT_REGS)) &&
	    (regs->regs[2] == __NR_syscall))
		return regs->regs[4];
	else
		return regs->regs[2];
}
}


static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
+1 −0
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@ struct thread_info {
						 */
						 */
	struct restart_block	restart_block;
	struct restart_block	restart_block;
	struct pt_regs		*regs;
	struct pt_regs		*regs;
	long			syscall;	/* syscall number */
};
};


/*
/*
+2 −0
Original line number Original line Diff line number Diff line
@@ -770,6 +770,8 @@ asmlinkage long syscall_trace_enter(struct pt_regs *regs, long syscall)
	long ret = 0;
	long ret = 0;
	user_exit();
	user_exit();


	current_thread_info()->syscall = syscall;

	if (secure_computing() == -1)
	if (secure_computing() == -1)
		return -1;
		return -1;