Thread (13 messages) 13 messages, 4 authors, 2021-06-21

Re: [PATCH 1/2] alpha/ptrace: Record and handle the absence of switch_stack

From: Michael Schmitz <schmitzmic@gmail.com>
Date: 2021-06-21 03:36:58
Also in: linux-alpha, linux-m68k, lkml

Possibly related (same subject, not in this thread)

Hi Al,


Am 21.06.2021 um 14:27 schrieb Al Viro:
On Mon, Jun 21, 2021 at 02:01:18PM +1200, Michael Schmitz wrote:
quoted
Hi Eric,

instrumenting get_reg on m68k and using a similar patch to yours to warn
when unsaved registers are accessed on the switch stack, I get a hit from
getegid and getegid32, just by running a simple ptrace on ls.

Going to wack those two moles now ...
Explain, please.  get_reg() is called by tracer; whose state are you checking?
The check is only triggered when syscall tracing (I set a flag on trace 
entry, and clear that on trace exit)... From the WARN_ONCE stack dump, 
it appears that I get the warning from inside the syscall, not 
syscall_trace().
Because you are *not* accessing the switch stack of the caller of get_reg().
And tracee should be in something like syscall_trace() or do_notify_resume();
both have SAVE_SWITCH_STACK done by the glue...
And that's where my problem may be - I stupidly forgot to set the 'all 
registers saved' flag before calling syscall_trace() ...

I'll fix that and try again. Sorry for the noise!

Cheers,

	Michael


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help