Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp663443rdb; Tue, 19 Sep 2023 06:53:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpAH4RU9TBHcTPh0Vv3U+SGGQgwIatKtHM17qNosXE4qjkbYsK3H3IIdUqz38pYWvsYKrC X-Received: by 2002:a05:6358:e49c:b0:139:d4f2:b03e with SMTP id by28-20020a056358e49c00b00139d4f2b03emr11271754rwb.6.1695131603810; Tue, 19 Sep 2023 06:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695131603; cv=none; d=google.com; s=arc-20160816; b=mXd2Z1JFaDp1ljggUY7dUlTFMmpoZRxzuIT+w8Y9MZhnu4zE9hFEapcE4KiSGYl3Ua hFvcyjdzKdaheKSJ4M1QPWWr9srZQSaq1tqrPC53GUuLZNgYif0nIEWMmJcDOX9XsT7A YjLSpUXReG56B5DJ2scLi854IK2ZXfjaWxvGL/mMDbLKSPHvDvN6of7GOFW3k9ENcLDP 7SDumrIn5mfxp2Gu+NcAlUKTrAPC1q80DTeeR/Pz9yARwHAAf9mfucPAYNaGiR0U0tTT aWVhCHzpfKeNxHxeTh4U2+CfBoABU44Fh/PM4E44Iv83c6235P7f0KzfhOdO9CeUO1jw UXZw== 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:dkim-signature; bh=9g6vWrt6tsKRvN0adZHQasWroxi3PFQ2Ye6fO6M66RE=; fh=aWualqhZ1OKxVaSfTexDf/5JzxN6tiwKNL7ZrL5MHZQ=; b=wQZ8Dmi6XYZBoSmXYFBzCc+culSp5BSluD5GaxcNyMdzhmjZOeCUxMlQB0rzcXhAis sRo/ZWCyM08t/8zfKbUMl+0muqNF9+CxsyVckXT5iAXjKHeGa4wS1K7447gk5f1sV7t2 5zXp74thgbED2DqTDFRO/aDL+MfJwMwxm/v4+sZe55MedqIoLVIJCfKugIbzrg0LzUvI imXqcweGOPBAZomkApSEMnciIOiJ9qqpmphQNrTNgxrfpyfzQhIBpVTPnYAto0vdpSBS IsVAGk3JfUwAPqmqsP6/Vn+zK+HQMSV0dSrIUSmJKQO5IFZM0p1Do8aMXBbDUePUb2k3 K3jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qNgu3Pfy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id i3-20020a63e903000000b00543c84bf588si9861288pgh.473.2023.09.19.06.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 06:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qNgu3Pfy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E96F881BB3DA; Tue, 19 Sep 2023 06:18:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232240AbjISNSS (ORCPT + 99 others); Tue, 19 Sep 2023 09:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232286AbjISNSP (ORCPT ); Tue, 19 Sep 2023 09:18:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2B31FB; Tue, 19 Sep 2023 06:18:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C133C433C7; Tue, 19 Sep 2023 13:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695129489; bh=B+8I3aKM/91Zhsrq6ewP8IyGv0QxNwN6RyGlRjopINc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qNgu3Pfy4jLszNXbMEb4vwJG05SdOoDIM+ApOEgtH4lxLcQMQ+GdKK2Biq042/jKB Qw9uDXlIZEA+Bf+alZe3RVxZULe1X1it9mZ7dZDcg9sbyNio+WunzJl7LfdX6zvgLi QRXJ5fF+clWvRNzenzBQtQ1F0S1kaFQO1TbWa2w46YTjuwf0N9zk0X+cgfAhtJsjbF HGGLMxZyVMLyjgkIPpo3jx1Ws+j4QQ1U2ILFNpzt+x8j/5G6DXT4QcmlqrBUmySRGE FD8aBeyt95ABKEv/StLzVvwO6FGJPMb5dSJaOjDRYVrMC9R+uGotPcztSM/VIDlpUu tRVmP1CkY9CDw== Date: Tue, 19 Sep 2023 15:18:03 +0200 From: Christian Brauner To: Miklos Szeredi Cc: Matthew House , Miklos Szeredi , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-man@vger.kernel.org, linux-security-module@vger.kernel.org, Karel Zak , Ian Kent , David Howells , Al Viro , Christian Brauner , Amir Goldstein Subject: Re: [RFC PATCH 2/3] add statmnt(2) syscall Message-ID: <20230919-gecheckt-loyal-a3355735afef@brauner> References: <20230918-stuhl-spannend-9904d4addc93@brauner> <20230918-bestialisch-brutkasten-1fb34abdc33c@brauner> <20230919003800.93141-1-mattlloydhouse@gmail.com> <20230919-abfedern-halfen-c12583ff93ac@brauner> <20230919-hackordnung-asketisch-331907800aa0@brauner> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 06:18:24 -0700 (PDT) On Tue, Sep 19, 2023 at 02:59:53PM +0200, Miklos Szeredi wrote: > On Tue, 19 Sept 2023 at 14:41, Christian Brauner wrote: > > > > > > with __u32 size for mnt_root and mnt_point > > > > > > Unnecessary if the strings are nul terminated. > > > > All ok by me so far but how does the kernel know the size of the buffer > > to copy into? Wouldn't it be better to allow userspace to specify that? > > I'm probably just missing something but I better ask. > > Because size of the buffer is given as the syscall argument. > > long statmount(u64 mnt_id, u64 mask, struct statmnt __user *buf, > size_t bufsize, unsigned int flags); > > If you are still hung up about this not being properly typed, how about this: I really just wasn't clear how exactly you envisioned this. Your proposal as is sounds good to me! I'm on board. I prefer the two offsets as that lets us avoid searching for null bytes. So please leave it as is! Thanks!