Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp370557pxa; Wed, 26 Aug 2020 12:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/128h9C4oYYMLlPmLx47UwF1cTMzvKRdQY3e5w8P+TTx8fIzV2o0lSJPe/9PpSuQt/Fei X-Received: by 2002:a17:906:90d3:: with SMTP id v19mr17059785ejw.23.1598471789486; Wed, 26 Aug 2020 12:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598471789; cv=none; d=google.com; s=arc-20160816; b=PTqmVBmvqm4PyV6eC5raWjb9FEe3d41MpwYvdziKOJfElkGHc/KR9ajzYiT90NlDbK jBVZanua+Cpo4mTJuq6WLQZ15bZRNGpQhQAmE/f8vak2wLL1zS2/cOCBE9KltfgcgmTX toiSStIRKlUhy+9U0NuGJ3e9OhSAJIG8WrUAR4bq0vMIkc5Wt5jiiqlNQ6Xg0i3NxKZd ofRpHqagVQXF0Vg8+NwuLVa0CVahz2faj0UT1WIg0eMSzE2BztgXleXSio8w71ln5/Nb qpTp6JdJXzgT9pR9ZM/VDaT8uZmIbHFIEWdvsf6UIlewx9zZcUAiDNGxIu+ioGWDvxjw 6dTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=94/SNbSIYD+Xo9JGqNVO2RH4yAJNdDu/Srjv1flV1xU=; b=dyEH8kdOjy7e2HMhXxm/v2930/5qNvhi/yFCxpSdZaMxAJWGK1ePpv33kD3nr+VyxJ Igh8oWFteeb5Gv1P0opFvfnHZ+cRBWm7e6jRgZ44aQDvn52kqcoOhyxkd52UQ1mVjGmZ jp6RVe2DIqp3TFYoJGlhLvxRHLMW8FiKKLiAMX3wwduiM7u4Qbx88jxlqQQbBMGlIKEE RUT1Bvx+HdwHkP2P8I13ffbGnctKVT0rb5TQ8Ig8Qyo9N9zeUg3jEDlnkRLMiAVum7t7 /DWl4Ku9fQVX7UmY4Zpe7a1pVH2tx8tDNvDg4TfYwTjXE+ONywwejdKfFnewf7It1Gcf mzyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B9oo0fYO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si2102897eje.669.2020.08.26.12.56.03; Wed, 26 Aug 2020 12:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B9oo0fYO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbgHZTwy (ORCPT + 99 others); Wed, 26 Aug 2020 15:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726794AbgHZTwy (ORCPT ); Wed, 26 Aug 2020 15:52:54 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A0A3C061574; Wed, 26 Aug 2020 12:52:54 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id 67so1619774pgd.12; Wed, 26 Aug 2020 12:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=94/SNbSIYD+Xo9JGqNVO2RH4yAJNdDu/Srjv1flV1xU=; b=B9oo0fYO83YraeDiISzi9wTvMOYANVtCssR31gsYfbP26/yLDn62YivLWh28/HRLuW 5E3flOJzN9eMe0WK11fWSUldNF/kjJWzEexyBSQpp1894bKqzkJJskj14VIxYVK9qXL9 P6730iOT4DKPNAbcDlNxN9BWambABkuUnFs/8Sf+v60d6o2+G5/yFZvd/tvE4Ui+r3Wb XnYazDzrSHPsbHTIgiFfAofWF0M/qqH1eHN6ZfMhl1JD1NacfmnQNrYyP5LatergKUnF /PFzdw3koueaaOVUGFClaZrew8vDS3NBRo5OhH1q8zxDtPm5n/Zlp5xkeI7cAskhQ6Wk gTfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=94/SNbSIYD+Xo9JGqNVO2RH4yAJNdDu/Srjv1flV1xU=; b=d/t53aXHiH54vIMCYmG0ZeNyuPHsBYGsFVr8yNEN4YmXtZZ2fvEqcNjum3xnWIEzP8 MILzApx5QBxzDPhns8CzeJyrAlLiieX1gSbJaVmReyrenm1Qw1bGxy7tvSXZrSfAhMB9 EBPUODg61CpbzVRatQylopD1ZQq0iAvP/1INgQi8ADarsLqA8TjmFksZLW508ElwlRtk SmR8qWdMZK7tuJ5TwaVZO8VHyjgvcU/8dJ9zTv7PeMPgKLHR3MC3Kwsuel28QksJLGlP eyTGgaSJGQMxyKifkHnhb0Oeo8bg5ksxHoYiUhgpFwkQIhjyVH2GzduWD6HHkMopwgxy BSvQ== X-Gm-Message-State: AOAM532jFjz62QUuBVdhbykj953jFSGu+jQLJPt5HFQFjSa8V2w5qQzw 3VjRVUOyQyWtpZBa8fLr3KQ= X-Received: by 2002:a65:670d:: with SMTP id u13mr11775755pgf.280.1598471573542; Wed, 26 Aug 2020 12:52:53 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:400::5:8e18]) by smtp.gmail.com with ESMTPSA id x12sm3738117pff.48.2020.08.26.12.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Aug 2020 12:52:52 -0700 (PDT) Date: Wed, 26 Aug 2020 12:52:50 -0700 From: Alexei Starovoitov To: Udip Pant Cc: Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , "David S . Miller" , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH bpf-next v3 0/4] bpf: verifier: use target program's type for access verifications Message-ID: <20200826195250.jnbl3oca5lqrdgbs@ast-mbp.dhcp.thefacebook.com> References: <20200825232003.2877030-1-udippant@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825232003.2877030-1-udippant@fb.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2020 at 04:19:59PM -0700, Udip Pant wrote: > This patch series adds changes in verifier to make decisions such as granting > of read / write access or enforcement of return code status based on > the program type of the target program while using dynamic program > extension (of type BPF_PROG_TYPE_EXT). > > The BPF_PROG_TYPE_EXT type can be used to extend types such as XDP, SKB > and others. Since the BPF_PROG_TYPE_EXT program type on itself is just a > placeholder for those, we need this extended check for those extended > programs to actually work with proper access, while using this option. > > Patch #1 includes changes in the verifier. > Patch #2 adds selftests to verify write access on a packet for a valid > extension program type > Patch #3 adds selftests to verify proper check for the return code > Patch #4 adds selftests to ensure access permissions and restrictions > for some map types such sockmap. > > Changelogs: > v2 -> v3: > * more comprehensive resolution of the program type in the verifier > based on the target program (and not just for the packet access) > * selftests for checking return code and map access > * Also moved this patch to 'bpf-next' from 'bpf' tree Applied. Thanks