Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1805335pxp; Sat, 12 Mar 2022 23:25:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJymBuLMZrezoPDB/X+KpZOQAlhOABreblLN88eO7G8pd9wmNe4H0iDqtOHS6agqV0f1BcLh X-Received: by 2002:a05:6402:8d5:b0:416:1b20:5090 with SMTP id d21-20020a05640208d500b004161b205090mr15077928edz.393.1647156318651; Sat, 12 Mar 2022 23:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647156318; cv=none; d=google.com; s=arc-20160816; b=eWTIbEv8hEk6XtOAcyVErD0Eom0VQfPJpGEA7goOKLFTchzKmyeJlBEcgYYaHoxM9F J5RSImRkIa6yXbkTFdRc84aun+Eq5uZbZsAEOxJtixpVdPp613/QwgioisclCqbirPzS HOmXaUPk9YjTbDeaYnHS9K1iGkPC8w4FSfpezTkv5ZCRUNjip5JLwFZev1QWn6DpoBXR DkVBHnBT7dzbEeCy/UgSNw1VUPy8H10Gw8tUdNXIKurPTXxtX77au1qVJZVsXg4OVz/i 1EBU0W1sciYfMhBAxs8uowdERAtUIXcAQ82DVtcH563FZSk8nPalwunwngYa9eZdzFkO bsjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=ImDKjyjIaqyBgsE3pDCKcxhGjzMBqWvERgvYQx/Ct4I=; b=SfeQOPL0BrLnOhpp/DP2+sZi7zSYI3iwpfoeeBbCZzUWGePQIdigk+8stGTN9pb1sG 8nxsX7JkJNCzunem680uy15dLRGo40MKyzJjzt3zDIhYqFBrikC5AwYLo/GR0MxgLaxU dFIaIwV5mfpZynJ77KDdjvA60Ua7SE0cI3nDBhpsVzMW+chaN6GWP28XsAcvaSv3Rfho DiqPskg8AtxFTdnnmzS2zWw+vk/18P4pO7Ru9WqV5Lts1Trihkc/2TC39ttYP3QD0JC7 OFE+myBpzlxLOuI2BzHydz8l9NYblgHZwoFFsb1V95hs1Wo5fJabGrGltNRM4lPhgkIn VRJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L1aO2Oe5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="vtF/fpC0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb2-20020a170907784200b006b26cbfe7b9si7835326ejc.172.2022.03.12.23.24.54; Sat, 12 Mar 2022 23:25:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=L1aO2Oe5; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="vtF/fpC0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231663AbiCLMiM (ORCPT + 99 others); Sat, 12 Mar 2022 07:38:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbiCLMiK (ORCPT ); Sat, 12 Mar 2022 07:38:10 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91CF5DF; Sat, 12 Mar 2022 04:37:05 -0800 (PST) Date: Sat, 12 Mar 2022 12:37:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647088623; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ImDKjyjIaqyBgsE3pDCKcxhGjzMBqWvERgvYQx/Ct4I=; b=L1aO2Oe5qTpKPzWOvnFEiThM+t8kteIfw9M9af1eXl6R2W7Ybc2YA3SrExelYPmCo2AvQo XDfqLojNovJsNeMFP3UmND2DJUWb3mFaV71N9QRxO7nzhebAQI0fxpKEKxnfwQSKSHjhMF S8H4jLRCW4h7qY/FX7BNFjRwa/ZGhCdNqFHgwW+kJ94lPtXZM5Ou3tmcvw3T/5mI/yxZzZ eapQ/CVinuSWsy+u6HGkfyLtaO5W2l4tPqFsItIqLW4+t/Uq/N7ubiPmc5ypL39o8l8/yJ ktX2fa7cqmRrYD7MgD3nRo5i4AmvYZnQ/Mri37XVawAWTu/2T8KOy3a+yTqoYA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647088623; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ImDKjyjIaqyBgsE3pDCKcxhGjzMBqWvERgvYQx/Ct4I=; b=vtF/fpC0rwgCCIGVGBCbbNrZvO1DJDratI69JSHhwoasOhLtUQH67lrYtuMEUuFE30lvaV inHJrJxYV4gyY3DA== From: "tip-bot2 for Chengming Zhou" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] cgroup: Fix suspicious rcu_dereference_check() usage warning Cc: Linux Kernel Functional Testing , syzbot+16e3f2c77e7c5a0113f9@syzkaller.appspotmail.com, Chengming Zhou , "Peter Zijlstra (Intel)" , Tejun Heo , Zhouyi Zhou , Marek Szyprowski , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220305034103.57123-1-zhouchengming@bytedance.com> References: <20220305034103.57123-1-zhouchengming@bytedance.com> MIME-Version: 1.0 Message-ID: <164708862156.16921.16724154187249548862.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 The following commit has been merged into the sched/core branch of tip: Commit-ID: f2aa197e4794bf4c2c0c9570684f86e6fa103e8b Gitweb: https://git.kernel.org/tip/f2aa197e4794bf4c2c0c9570684f86e6fa103e8b Author: Chengming Zhou AuthorDate: Sat, 05 Mar 2022 11:41:03 +08:00 Committer: Peter Zijlstra CommitterDate: Sat, 12 Mar 2022 13:22:11 +01:00 cgroup: Fix suspicious rcu_dereference_check() usage warning task_css_set_check() will use rcu_dereference_check() to check for rcu_read_lock_held() on the read-side, which is not true after commit dc6e0818bc9a ("sched/cpuacct: Optimize away RCU read lock"). This commit drop explicit rcu_read_lock(), change to RCU-sched read-side critical section. So fix the RCU warning by adding check for rcu_read_lock_sched_held(). Fixes: dc6e0818bc9a ("sched/cpuacct: Optimize away RCU read lock") Reported-by: Linux Kernel Functional Testing Reported-by: syzbot+16e3f2c77e7c5a0113f9@syzkaller.appspotmail.com Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Tejun Heo Tested-by: Zhouyi Zhou Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20220305034103.57123-1-zhouchengming@bytedance.com --- include/linux/cgroup.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 1e356c2..0d1ada8 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -450,6 +450,7 @@ extern struct mutex cgroup_mutex; extern spinlock_t css_set_lock; #define task_css_set_check(task, __c) \ rcu_dereference_check((task)->cgroups, \ + rcu_read_lock_sched_held() || \ lockdep_is_held(&cgroup_mutex) || \ lockdep_is_held(&css_set_lock) || \ ((task)->flags & PF_EXITING) || (__c))