Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1168614pxm; Thu, 3 Mar 2022 11:40:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyOeJfFCYG++J4w0j0z4o8Gcw0tIDoqqZr82gIaglN4RcmDxp/2ppPa0oagqsoXeTXKnGF X-Received: by 2002:a17:907:7711:b0:6ce:e03c:e1e2 with SMTP id kw17-20020a170907771100b006cee03ce1e2mr28685357ejc.769.1646336441727; Thu, 03 Mar 2022 11:40:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646336441; cv=none; d=google.com; s=arc-20160816; b=TKTKjjCFb86PJ4ao88+DfGAAzEpUjcSH5/gvI5vDqN0/uWoaYK/3UXpy7wDGCr8UBu 9C+oMUNh4RDhFKw9EEYSq8jV2Y3OfjKMwzPJZjJzfadOdORjRbJcGTrrF+iZcj8Sg0oX uUVkX0EMyjZCEm97W3I17Cn3jEfzxWAWn9jfKn8ZWMQ6wNlZbR1PZJTnfJYdb8CAPdYW 1RNglMerAP72HJsolPnTVQmV2anmzXxq8OshbtGC5FikfdteFxIG8oVQVzKQTBx3a7BS dFt/1h8mqcMlFqqeDwTiwyLeg8kfFxWeueKSlZ2nJDedPYnp67QHdeZp+R5b17XB4Lgm L44w== 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=lsaEHQfA1sz4dIz7RuOmeFmwQ50xPsxwpOfXV6GcrSY=; b=wKhI6uTHpaxScmdyZki+xjMXtPmtyt7xeE1ytRmYL/B0ZyUaxc4PkGIoEgd7pUlYr0 FNK8rywilrAXGwwXQTKCYSCTlzxnlXfLV7cO+fpoR9nnclXbO8aNQQ6MpQCyJQJ3+o3C izFeEpUOyhhyckoDS1yktucdUHlt/ax0JiGUA0H+mNeuAGqJJXTBakFkVWyeU8xLcPQC OTSPETjz9NtsazbE7OqAIMEcZGwP2ZsiinVODoOcOSX/EMc1ga33vEwKphd8PXuVLqG5 xrtlGnf39LAYB+EkIHntfdNfaF3Qf1ZPSL4Gn+OJSapCb9vER7phVHmIfDpOsWK8VFAp gTMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=WFhZgrwW; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs1-20020a1709073e8100b006da68ea5bc3si2438390ejc.692.2022.03.03.11.40.18; Thu, 03 Mar 2022 11:40:41 -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=@google.com header.s=20210112 header.b=WFhZgrwW; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232947AbiCCTQ6 (ORCPT + 99 others); Thu, 3 Mar 2022 14:16:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231392AbiCCTQ4 (ORCPT ); Thu, 3 Mar 2022 14:16:56 -0500 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62CC5159287 for ; Thu, 3 Mar 2022 11:16:10 -0800 (PST) Received: by mail-qt1-x833.google.com with SMTP id bt3so5531969qtb.0 for ; Thu, 03 Mar 2022 11:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lsaEHQfA1sz4dIz7RuOmeFmwQ50xPsxwpOfXV6GcrSY=; b=WFhZgrwWbToo16XgHphmOomHbJQdCxEPHin71iF410pvZwItSq5Nm2njs/dGmhcbSn jSouYRwLqNZejipDZAyJ2kuJlJ1XNTSnrw89DVI6/fX78vv0IeoqgeZJd74pM6JfBlzS 7Z1l6bEbCDApCjcas9a3MBSeDx9UDyIDfJqSNjtwasWUQVrJ2bcbnTaW/i6U85TRYBGK CUPcsg9EEObKittAM/kAsgK2XmEI2gnFcupNkEdXgo/yRrK4mEMFfTuZ9yJ5igIgf8Lq C8hmJgsJV/04ng4dsVVVVlHWs/e+PJPEtuHG4f6ECeu7ma3l/jZzVztpMwOJIVHgJNIi esRQ== 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=lsaEHQfA1sz4dIz7RuOmeFmwQ50xPsxwpOfXV6GcrSY=; b=TkXNh8Gu8SeEZMyf4Hx9DDAk40taBcLC2Z5/CXmV2dDGFjAhoWBoRoqdhXRijAU2UX S+Wb5TJm5gbnnrDPsXnT+nw0bfvfk5NIEUGWYadl3aS/LrTNGqDp0f4p3fiyE7TLfEwE CGxs1ZNo/erEfTZ/5xwlrKQW2yJvS1VP5b+vwGKZ1DAXVc8sohfEESCmX4qc1ne1skzJ gPOvCrFZtlhlAzaBJjwVFdoi10wZg2Bp/R4WRtvoNdXoOfLI21dD8M+SNeiDghYnJ5a0 DxLfh3kq9ufCB35VJ/Lg8Z6GormcC+djbAkNqhpfcP9A9KUkyEpU69qo71ZpSX1Pwdd2 khpQ== X-Gm-Message-State: AOAM533zvi8X/vZU8iglWzrzfyIGPEa3obF05DOGXywED90aWOz548CF pjQf9xypTYFLGOYXgm/270eKbmC7TTChByhAKlu6Dg== X-Received: by 2002:a05:622a:4d1:b0:2de:676:d2bd with SMTP id q17-20020a05622a04d100b002de0676d2bdmr29208228qtx.565.1646334969373; Thu, 03 Mar 2022 11:16:09 -0800 (PST) MIME-Version: 1.0 References: <20220225234339.2386398-1-haoluo@google.com> <20220225234339.2386398-2-haoluo@google.com> <7e862b1c-7818-6759-caf1-962598d2c8b3@fb.com> <2c5669f1-b9d9-ee78-c5ee-d29a41d4d70a@fb.com> In-Reply-To: <2c5669f1-b9d9-ee78-c5ee-d29a41d4d70a@fb.com> From: Hao Luo Date: Thu, 3 Mar 2022 11:15:57 -0800 Message-ID: Subject: Re: [PATCH bpf-next v1 1/9] bpf: Add mkdir, rmdir, unlink syscalls for prog_bpf_syscall To: Yonghong Song Cc: Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin KaFai Lau , Song Liu , KP Singh , Shakeel Butt , Joe Burton , Tejun Heo , joshdon@google.com, sdf@google.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Thu, Mar 3, 2022 at 11:13 AM Yonghong Song wrote: > > > > On 3/3/22 10:56 AM, Hao Luo wrote: > > On Wed, Mar 2, 2022 at 12:55 PM Yonghong Song wrote: > >> On 2/25/22 3:43 PM, Hao Luo wrote: > >>> @@ -5086,6 +5086,29 @@ union bpf_attr { > >>> * Return > >>> * 0 on success, or a negative error in case of failure. On error > >>> * *dst* buffer is zeroed out. > >>> + * > >>> + * long bpf_mkdir(const char *pathname, int pathname_sz, u32 mode) > >> > >> Can we make pathname_sz to be u32 instead of int? pathname_sz should > >> never be negative any way. > >> > >> Also, I think it is a good idea to add 'u64 flags' parameter for all > >> three helpers, so we have room in the future to tune for new use cases. > >> > > > > SG. Will make this change. > > > > Actually, I think I need to cap patthname_sz from above, to ensure > > pathname_sz isn't too big. Is that necessary? I see there are other > > helpers that don't have this type of check. > > There is no need. The verifier should ensure the memory held by pathname > will have at least size of pathname_sz. > SG. Thanks!