Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp573996pxb; Tue, 5 Apr 2022 14:33:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhC6yzWSYhGiUPZmfGS6ipHU1w/hUx8ZwTtigzTTK+EYr+keacP25Gr0UcsyHVfqh+kFo/ X-Received: by 2002:a17:902:ef47:b0:156:646b:58e7 with SMTP id e7-20020a170902ef4700b00156646b58e7mr5296997plx.57.1649194433826; Tue, 05 Apr 2022 14:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649194433; cv=none; d=google.com; s=arc-20160816; b=Bhpj1J9A668fb0l2+ksFsWdaOklgmWlRd81l3/zOKeu6yI38R+rdJIOQPS0yJrzbvS kWhSV63DKzm3xvyHuChm5ByH8iolx1ShWI/vVscgC6WDg0Zey1e05LGARdTvM5+gkff4 t0oRpDZjAB+B31nxU9/V+xDfcPsu8YEDWaLt9Ke6HNhTmIfSoPYrIlQ7LzYpyKlf7sfK C6txs7QMMgEDEMW+jXzL6ZmUUZbPSBL85ykq9PfPQXXkRihuCNf7KTX8vmZGYfC25lQI rZ1djuYoe8fYoQKI2TRFpekg4piQ6Q4E8vW2C68gt3dN3xLyXyBEgxMgszgj31MIwI2H Jvtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=M1utQ8fOMqM+ptvV6EXMLIBeco3zKQw5c48AAzoDAOw=; b=u1Nijb6vrn+fEmWfqbh7Blu7vT2W9QmreT2rQ4jG9GNSxwFJ7IrHmgTBu9wND+z1V1 G9itVvD1nDwxnWLSRzwbY+gPm8ozi36+fdkQYr+52Cjdkhj3HlWqBTYS2sh8LjwDPiHj NMwwT+N9/ejD1mngVoCURAJcJ6Yz7PbbW+OHs3/4WTrkhYxN0COCynBWcaJc/C7ZS7IL 0fNzJsjgajlUedv2SmjfScHLhyMe4b2ctTxh4BHz1oTUMoXoB9JwsY4z2vViO4Crshn9 z8bTMEWe91lNtcIJZh6GvjeHvn7WYAfdriPAJEaBZdir4kjpgpUBk5j8OX2vbnc4Z0jL bAdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Tgk3FZFI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a23-20020a170902b59700b00153b2d1642bsi12408368pls.51.2022.04.05.14.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 14:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Tgk3FZFI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 024D317A58B; Tue, 5 Apr 2022 14:24:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351366AbiDELEg (ORCPT + 99 others); Tue, 5 Apr 2022 07:04:36 -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 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.