Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28139341rwd; Tue, 4 Jul 2023 13:46:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlHFFkXZ7zJt53SaIx6nX9Ai2ORdNJobsFJsQsDGmKKMQdxnBFQFt+Ml2V+KUKRqn1Oqa3/w X-Received: by 2002:a17:902:ea0a:b0:1ae:6290:26d with SMTP id s10-20020a170902ea0a00b001ae6290026dmr14126142plg.7.1688503583822; Tue, 04 Jul 2023 13:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688503583; cv=none; d=google.com; s=arc-20160816; b=jbSQglYAKAN+ieJ/5+9Fy1jgk/8Wfk8Ub/q4QVPiOI3TU+mSzKBlitmGE7pOIC7EEn JRA+ZMv42ni8rsWeHAWGdLKF/RAWuubsnlpIvbIMkcy/YzHv1R7/XpZWPV5xpyBFQl99 G6XNjt0RJze5oCBE/Jm5U3MsnKD6hCtczBlIMJD9JOMLs/ayDsDOMPhxbEcswCJ53/71 noKeZTBp1ZWjp7TQTd4QF6JzaKiNUq3TaKoxN4sjHUOqDEu0b4pNBRFH+tnPrM4qpxE0 H80sS+jEy5IvTTbZCRiWHvFp9KKDeZyUYI1LZjkmAwn+Ma97RwzuTUeJEzu85jpxng6d vd7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature; bh=l7XPpmXPKULcSNKFHOiaThIw0bNpc1fhA17NvZRfZko=; fh=Z/SU7mAS2aydwNfTe4epriNT3up2DnSDAJYonQWPueg=; b=Tl3S7bhV6zl0nvtKzj8QZCSsPsWAqFcqNv2o3p1wjGwju2D/Xl8/AVMQQjVwbn/uOd j7Xu7sWaW1/TDBjrVFAENRVIumtaAXMNLCHiGb3E9/aDAbrg1ybSqe8/C+WQI7WZyHm+ QAf8BI4K20k0lG70uFuTiU0DteWX3xscDoGcZ3bIaHevesOFKDVgTOzQW2LGt/AytIPS Sidi5pxaV4b8jJkzEfSko/O1DYfSxYItdnl2rAJGU6qljCRAOAW/9lXU7j9oHtG/38oc 6bZ1lFO3pogpTgNDSLXmBQBL5oe4cHhdHpbuP/zArN2MsGdFmbGElF7pxsnv3XCA/Y9+ PeOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ci6kXfZf; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg4-20020a17090326c400b001b802119862si17690053plb.627.2023.07.04.13.46.11; Tue, 04 Jul 2023 13:46:23 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=Ci6kXfZf; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbjGDU1O (ORCPT + 99 others); Tue, 4 Jul 2023 16:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjGDU1M (ORCPT ); Tue, 4 Jul 2023 16:27:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BC0BE7B for ; Tue, 4 Jul 2023 13:27:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7E88961382 for ; Tue, 4 Jul 2023 20:27:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3982FC433CA; Tue, 4 Jul 2023 20:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688502430; bh=iy5HUoGWTmpxSmUZjQ7hawlWnCOJsYYvnUq8MjJB9z8=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=Ci6kXfZf1O1MqOZcgOdTuORv5v8w6CmGXOKCzTuY88/inW894MEyA7DRy27w/3+4c bbmiw7pj2zPj3ikbYw1J85MatELjtHtES8+3Zo7U8p1LFu6M3dHJbNMQapbmWSHpZq qGn5kzZ55V2OhtDR6xrz5Qd9fTQ9FMTQor/I260tSYAmaFW1tvFmkXlZdGkxpS8WC/ ABWzssv0KeFdaBquM7j/4FaDpPpp7slap6ld0n8sxL3KNKnbAk3aFpar5G6CFuOiv0 G2uygMS+ovRqbgpGJdJgUU1+ceYYwJjT/CcSeuKp8UJNOKbQnmeprEXaqd1arfbELg 0CfDZxTzTVYng== Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 1C55027C0054; Tue, 4 Jul 2023 16:27:09 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 04 Jul 2023 16:27:09 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeggddugeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugeskhgvrhhnvghlrdhorhhgqeenucggtf frrghtthgvrhhnpedvtddtffejfeeggefgleefgfeghfehfeefffetgffgleegudevveet hfefjeevkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrrhhnugdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidquddvkeehudej tddvgedqvdekjedttddvieegqdgrrhhnugeppehkvghrnhgvlhdrohhrghesrghrnhgusg druggv X-ME-Proxy: Feedback-ID: i36794607:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 88EECB60086; Tue, 4 Jul 2023 16:27:08 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-527-gee7b8d90aa-fm-20230629.001-gee7b8d90 Mime-Version: 1.0 Message-Id: <753120c5-dcf4-46ff-9319-e8aa035e2488@app.fastmail.com> In-Reply-To: References: <20230703175048.151683-1-jthinz@mailbox.tu-berlin.de> <64a33ce7b50d2_6520520875@john.notmuch> Date: Tue, 04 Jul 2023 22:26:47 +0200 From: "Arnd Bergmann" To: "Willem de Bruijn" , =?UTF-8?Q?J=C3=B6rn-Thorben_Hinz?= Cc: "John Fastabend" , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Netdev , linux-kselftest@vger.kernel.org, "Alexei Starovoitov" , "Daniel Borkmann" , "Andrii Nakryiko" , "Martin KaFai Lau" , "David S . Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , shuah , "Willem de Bruijn" , "Deepa Dinamani" Subject: Re: [PATCH 0/2] bpf, net: Allow setting SO_TIMESTAMPING* from BPF Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, Jul 4, 2023, at 21:36, Willem de Bruijn wrote: >> On Mon, 2023-07-03 at 14:25 -0700, John Fastabend wrote: >> > J=C3=B6rn-Thorben Hinz wrote: >> Yes, if there is no objection to making the added >> getsockopt(SO_TIMESTAMPING_NEW) this tiny bit more =E2=80=9Cstrict=E2= =80=9D, it=E2=80=99s just >> a matter of modifying the if inserted in sk_getsockopt(). (And, well, >> in the other case I would even remove this if.) > > The difference is in the struct that is returned, on 32-bit platforms. > Both calls should always be allowed? See also > put_cmsg_scm_timestamping64 vs put_cmsg_scm_timestamping. > > For the second patch: the _OLD/_NEW was introduced to work around > limitations on 32-bit platforms. This is intended to be transparent to > users, by defining SO_TIMESTAMPING accordingly. > > Can the new BPF code always enforce the 64-bit version, that is, only > implement the _NEW variants? And perhaps just call it SO_TIMESTAMPING > directly. I guess that depends on how the returned timestamps are interpreted. In normal userspace code, the 'struct scm_timestamping' is defined in terms of the libc-provided 'struct timespec'. If this is a normal glibc based distro binary, then it probably expects the old format. OTOH, if the code reading the timestamp data is in BPF code itself, it's probably safe to mandate that to use the time64 format and define the timespec type as __kernel_timespec with 64-bit members. Arnd