[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH3MdRX5fm7MNu820KS=xejMvvshq_g_YAmEq603Q6Ng1ho4dg@mail.gmail.com>
Date: Fri, 19 Apr 2019 13:11:46 -0700
From: Y Song <ys114321@...il.com>
To: rjmccabe3701 <robert.mccabe@...kwellcollins.com>
Cc: netdev <netdev@...r.kernel.org>, McCabe@...kwellcollins.com
Subject: Re: [PATCH 1/1] [bpf-next] libbpf: fix off-by-one error for BPF_LOG_BUF_SIZE
On Fri, Apr 19, 2019 at 12:32 PM rjmccabe3701
<robert.mccabe@...kwellcollins.com> wrote:
>
> From: "McCabe, Robert J" <Robert.McCabe@...kwellcollins.com>
>
> The BPF_PROG_LOAD condition for kernel version <= 5.1 is
>
> log->len_total > UINT_MAX >> 8 /* (16 * 1024 * 1024) - 1 */
>
> Signed-off-by: McCabe, Robert J <Robert.McCabe@...kwellcollins.com>
Acked-by: Yonghong Song <yhs@...com>
> ---
> tools/lib/bpf/bpf.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
> index bc30783d1403..62d67caa7aea 100644
> --- a/tools/lib/bpf/bpf.h
> +++ b/tools/lib/bpf/bpf.h
> @@ -92,7 +92,7 @@ struct bpf_load_program_attr {
> #define MAPS_RELAX_COMPAT 0x01
>
> /* Recommend log buffer size */
> -#define BPF_LOG_BUF_SIZE (16 * 1024 * 1024) /* verifier maximum in kernels <= 5.1 */
> +#define BPF_LOG_BUF_SIZE ((16 * 1024 * 1024) - 1) /* verifier maximum in kernels <= 5.1 */
> LIBBPF_API int
> bpf_load_program_xattr(const struct bpf_load_program_attr *load_attr,
> char *log_buf, size_t log_buf_sz);
> --
> 2.17.1
>
Powered by blists - more mailing lists