Re: [PATCH 00/23] tracehook

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Roland McGrath
Date: Monday, July 21, 2008 - 3:54 am

> I took a quick look at the sparc64 tracehook support and only spotted

Thanks for the feedback.  The sparc64 (and ia64) code I have is meant
only as a starting point, and there are some unfinished holes.  I'd
intended to point you (arch maintainers) at what I whipped up but
leave it to you to decide on the correct arch bits and merge them
eventually.  (The x86 and powerpc patches are the only ones I've
really used myself and would submit as claimed to be ready.)


This is true of powerpc too.  I guess I'd figured that uses of the
calls would know when it's 32-bit and truncate what they saw.  Isn't
that what happens now when a 64-bit ptrace caller uses the 64-bit
getregs flavor on a target task that is actually 32-bit?  

But I don't disagree it might well be better for syscall_get_arguments
to truncate values to 32 bits.  I don't think there's a need for it to
reflect sign-extended 64-bit values when it's a 32-bit task.  Probably
better not to, i.e. see "123 0xffffffff ..." in /proc/pid/syscall on a
64-bit kernel for a 32-bit task as on 32-bit, instead of 32-bit apps
that don't normally notice whether the kernel is 64 or 32 sometimes
seeing "123 0xffffffffffffffff ...".


It's odd that you need sign-extended arguments for all those calls
when other machines don't.


Which call are you talking about?  For syscall_get_arguments, I think
it's fine to get all values zero-extended from 32 bits (maybe even
fine to get random high bits).  The consumer of those values in the
kernel code ought well enough to know whether it's a 32-bit or 64-bit
task's system call--that changes what the call number and arguments
mean, anyway.

For syscall_set_arguments, it's a different question.  In that case,
we should expect that whatever original source of the value being
poked in was, it just knows it's poking a 32-bit task and doesn't even
consider that the kernel might be 64 bits.  It should poke a 32-bit
value and have the effect that poking that 32-bit value has on a
32-bit kernel.

Anyway, I don't see how this side of it is really an issue at all.
syscall_set_arguments is only valid to use at the syscall entry
tracing point.  This is before the dispatch to those stubs doing the
sign extension.  (Or it could be used at a point entirely outside of
syscall entry, like on the state just after -ERESTARTSYS handling
to change the args before the user re-executes the syscall.)


They don't seem to.


Thanks,
Roland
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/23] tracehook, Roland McGrath, (Thu Jul 17, 12:25 am)
[PATCH 01/23] tracehook: add linux/tracehook.h, Roland McGrath, (Thu Jul 17, 12:27 am)
[PATCH 02/23] tracehook: exec, Roland McGrath, (Thu Jul 17, 12:28 am)
[PATCH 03/23] tracehook: unexport ptrace_notify, Roland McGrath, (Thu Jul 17, 12:28 am)
[PATCH 04/23] tracehook: exit, Roland McGrath, (Thu Jul 17, 12:28 am)
[PATCH 05/23] tracehook: clone, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 06/23] tracehook: vfork-done, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 07/23] tracehook: release_task, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 08/23] tracehook: tracehook_tracer_task, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 09/23] tracehook: tracehook_expect_breakpoints, Roland McGrath, (Thu Jul 17, 12:29 am)
[PATCH 10/23] tracehook: tracehook_signal_handler, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 11/23] tracehook: tracehook_consider_ignored_signal, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 12/23] tracehook: tracehook_consider_fatal_signal, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 13/23] tracehook: syscall, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 14/23] tracehook: get_signal_to_deliver, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 15/23] tracehook: job control, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 16/23] tracehook: death, Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 17/23] tracehook: force signal_pending(), Roland McGrath, (Thu Jul 17, 12:30 am)
[PATCH 18/23] tracehook: TIF_NOTIFY_RESUME, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 19/23] tracehook: asm/syscall.h, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 20/23] tracehook: CONFIG_HAVE_ARCH_TRACEHOOK, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 21/23] tracehook: wait_task_inactive, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 22/23] task_current_syscall, Roland McGrath, (Thu Jul 17, 12:31 am)
[PATCH 23/23] /proc/PID/syscall, Roland McGrath, (Thu Jul 17, 12:31 am)
Re: [PATCH 00/23] tracehook, Andrew Morton, (Thu Jul 17, 12:39 am)
Re: [PATCH 00/23] tracehook, Roland McGrath, (Thu Jul 17, 1:11 am)
Re: [PATCH 00/23] tracehook, Andrew Morton, (Thu Jul 17, 1:30 am)
Re: [PATCH 00/23] tracehook, Roland McGrath, (Thu Jul 17, 1:37 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Alexey Dobriyan, (Thu Jul 17, 1:48 am)
Re: [PATCH 00/23] tracehook, Andrew Morton, (Thu Jul 17, 1:51 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Petr Tesarik, (Thu Jul 17, 4:06 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Christoph Hellwig, (Thu Jul 17, 6:34 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Alexey Dobriyan, (Thu Jul 17, 2:50 pm)
Re: [PATCH 23/23] /proc/PID/syscall, Alexey Dobriyan, (Thu Jul 17, 3:56 pm)
Re: [PATCH 00/23] tracehook, Ingo Molnar, (Fri Jul 18, 1:07 am)
Re: [PATCH 00/23] tracehook, David Miller, (Fri Jul 18, 2:20 am)
Re: [PATCH 00/23] tracehook, Andi Kleen, (Fri Jul 18, 4:24 am)
Re: [PATCH 00/23] tracehook, David Miller, (Fri Jul 18, 4:32 am)
Re: [PATCH 01/23] tracehook: add linux/tracehook.h, Petr Tesarik, (Fri Jul 18, 4:57 am)
Re: [PATCH 23/23] /proc/PID/syscall, Roland McGrath, (Mon Jul 21, 1:19 am)
Re: [PATCH 02/23] tracehook: exec, Christoph Hellwig, (Mon Jul 21, 1:49 am)
Re: [PATCH 00/23] tracehook, Roland McGrath, (Mon Jul 21, 2:59 am)
Re: [PATCH 00/23] tracehook, Roland McGrath, (Mon Jul 21, 3:54 am)
Re: [PATCH 00/23] tracehook, David Miller, (Mon Jul 21, 8:18 am)