From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754601AbcHSCkP (ORCPT ); Thu, 18 Aug 2016 22:40:15 -0400 Received: from mail-ua0-f179.google.com ([209.85.217.179]:33963 "EHLO mail-ua0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbcHSCkN (ORCPT ); Thu, 18 Aug 2016 22:40:13 -0400 MIME-Version: 1.0 In-Reply-To: <20160818162311.GA27883@redhat.com> References: <20160818143750.GA24070@redhat.com> <20160818153806.GA25492@redhat.com> <20160818162311.GA27883@redhat.com> From: Keno Fischer Date: Thu, 18 Aug 2016 13:37:02 -0400 Message-ID: Subject: Re: ptrace group stop signal number not reset before PTRACE_INTERRUPT is delivered? To: Oleg Nesterov Cc: Roland McGrath , linux-kernel@vger.kernel.org, Tejun Heo Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2016 at 12:23 PM, Oleg Nesterov wrote: > > And you if you get PTRACE_EVENT_STOP and WSTOPSIG() == SIGTTIN after > PTRACE_INTERRUPT, you know that the tracee did not report the "new" > SIGTTIN. It seems possible to remember whether or not we injected a stopping signal and if so the next PTRACE_EVENT_STOP is a group-stop, otherwise a PTRACE_INTERRUPT stop. Currently what I do is the other way around, after issuing PTRACE_INTERRUPT, the first (if any) of the next two stops that is a PTRACE_EVENT_STOP get interpreted as a PTRACE_INTERRUPT stop. I haven't thought through this fully yet, so I can't give you a concrete example I worried about, it just seems fragile compared to just checking whether WSTOPSIG() == SIGTRAP.