From patchwork Fri Oct 18 08:15:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Ridong X-Patchwork-Id: 13841412 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7E1F188CD8; Fri, 18 Oct 2024 08:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729240901; cv=none; b=bUnXWNqYzjhWEc3IO1vp/Z4lOstdo/sNecI5Hlv/GxKJo0SoTWpdmpztYxbLGhRYXvv5X1ioBwDP7hVhyOK8fSS0WxM/jX8aFJqHcWOrzazjfMQkcb0YKCAm9XYPl3V/hiPUAD8+9WDcrFrRLlgGrewNeQ9qj8RRrIgEbjSFxNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729240901; c=relaxed/simple; bh=a2YJZirJGzIYZeRS+aHRtqhhRWyQlxQHufo0zL5B8dM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=nFbHyBMNhfAQa6Xyx9gSbDfGolmf41po1I3k7K2pfXQ0QOc1Da05xQJ8uEgH5lPFF9r1C0TG7JsuLGt2ethMm+W6GSkMgGXU3psf4BZv0+JaiKm+Cd+ku+DX83PGke8dnqWODlbPI6vFz6tI7aBJvh+EvQAX/I/8mOACXW89rMA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=none smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4XVHlv20NBz4f3jkL; Fri, 18 Oct 2024 16:23:39 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.128]) by mail.maildlp.com (Postfix) with ESMTP id 656501A058E; Fri, 18 Oct 2024 16:23:51 +0800 (CST) Received: from hulk-vt.huawei.com (unknown [10.67.174.121]) by APP4 (Coremail) with SMTP id gCh0CgBn58MLGxJnOtqxEQ--.35884S2; Fri, 18 Oct 2024 16:23:51 +0800 (CST) From: Chen Ridong To: tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, longman@redhat.com, mkoutny@suse.com, john.fastabend@gmail.com, roman.gushchin@linux.dev, quanyang.wang@windriver.com, ast@kernel.org Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, chenridong@huawei.com, wangweiyang2@huawei.com Subject: [PATCH v1 0/2] Only cgroup v2 can be attached by bpf programs Date: Fri, 18 Oct 2024 08:15:18 +0000 Message-Id: <20241018081520.694139-1-chenridong@huaweicloud.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CM-TRANSID: gCh0CgBn58MLGxJnOtqxEQ--.35884S2 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY-7kC6x804xWl14x267AKxVW8JVW5JwAF c2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII 0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xv wVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4 x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG 64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r 1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628v n2kIc2xKxwCF04k20xvY0x0EwIxGrwCF54CYxVCY1x0262kKe7AKxVWUtVW8ZwCFx2IqxV CFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r10 6r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxV WUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG 6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr 1UYxBIdaVFxhVjvjDU0xZFpf9x07UQzVbUUUUU= X-CM-SenderInfo: hfkh02xlgr0w46kxt4xhlfz01xgou0bp/ From: Chen Ridong Only cgroup v2 can be attached by bpf programs. This patchset reverts commit 04f8ef5643bc ("cgroup: Fix memory leak caused by missing cgroup_bpf_offline") and avoid cgroup_bpf_inherit and cgroup_bpf_offline being call in cgroup v1. Chen Ridong (2): Revert "cgroup: Fix memory leak caused by missing cgroup_bpf_offline" cgroup/bpf: only cgroup v2 can be attached by bpf programs kernel/cgroup/cgroup.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)