Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp821936pxb; Tue, 14 Sep 2021 09:25:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/Fjrmi8DZu9v7Gx614fbWWSep2nEW6YwCH5M3GWhZiB3VmB1lv0ZLZvrHKz7ahBp+vzTm X-Received: by 2002:a05:6638:3813:: with SMTP id i19mr4878118jav.16.1631636728289; Tue, 14 Sep 2021 09:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631636728; cv=none; d=google.com; s=arc-20160816; b=qv2b8TyrLZbsHnH6OI+h+e+mW8te9EXcru3lQhzWeR2Oy/m/f0VPCAqPYQroV0ZKnE rYdFuatGdH10KkZFpsawagHFXQXSwVMHNfJFyEClGk16E6qPIqBS/HCs8kxpDhCR4eaS kJuGShMPHYKpdCL2TNnOxAnbXS11G0DBoJP0xY0YpgH6qT26rD2j1cukwNxooFcLJcAm iVc4fmAScLKqeSf/592Lk2pRIsDL2R4CxRQp3OETyvGSgc+eXd1Rjxo0jLVXc/a8J0hH pH7I0xSvP7eOsjinBsiDXSO8kETdnho3U5vbKXjS9lqIO/5d4QkDSwZErZRB68mQ5BRq QTXg== 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=M1OLud5L7SR/XzmtK9MomZhlAfhb/UzSPLkSu/CN0Ls=; b=g7gcsSeoV4P0sVnwSxkLx9FMU1DCFFmPPXVXXFH5gWYdnvHvyeNGRWGPOgu5CGrGfp +ewd2NcmqcAd10T3/3FarPYnZ+8OO1izzZvGrucpedsO8OasS2gjqfAxcBz9d+DuNAq2 mfgmAnDsmZaSPfzfycUWoQ5tbkZNj0ydcciDgG11GuT6689gKItn/bWpje4MOjSG1zRV O5Mr6GQ2QZVs0W8NbG8Th49716RMvSy14KXLBdPQC/qj3BI8/iKd1CcaESP3FQ21s2gS YILg1Y0bvUEcGQLVUDYir4DdY5P7NDaEVvA44nzz36aMGhNinsm5WiU7GsHzdCU0Jzoy HTMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=B8NXLPlE; 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 w67si9475772jaa.124.2021.09.14.09.25.15; Tue, 14 Sep 2021 09:25:28 -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=B8NXLPlE; 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 S229767AbhINQYx (ORCPT + 99 others); Tue, 14 Sep 2021 12:24:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229829AbhINQYw (ORCPT ); Tue, 14 Sep 2021 12:24:52 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00C84C061762 for ; Tue, 14 Sep 2021 09:23:35 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id s11so13212757pgr.11 for ; Tue, 14 Sep 2021 09:23:34 -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=M1OLud5L7SR/XzmtK9MomZhlAfhb/UzSPLkSu/CN0Ls=; b=B8NXLPlEGILsGJ/1BwUEO69eIWz2uwusaVZqj+8n7lxKrMWY1UtJ/zDlMWoJWgJ/00 qrIh2FpA72W3aJ6LOFl2Ehz5+ob/gv9jkQGgdZIWR2aSCP29UeIGtgMVP5jOVHvjUbkN aRkH2aGdxhZQvKGUL0H4gelX3vrBCk+gBm6HKCU8x5DDf+SSw6wIosj4Cu+VBh5mpRRr DvBlaX45P+OoBCtk2BUDQdhOsVdRswJ4SdgtcHH5gZ6WAoa7qusF5q2POcMBfZwNLXEd hQbPG62Uh7phRRhj767kXZz36U5jGisbeguNV0y2HL9ZYIF1JJpN49RYVC+pxrnRFkvv J3jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=M1OLud5L7SR/XzmtK9MomZhlAfhb/UzSPLkSu/CN0Ls=; b=a41wtB8LltG+jyO+Vsa4kqD0AI2N0GCtr53ebPJeBzh0ZFuOXS4eLdwsPa/+kX2UBj uayhfs0CADYDcnQuztCL73rt7PlLBULMNri3TMXSdfhqnhgyZPnc8ka/jL7sOzpKIaao tLUKt9oPwErMtcPSqueHWy2yvDKPh+wHjANsq4Amw13LYH2XEpsyOPF71UgMbLwtV37/ mJXuj3xDOYiduPywT8RCSc9iExvFxar5M4PJDTZljPxdQW1mbLHMtzZGETiqkt/YOkoV bCzqREDQvMmSVWJmIL2M9uY5DZucMuFaIUwMGpQncAIReQzJbYXpMtZyc/v/yNjgNHGB MKQg== X-Gm-Message-State: AOAM5309PrG2Bgkcuj5SqfqWZWaazm3MKu0OrJ3q5T5rlUYVNkdMYmxC JSEMTLQhdEt3118vSJAiZ54= X-Received: by 2002:a05:6a00:8c2:b0:438:7f68:2438 with SMTP id s2-20020a056a0008c200b004387f682438mr5730980pfu.33.1631636614285; Tue, 14 Sep 2021 09:23:34 -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 e5sm2138355pjv.44.2021.09.14.09.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 09:23:33 -0700 (PDT) Sender: Tejun Heo Date: Tue, 14 Sep 2021 06:23:32 -1000 From: Tejun Heo To: Zhang Qiao Cc: mingo@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com Subject: Re: [PATCH v2] kernel/sched: Fix sched_fork() access an invalid sched_task_group Message-ID: References: <20210911075054.6358-1-zhangqiao22@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 04:20:02PM +0800, Zhang Qiao wrote: > Perhaps we can fix this bug at sched_post_fork(), which is executed between cgroup_can_fork() > and cgroup_post_fork(). Relocate the fectching of task_group and access it at sched_post_fork(). Can't we just add a can_fork callback in cpu_cgrp_subsys? -- tejun