From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH 4.9] bpf/verifier: Fix states_equal() comparison of pointer and UNKNOWN Date: Fri, 22 Dec 2017 19:51:42 -0800 Message-ID: <20171223035140.mcv34grauxixvxsi@ast-mbp> References: <20171223022617.GO2971@decadent.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Greg Kroah-Hartman , stable@vger.kernel.org, netdev@vger.kernel.org, Edward Cree , Jann Horn , Alexei Starovoitov To: Ben Hutchings Return-path: Received: from mail-pg0-f42.google.com ([74.125.83.42]:34596 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757161AbdLWDvp (ORCPT ); Fri, 22 Dec 2017 22:51:45 -0500 Content-Disposition: inline In-Reply-To: <20171223022617.GO2971@decadent.org.uk> Sender: netdev-owner@vger.kernel.org List-ID: On Sat, Dec 23, 2017 at 02:26:17AM +0000, Ben Hutchings wrote: > An UNKNOWN_VALUE is not supposed to be derived from a pointer, unless > pointer leaks are allowed. Therefore, states_equal() must not treat > a state with a pointer in a register as "equal" to a state with an > UNKNOWN_VALUE in that register. > > This was fixed differently upstream, but the code around here was > largely rewritten in 4.14 by commit f1174f77b50c "bpf/verifier: rework > value tracking". The bug can be detected by the bpf/verifier sub-test > "pointer/scalar confusion in state equality check (way 1)". > > Signed-off-by: Ben Hutchings > Cc: Edward Cree > Cc: Jann Horn > Cc: Alexei Starovoitov Acked-by: Alexei Starovoitov