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 D1D57C433EF for ; Tue, 5 Apr 2022 11:07:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351372AbiDELEj (ORCPT ); Tue, 5 Apr 2022 07:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237482AbiDEImc (ORCPT ); Tue, 5 Apr 2022 04:42:32 -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 C4080E0B1 for ; Tue, 5 Apr 2022 01:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649147695; 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=M1utQ8fOMqM+ptvV6EXMLIBeco3zKQw5c48AAzoDAOw=; b=Tgk3FZFIx74eJICgl+j63wwa2JvsKLGvapkhMqWsyIPb1HgTTq1NcCHcVZHz8t70YeVTC9 OdEp3d3i4PcR640OJBhH2zuZ/yImqFm64720S90F/c6JnsJMNgsUmLGcuDqOQHSYQ9RX+C gy9LqwoWtXV1LURypJye/CawsXl9S30= 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-563-h-SKvK9xOUO9bqCZ3DIYyA-1; Tue, 05 Apr 2022 04:34:52 -0400 X-MC-Unique: h-SKvK9xOUO9bqCZ3DIYyA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F6C4811E76; Tue, 5 Apr 2022 08:34:51 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.195.54]) by smtp.corp.redhat.com (Postfix) with SMTP id 9DEA214A4F80; Tue, 5 Apr 2022 08:34:47 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 5 Apr 2022 10:34:49 +0200 (CEST) Date: Tue, 5 Apr 2022 10:34:45 +0200 From: Oleg Nesterov To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Vincent Guittot Subject: Re: [PATCH v2] ptrace: fix ptrace vs tasklist_lock race on PREEMPT_RT. Message-ID: <20220405083445.GA31401@redhat.com> References: <20220314185429.GA30364@redhat.com> <20220315142944.GA22670@redhat.com> <20220404161339.GA21531@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220404161339.GA21531@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/04, Oleg Nesterov wrote: > > Cough. Somehow I can hardly understand v2. For example, if we fix > wait_task_inactive() correctly, then why ptrace_freeze_traced() > should take saved_state into account? And how can unfreeze_traced > hit saved_state == __TASK_TRACED ? OK, somehow I forgot that ptrace_freeze_traced() is called before wait_task_inactive(), so it does need to check/change saved_state. But still, ptrace_unfreeze_traced() can't see task->saved_state == __TASK_TRACED, right ? Oleg.