[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200106222454.6ajkzw4s2vfq2mye@ast-mbp>
Date: Mon, 6 Jan 2020 14:24:55 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: ast@...nel.org, netdev@...r.kernel.org, bpf@...r.kernel.org,
anatoly.trosinenko@...il.com
Subject: Re: [PATCH bpf] bpf: Fix passing modified ctx to ld/abs/ind
instruction
On Mon, Jan 06, 2020 at 10:51:57PM +0100, Daniel Borkmann wrote:
> Anatoly has been fuzzing with kBdysch harness and reported a KASAN
> slab oob in one of the outcomes:
>
> After further debugging, turns out while in case of other helper functions
> we disallow passing modified ctx, the special case of ld/abs/ind instruction
> which has similar semantics (except r6 being the ctx argument) is missing
> such check. Modified ctx is impossible here as bpf_skb_load_helper_8_no_cache()
> and others are expecting skb fields in original position, hence, add
> check_ctx_reg() to reject any modified ctx. Issue was first introduced back
> in f1174f77b50c ("bpf/verifier: rework value tracking").
>
> Fixes: f1174f77b50c ("bpf/verifier: rework value tracking")
> Reported-by: Anatoly Trosinenko <anatoly.trosinenko@...il.com>
> Signed-off-by: Daniel Borkmann <daniel@...earbox.net>
Applied, Thanks
Powered by blists - more mailing lists