From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0365AC4360C for ; Thu, 10 Oct 2019 09:26:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CED722067B for ; Thu, 10 Oct 2019 09:26:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387730AbfJJJ0y (ORCPT ); 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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