From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754815AbcIZR6g (ORCPT ); Mon, 26 Sep 2016 13:58:36 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33370 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751340AbcIZR6e (ORCPT ); Mon, 26 Sep 2016 13:58:34 -0400 Date: Mon, 26 Sep 2016 10:58:28 -0700 From: Alexei Starovoitov To: Daniel Borkmann Cc: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , linux-kernel@vger.kernel.org, Alexei Starovoitov , Andy Lutomirski , Kees Cook , Sargun Dhillon , Tejun Heo , netdev@vger.kernel.org Subject: Re: [PATCH v3] bpf: Set register type according to is_valid_access() Message-ID: <20160926175827.GA54376@ast-mbp.thefacebook.com> References: <20160924180150.23620-1-mic@digikod.net> <57E9356D.70308@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <57E9356D.70308@iogearbox.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 26, 2016 at 04:49:17PM +0200, Daniel Borkmann wrote: > On 09/24/2016 08:01 PM, Mickaël Salaün wrote: > >This prevent future potential pointer leaks when an unprivileged eBPF > >program will read a pointer value from its context. Even if > >is_valid_access() returns a pointer type, the eBPF verifier replace it > >with UNKNOWN_VALUE. The register value that contains a kernel address is > >then allowed to leak. Moreover, this fix allows unprivileged eBPF > >programs to use functions with (legitimate) pointer arguments. > > > >Not an issue currently since reg_type is only set for PTR_TO_PACKET or > >PTR_TO_PACKET_END in XDP and TC programs that can only be loaded as > >privileged. For now, the only unprivileged eBPF program allowed is for > >socket filtering and all the types from its context are UNKNOWN_VALUE. > >However, this fix is important for future unprivileged eBPF programs > >which could use pointers in their context. > > > >Signed-off-by: Mickaël Salaün > >Cc: Alexei Starovoitov > >Cc: Daniel Borkmann > > Seems okay to me: > > Acked-by: Daniel Borkmann Acked-by: Alexei Starovoitov Mickael, please mention [PATCH net-next] in subject next time. Thanks