lkml.org 
[lkml]   [2020]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next] bpf: btf: Fix arg verification in btf_ctx_access()
On Mon, Mar 30, 2020 at 7:43 AM KP Singh <kpsingh@chromium.org> wrote:
>
> From: KP Singh <kpsingh@google.com>
>
> The bounds checking for the arguments accessed in the BPF program breaks
> when the expected_attach_type is not BPF_TRACE_FEXIT, BPF_LSM_MAC or
> BPF_MODIFY_RETURN resulting in no check being done for the default case
> (the programs which do not receive the return value of the attached
> function in its arguments) when the index of the argument being accessed
> is equal to the number of arguments (nr_args).
>
> This was a result of a misplaced "else if" block introduced by the
> Commit 6ba43b761c41 ("bpf: Attachment verification for
> BPF_MODIFY_RETURN")
>
> Signed-off-by: KP Singh <kpsingh@google.com>
> Fixes: 6ba43b761c41 ("bpf: Attachment verification for BPF_MODIFY_RETURN")
> Reported-by: Jann Horn <jannh@google.com>

Applied. Thanks

\
 
 \ /
  Last update: 2020-03-30 22:33    [W:0.068 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site