Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp456982pxm; Wed, 2 Mar 2022 20:01:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyalveNxfhTL5GAwPwC4Tv61sjXjVu9GN0hArGRDJRvA6YE0ipwuRnb8Gp+Jhvc6wK4tYjK X-Received: by 2002:a05:6402:26c1:b0:412:8942:64a3 with SMTP id x1-20020a05640226c100b00412894264a3mr32391705edd.1.1646280110787; Wed, 02 Mar 2022 20:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646280110; cv=none; d=google.com; s=arc-20160816; b=0CvrqRYcsWMCMngNIqUWop/+kTgwWuvIV4Hbs/DDD0oyV2NkEzdJVj2VxVdBF/KHvF ICltAGeLMuUphmUH1a9odgAq4kB4g1npKlZ7C1WAECL8du/1YKJWg5q8KNJrL54jo8hz XUUb0LMdANUXoGwEmn5bmtSEIVrX7exOphwOeUYkOwkBGJ4Oq+F1LHjAKyo+n+xbCoff XYSLydcfBb8YJr4g9W8KnCwE+XbA1bcgjJH1znuKxyVuea5G35jsKwrHeE5w5QprIO4d 2SJr1h5LlGPeNph+cSbnBj1Q9FHMvGshznhFtLooI2vAtqTWprytm7HCJq9LNHkI9xB4 XV2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=o8Wnkngh0cz774oXrOB+djrZJAC791wEW1yD76eU3mA=; b=moV/vRBm7q1EiLqqsag3cU1dH2XmJot96WTI/RmxXv4qHTDCjdE9bkqYR8/RSEZK5n hJLesX9030XK6PaFd2LL28b8FwfmRWp9Jpa8lDgL/5Zhm/Qe0GB5JZzh8jQFVn7Qt5IC Xru0ZkjCBTK1S9yAOgQGF2iHjyj+7Bz5ZKFREhOTL+J6n7cOFMEvlImm/QYaBXyYnIUm mU5/CoVZ1RspNt6OWxnEIZrhAw4hZmHaVEg4q+yDAKVx/ietxLBu5Soho6z8RWsD3eUj njQZ0smIe3FRf9e7KDf1XJuaT3ogHXaIA8jpzAg9vHaHmeMxgoHDE7nzTw12TzoSCCzG jooQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Tp2WvHtq; 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=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a056402270c00b00415d563b47fsi587232edd.493.2022.03.02.20.01.28; Wed, 02 Mar 2022 20:01:50 -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=@gmail.com header.s=20210112 header.b=Tp2WvHtq; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbiCCEBY (ORCPT + 99 others); Wed, 2 Mar 2022 23:01:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiCCEBW (ORCPT ); Wed, 2 Mar 2022 23:01:22 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7C7D15C1AE; Wed, 2 Mar 2022 20:00:38 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id gj15-20020a17090b108f00b001bef86c67c1so3581909pjb.3; Wed, 02 Mar 2022 20:00:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o8Wnkngh0cz774oXrOB+djrZJAC791wEW1yD76eU3mA=; b=Tp2WvHtquQCKN/tDLzu1vaBVoEQ+o/F9bItG1ZGG3swOGWYolDkUzu1su5OMP5M18y 8vT4umeQiGvPt6GJ3ToMF1UrPDZNgwgKCcQebodBo5W4KrC/DW4qEVL/qwteae4ShpAC CNwF3BgyY7R0G+JD0obJjowxXXKvsBEAPV8Vp1c46PF9UjRWbLCy+90ngloKQlyIIwCO F+S8H9CKuXW9j+wwGpetgBmvo2+UFNJver6t9i/ucahV9qccHweFgcz8xVQYAz2OZNPF tCqYTYiWNjnB3yKjIPdZaYhY1JB4+zVDwjDhCdEEub+aXiRatMDGmWCyCoK1sYxtFJuF MAJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o8Wnkngh0cz774oXrOB+djrZJAC791wEW1yD76eU3mA=; b=kmA/cVwz5rp+2IhKPhhfExmAhqE1nkyh/Ggn50pnQKUb2N6sUMWA7TGvsJz7uTQCoP tz5N4XO8NnSkmomwiLpMLW7osIe464Gqo8QTgpF1i2OgaMNq6e5+HRjZglaF+Etnvjgp AOltf7UWCvwtwA2CxnHWG3PYq0LytzHjF5iN3zZknH0iUQEC+CavWv0TDtWgGL1Wgu34 INx0Af96icDU9AmhqpY5rtloz88bGlC98Ygci91tuvSfqjd19QSb2nU1IKCOUHR7O7jL a7HC1bFc+mdmHABcIAMmtzbzA8/fgHj8PjKiVTo1ky2RMzrx7sVhYaj69OJmDIuHLQWY 7y1A== X-Gm-Message-State: AOAM531ak5ovgJN9tnF2cMnH0S7oSeWOXJ4CLhgHRqDZEYnc1iIs9HcA hrdezMhxtp8qumlN/G7/zZi5rgMPGGaiXaEGkQ9wt+Xl X-Received: by 2002:a17:902:76c5:b0:14e:e325:9513 with SMTP id j5-20020a17090276c500b0014ee3259513mr34067029plt.55.1646280038108; Wed, 02 Mar 2022 20:00:38 -0800 (PST) MIME-Version: 1.0 References: <20220225234339.2386398-1-haoluo@google.com> <20220225234339.2386398-9-haoluo@google.com> <20220302224506.jc7jwkdaatukicik@apollo.legion> <20220303030349.drd7mmwtufl45p3u@apollo.legion> In-Reply-To: <20220303030349.drd7mmwtufl45p3u@apollo.legion> From: Alexei Starovoitov Date: Wed, 2 Mar 2022 20:00:26 -0800 Message-ID: Subject: Re: [PATCH bpf-next v1 8/9] bpf: Introduce cgroup iter To: Kumar Kartikeya Dwivedi Cc: Yonghong Song , Hao Luo , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin KaFai Lau , Song Liu , KP Singh , Shakeel Butt , Joe Burton , Tejun Heo , Josh Don , Stanislav Fomichev , bpf , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Wed, Mar 2, 2022 at 7:03 PM Kumar Kartikeya Dwivedi wrote: > > > > I think current approach is also not safe if cgroup_id gets reused, right? I.e. > it only does cgroup_get_from_id in seq_start, not at attach time, so it may not > be the same cgroup when calling read(2). kernfs is using idr_alloc_cyclic, so it > is less likely to occur, but since it wraps around to find a free ID it might > not be theoretical. cgroupid is 64-bit.