On Tue, Nov 18, 2014 at 01:10:34AM +0000, AKASHI Takahiro wrote:
+ if (((int)regs->syscallno == -1) && (orig_syscallno == -1)) {
+ /*
+ * user-issued syscall(-1):
+ * RESTRICTION: We always return ENOSYS whatever value is
+ * stored in x0 (a return value) at this point.
+ * Normally, with ptrace off, syscall(-1) returns -ENOSYS.
+ * With ptrace on, however, if a tracer didn't pay any
+ * attention to user-issued syscall(-1) and just let it go
+ * without a hack here, it would return a value in x0 as in
+ * other system call cases. This means that this system call
+ * might succeed and see any bogus return value.
+ * This should be definitely avoided.
+ */
+ regs->regs[0] = -ENOSYS;
+ }
I'm still really uncomfortable with this, and it doesn't seem to match what
arch/arm/ does either.
Doesn't it also prevent a tracer from skipping syscall(-1)?
Will--