Re: force_successful_syscall_return() buggy?

Paul Mackerras (paulus@samba.org)
Mon, 16 Jun 2003 12:30:16 +1000


Russell King writes:

> #define force_successful_syscall_return() \
> do { \
> ia64_task_regs(current)->r8 = 0; \
> } while (0)
>
> I don't know what happens on these architectures, but I have a suspicion
> that there is a case which the above will fail, maybe with dramatic
> consequences.

On PPC, I am going to use a bit in the thread_info flags field to
indicate that the current syscall should not return an error. The
syscall entry and exit paths already look at the thread_info flags
(testing the syscall trace bit, among others) so it's convenient to
have the "no error" flag there too. The flag bit gets cleared on
syscall entry, set by force_successful_syscall_return() and tested on
syscall exit. The only restriction is that kernel code should not do
a system call between where it calls force_successful_syscall_return
and where it returns from the syscall. But I don't believe we ever do
recursive system calls anyway, so that should be fine.

Regards,
Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/