Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3903632pxb; Tue, 7 Sep 2021 10:02:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVPOzjXjbNE3VZ2etp4IMRMZFM2Iv7FuoXzEo8iQmxmxcHOghZoG+v33mi/k9vdQ4zhNHA X-Received: by 2002:a92:d943:: with SMTP id l3mr5671314ilq.241.1631034172599; Tue, 07 Sep 2021 10:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631034172; cv=none; d=google.com; s=arc-20160816; b=lYUxPQ7BGxNGJxSLm1YhAqKeD0DXwQ5TYcNkp3j9PZg9MYhpQPJvvpGj7prwNMmwZW +giOE87ugblY9Ymhsqtm/8oPjSl/z4pjsoAHW7YttNbDP7GnAJE1uDKj5PD81xDyXogs 4LrF3e5oy1uXo5L9wzuOcn+6vUgw1lHm+W2anE/s7hfxjyTvsoysYqcNuUBRnW9PwdRW LqThU/vA0kSE3b8sgOR2bbtXXGDeBbxrs60aRepMSHUoxzc65d0ywBi3U6LPD3vfDJdA OSAotzBdQa/HZp9dni0z6bOZ3mtO8UKbJjUCKeVGCNNdBDQ7Ss34yxUl5gu9CiwDyKQO pxXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=eTWAB5IRZ6u+fFBbo38jlDZw3s3Kz/HwTHFwTqUgCyM=; b=Q3rRvQmyM+Cn+PkL+jtmyl5R1nx6QHR9s1v3icgaT+80LonUKoaVcga/wzkQb0EhP/ 0f+KneqEKpdsiedPkkUzwwg2c4UdpbTQZpsGssO7D9tl2xFx1CR9fP6P+zFXX9HjHjyv y7w6fJzVId5nEOLd0DwPtkhDwymijrHxjEijK8N5euwO2kaAJwBhW9I8mHDv0RmM/Xpj frWBr/2cuclJoZxK79bTvDhnXh7Z41X5EtWT2QXNJ4PzzW86JfMyDSPFjYgRBY369sU6 mGbU2OFAaf9whkm7NDA1gHkBQxNPkRBxGoqtb+o1MOXsMGupm1PQyBOzLouG7TNFogGy MAOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HxffgRT4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p14si13140155iov.81.2021.09.07.10.02.38; Tue, 07 Sep 2021 10:02:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HxffgRT4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345471AbhIGRCQ (ORCPT + 99 others); Tue, 7 Sep 2021 13:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345462AbhIGRCP (ORCPT ); Tue, 7 Sep 2021 13:02:15 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 077BDC061575 for ; Tue, 7 Sep 2021 10:01:09 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id y17so8628233pfl.13 for ; Tue, 07 Sep 2021 10:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=eTWAB5IRZ6u+fFBbo38jlDZw3s3Kz/HwTHFwTqUgCyM=; b=HxffgRT4HJI82SYZun9lQga2rWb3tMZra8BfyVs7+MlqsPqxBLj0q9eYIbh5TRPbJX C7K6VLiyrAtOdxB9J8pRTnDq2iXlVoupXwWD7i8gjfh9wIWl2sTx0ZczCjAGXHVwS8us 0HxJni+G9UWSGX8VNoeqKtCgovvc9iUG14ao+q9JNS9e4Q9BjjiiJRa/CJXd6m8hm8TG zQRg4AIYZPvZo+1kMU0r+vAQhElWeroPtmWUs5si8KNfnqCkQJ27ysZhSUW+3df1CzQk vWh2CVS4ni69+H24KdpGsg0HEaa92FLkJ9807lTOFcxDNmgpGtIMLgOU9UucSRS0WPP5 7lsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=eTWAB5IRZ6u+fFBbo38jlDZw3s3Kz/HwTHFwTqUgCyM=; b=IsJA/LHo/KTLsfokwXiHlDFSpY9S2Ihjy8s6Zn/4WWPvHt5J1bvqxmnpmvWU45m2tN MigBAAvrol44iSItFKiJ7OxSQ33tWsernfEUfXXQ6lvRCvu2CSeYWWoNDsGn3uJVllKl /xoga6Ta6fbkj05YlL0qqtegDXDE9Z1qkDh3a5eCNyi26PFCaxo0/qOaiGNZY2Z0R7ZH M5BJ23jon27vrTNoSYBfBt9BTlLsLpHiC0kFjX9uGYN3yAvrHSh1pd/eNNUiTLKXvi3/ qg7hszdTnCcu28hKk8KXzQcvD+J05cQ/hqebH6v6KL5KTMag+9mSH1t4Q6PSOjiB0vNm pqVA== X-Gm-Message-State: AOAM533ePHmQqjO2eUlFcqrlQTgg1O3DZxwqIUgBU/IvU6cB5yvE65My Vt2YwR0b6fvGBLiw/O757JY= X-Received: by 2002:a05:6a00:10ca:b0:3fe:3a9b:2100 with SMTP id d10-20020a056a0010ca00b003fe3a9b2100mr21607959pfu.59.1631034068275; Tue, 07 Sep 2021 10:01:08 -0700 (PDT) Received: from localhost (2603-800c-1a02-1bae-e24f-43ff-fee6-449f.res6.spectrum.com. [2603:800c:1a02:1bae:e24f:43ff:fee6:449f]) by smtp.gmail.com with ESMTPSA id t10sm13401083pge.10.2021.09.07.10.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 10:01:07 -0700 (PDT) Sender: Tejun Heo Date: Tue, 7 Sep 2021 07:01:06 -1000 From: Tejun Heo To: Zhang Qiao Cc: peterz@infradead.org, juri.lelli@redhat.com, linux-kernel@vger.kernel.org, mingo@redhat.com, vincent.guittot@linaro.org Subject: Re: [PATCH] kernel/sched: Fix sched_fork() access an invalid sched_task_group Message-ID: References: <20210826112635.7404-1-zhangqiao22@huawei.com> <1f0cd867-9c6d-4e22-cadd-06af9f852f7a@huawei.com> <128d52ab-b4ee-65f8-e0a3-2796ef43a98b@huawei.com> <3df62791-d123-db9b-ec9c-092c47a941cc@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3df62791-d123-db9b-ec9c-092c47a941cc@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Sep 02, 2021 at 03:42:15PM +0800, Zhang Qiao wrote: > I checked the code again. > I don't quite understand what you said, if the child be moved between > cgroup_post_fork() and sched_post_sched(), what problems might it cause? cgroup_post_fork() is where the child's creation is committed from cgroup's POV, so it'd be migrating cgroups before the initial creation is finished. From glancing, looks like it'll break css_set task counts to begin with. This violates the basic assumptions and can cause critical failures in subtle ways. The would replace one subtle race with a possibly worse one. Thanks. -- tejun