From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63BA0C433F5 for ; Tue, 26 Apr 2022 18:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350204AbiDZSPD (ORCPT ); Tue, 26 Apr 2022 14:15:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350190AbiDZSPC (ORCPT ); Tue, 26 Apr 2022 14:15:02 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AAFC66B0B6 for ; Tue, 26 Apr 2022 11:11:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650996713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=txVrQMYQgYiYutdkcOsERCtHa88Far59A/ryTs+r9MU=; b=gQdlvcWXr7I82foTm0iVrNAEsH8zVGf6YasB7koQbIz3wvqsB/izoXGqejVQdI2BSkH6gF 3cqvL7F7H0jSCp/DrrgKoUJd3KPg8n0MeP1mACLOtB+o9FtLIhGPycqV1jYWo7VUu0dD0M 2UQvZHGIJhJdjPe2I1aIXeKXNfBhs/I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-507-c_2q4GpbPIOZ2YVlToctkA-1; Tue, 26 Apr 2022 14:11:47 -0400 X-MC-Unique: c_2q4GpbPIOZ2YVlToctkA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6EFA185A5A8; Tue, 26 Apr 2022 18:11:46 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.74]) by smtp.corp.redhat.com (Postfix) with SMTP id 5945954F41E; Tue, 26 Apr 2022 18:11:43 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 26 Apr 2022 20:11:45 +0200 (CEST) Date: Tue, 26 Apr 2022 20:11:42 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Peter Zijlstra , rjw@rjwysocki.net, mingo@kernel.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de, bigeasy@linutronix.de, Will Deacon , linux-kernel@vger.kernel.org, tj@kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v2 2/5] sched,ptrace: Fix ptrace_check_attach() vs PREEMPT_RT Message-ID: <20220426181141.GA13647@redhat.com> References: <20220421150248.667412396@infradead.org> <20220421150654.817117821@infradead.org> <20220425143537.GA12412@redhat.com> <20220425183343.GM2731@worktop.programming.kicks-ass.net> <87pml4llvm.fsf@email.froward.int.ebiederm.org> <20220426055122.GA29684@redhat.com> <878rrrkbjb.fsf@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878rrrkbjb.fsf@email.froward.int.ebiederm.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On 04/26, Eric W. Biederman wrote: > > Relying on __ptrace_unlink assumes the __ptrace_unlink happens after > siglock is taken before calling ptrace_stop. Especially with the > ptrace_notify in signal_delivered that does not look guaranteed. > > The __ptrace_unlink could also happen during arch_ptrace_stop. > > Relying on siglock is sufficient because __ptrace_unlink holds siglock > over clearing task->ptrace. Which means that the simple fix for this is > to just test task->ptrace before we set JOBCTL_TRACED_QUEIESCE. Or simply clear _QUEIESCE along with _TRACED/DELAY_WAKEKILL before return? Oleg.