From: Al Viro Subject: Re: [PATCH 1/2] alpha/ptrace: Record and handle the absence of switch_stack Date: Mon, 21 Jun 2021 02:27:52 +0000 Message-ID: References: <924ec53c-2fd9-2e1c-bbb1-3fda49809be4@gmail.com> <87eed4v2dc.fsf@disp2133> <5929e116-fa61-b211-342a-c706dcb834ca@gmail.com> <87fsxjorgs.fsf@disp2133> <87zgvqor7d.fsf_-_@disp2133> <87mtrpg47k.fsf@disp2133> <87pmwlek8d.fsf_-_@disp2133> <87k0mtek4n.fsf_-_@disp2133> <393c37de-5edf-effc-3d06-d7e63f34a317@gmail.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <393c37de-5edf-effc-3d06-d7e63f34a317@gmail.com> Sender: Al Viro List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michael Schmitz Cc: "Eric W. Biederman" , Linus Torvalds , linux-arch , Jens Axboe , Oleg Nesterov , Linux Kernel Mailing List , Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , Geert Uytterhoeven , linux-m68k , Arnd Bergmann , Ley Foon Tan , Tejun Heo , Kees Cook On Mon, Jun 21, 2021 at 02:01:18PM +1200, Michael Schmitz wrote: > 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? 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...