Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2115949ybp; Thu, 10 Oct 2019 02:27:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfK7kWgaFuDvaqj+C6NP9MVrfsaQe1dmgT++U/gctLZTgdRnSrg3xMSCNoqZ85qSUpOaph X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr7096491ejn.53.1570699655448; Thu, 10 Oct 2019 02:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570699655; cv=none; d=google.com; s=arc-20160816; b=k6e8i1Aq6BJYiEsaBe6SKH11mDFfeeqHbVFej7aNmZ5TJnE9AQWqXDRdU+MW5xIzI2 NN0Ctkcaa5FjPggpkLhjSd0zB994ydN4ap4Y1LpWnxD90yo7sMz1062sTAheq96SyIe2 6GyarjS+VEPRWxcRTs9geDik5j95vG5fm9PQ8zJrjcHHj0O+xlJaCvFdJFAQAjc406P0 4XkSaBdMbckg8XKsi6cMNPJwX8ClwByEgahJRHWPy7Vq5zO8D1KV7OyGkygdvXFIfs0s 5mgPLOeMHx2Q8ypEvj5s7DpQc9M9IIG5NytmX08rHWcC1QqMKx5KfLALfPu2DrEBxAuL E9Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=78c4s3Uqy4Duqw3Nmjg4eYIJ6CUgxspQuHgDywcSc9o=; b=V4KhAUpMtoDfGeNLQGI1dUEyUpH1dW0pXznnbPSE7XQ7+220xDtA/CiLbEXYFY/0ai D4voh8CkNIY5/oMMsxbabSS3EPCzGav6vtb9hUzVNhOM1Ye6mqiq32r3DNfLTnxljnlQ chcOh9iJKZ2Rwf5oe/CO6vfZPKqh/3H1lhMt6v80wNIx4b+KZnpv9W0k47ym/ykfUB0P 9YOpyQcCSZXPXC0k7nlOFV2A8K11e6AbVMBc5DKB2s4d2thxxazFEM3m1JQLgKneJ79z Ugd7Iext2aCfK3tP25hwWNaEWXLaozUDqEDNxRZ6lQybIzHXX8LJ+d/qcszeRCjjjuDT u4Zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si2743396ejh.169.2019.10.10.02.27.12; Thu, 10 Oct 2019 02:27:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387799AbfJJJ0y (ORCPT + 99 others); Thu, 10 Oct 2019 05:26:54 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:48506 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727320AbfJJJ0y (ORCPT ); Thu, 10 Oct 2019 05:26:54 -0400 Received: from [193.96.224.244] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iIUif-0005xu-US; Thu, 10 Oct 2019 09:26:50 +0000 Date: Thu, 10 Oct 2019 11:26:48 +0200 From: Christian Brauner To: Alexei Starovoitov Cc: Alexei Starovoitov , Daniel Borkmann , bpf , Martin KaFai Lau , Song Liu , Yonghong Song , Network Development , LKML Subject: Re: [PATCH 0/3] bpf: switch to new usercopy helpers Message-ID: <20191010092647.cpxh7neqgabq36gt@wittgenstein> References: <20191009160907.10981-1-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 09, 2019 at 04:06:18PM -0700, Alexei Starovoitov wrote: > On Wed, Oct 9, 2019 at 9:09 AM Christian Brauner > wrote: > > > > Hey everyone, > > > > In v5.4-rc2 we added two new helpers check_zeroed_user() and > > copy_struct_from_user() including selftests (cf. [1]). It is a generic > > interface designed to copy a struct from userspace. The helpers will be > > especially useful for structs versioned by size of which we have quite a > > few. > > > > The most obvious benefit is that this helper lets us get rid of > > duplicate code. We've already switched over sched_setattr(), perf_event_open(), > > and clone3(). More importantly it will also help to ensure that users > > implementing versioning-by-size end up with the same core semantics. > > > > This point is especially crucial since we have at least one case where > > versioning-by-size is used but with slighly different semantics: > > sched_setattr(), perf_event_open(), and clone3() all do do similar > > checks to copy_struct_from_user() while rt_sigprocmask(2) always rejects > > differently-sized struct arguments. > > > > This little series switches over bpf codepaths that have hand-rolled > > implementations of these helpers. > > check_zeroed_user() is not in bpf-next. > we will let this set sit in patchworks for some time until bpf-next > is merged back into net-next and we fast forward it. > Then we can apply it (assuming no conflicts). Sounds good to me. Just ping me when you need me to resend rebase onto bpf-next. Christian