[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4Bzbjx8Hpozi9eaa2da2K9WbA_xA0tVrp_+3DHN4GgKmeXw@mail.gmail.com>
Date: Fri, 13 Nov 2020 12:06:50 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Dmitrii Banshchikov <me@...que.spb.ru>
Cc: bpf <bpf@...r.kernel.org>, Kernel Team <kernel-team@...com>,
Andrey Ignatov <rdna@...com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin Lau <kafai@...com>, Song Liu <songliubraving@...com>,
Yonghong Song <yhs@...com>,
Andrii Nakryiko <andrii@...nel.org>,
john fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>,
Toke Høiland-Jørgensen <toke@...hat.com>,
Networking <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf v2] bpf: relax return code check for subprograms
On Fri, Nov 13, 2020 at 9:18 AM Dmitrii Banshchikov <me@...que.spb.ru> wrote:
>
> Currently verifier enforces return code checks for subprograms in the
> same manner as it does for program entry points. This prevents returning
> arbitrary scalar values from subprograms. Scalar type of returned values
> is checked by btf_prepare_func_args() and hence it should be safe to
> allow only scalars for now. Relax return code checks for subprograms and
> allow any correct scalar values.
>
> Signed-off-by: Dmitrii Banshchikov <me@...que.spb.ru>
> Fixes: 51c39bb1d5d10 (bpf: Introduce function-by-function verification)
> ---
LGTM!
Acked-by: Andrii Nakryiko <andrii@...nel.org>
> v1 -> v2:
> - Move is_subprog flag determination to check_return_code()
> - Remove unneeded intermediate function from tests
> - Use __noinline instead of __attribute__((noinline)) in tests
>
> kernel/bpf/verifier.c | 15 +++++++++++++--
> .../bpf/prog_tests/test_global_funcs.c | 1 +
> .../selftests/bpf/progs/test_global_func8.c | 19 +++++++++++++++++++
> 3 files changed, 33 insertions(+), 2 deletions(-)
> create mode 100644 tools/testing/selftests/bpf/progs/test_global_func8.c
>
[...]
Powered by blists - more mailing lists