From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:44586 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbeKFKAD (ORCPT ); Tue, 6 Nov 2018 05:00:03 -0500 Date: Mon, 5 Nov 2018 19:37:28 -0500 From: Sasha Levin To: Daniel Borkmann Cc: gregkh@linuxfoundation.org, ast@kernel.org, stable@vger.kernel.org, Edward Cree Subject: Re: [PATCH stable 4.18/4.19] bpf: fix partial copy of map_ptr when dst is scalar Message-ID: <20181106003728.GA194472@sasha-vm> References: <1ab319ff13f6d6a3411ada64c5e2e2d4ac0988d9.1541107505.git.daniel@iogearbox.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1ab319ff13f6d6a3411ada64c5e2e2d4ac0988d9.1541107505.git.daniel@iogearbox.net> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Nov 01, 2018 at 10:29:53PM +0100, Daniel Borkmann wrote: >commit 0962590e553331db2cc0aef2dc35c57f6300dbbe upstream. > >ALU operations on pointers such as scalar_reg += map_value_ptr are >handled in adjust_ptr_min_max_vals(). Problem is however that map_ptr >and range in the register state share a union, so transferring state >through dst_reg->range = ptr_reg->range is just buggy as any new >map_ptr in the dst_reg is then truncated (or null) for subsequent >checks. Fix this by adding a raw member and use it for copying state >over to dst_reg. > >Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") >Signed-off-by: Daniel Borkmann >Cc: Edward Cree >Acked-by: Alexei Starovoitov >Signed-off-by: Alexei Starovoitov >Acked-by: Edward Cree >--- Queued this and the other patch to their respective trees, thank you! -- Thanks, Sasha