From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nadav Amit via iovisor-dev Subject: Re: [PATCH v3 net-next 02/12] bpf/verifier: rework value tracking Date: Thu, 6 Jul 2017 14:21:46 -0700 Message-ID: References: <2244b48b-f415-3239-6912-cb09f0abc546@solarflare.com> Reply-To: Nadav Amit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Alexei Starovoitov , netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iovisor-dev , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org To: Edward Cree Return-path: In-Reply-To: <2244b48b-f415-3239-6912-cb09f0abc546-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iovisor-dev-bounces-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public.gmane.org Errors-To: iovisor-dev-bounces-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public.gmane.org List-Id: netdev.vger.kernel.org Edward Cree via iovisor-dev wrote: > Tracks value alignment by means of tracking known & unknown bits. > Tightens some min/max value checks and fixes a couple of bugs therein. > If pointer leaks are allowed, and adjust_ptr_min_max_vals returns -EACCES, > treat the pointer as an unknown scalar and try again, because we might be > able to conclude something about the result (e.g. pointer & 0x40 is either > 0 or 0x40). > > Signed-off-by: Edward Cree > --- > include/linux/bpf.h | 34 +- > include/linux/bpf_verifier.h | 40 +- > include/linux/tnum.h | 79 ++ > kernel/bpf/Makefile | 2 +- > kernel/bpf/tnum.c | 163 ++++ > kernel/bpf/verifier.c | 1692 ++++++++++++++++++++++++------------------ > 6 files changed, 1235 insertions(+), 775 deletions(-) (RESEND) I find it a bit surprising that such huge changes that can affect security and robustness are performed in one patch. Personally, I cannot comprehend all of these changes. In addition, I think that it is valuable to describe in detail the bugs that the patch solves and when they were introduced. I can bring up some concerns regarding inconsistencies in offset checks and size, not spilling SCALAR and my wish not to limit packet size. However, when the patch is that big, I think it is useless. Nadav