[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210914170426.zvdehrx5tdmgv2nw@kafai-mbp>
Date: Tue, 14 Sep 2021 10:06:10 -0700
From: Martin KaFai Lau <kafai@...com>
To: Hou Tao <houtao1@...wei.com>
CC: <ast@...nel.org>, <daniel@...earbox.net>, <andrii@...nel.org>,
<bpf@...r.kernel.org>, <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf v2 v2] bpf: handle return value of
BPF_PROG_TYPE_STRUCT_OPS prog
On Tue, Sep 14, 2021 at 10:33:51AM +0800, Hou Tao wrote:
> Currently if a function ptr in struct_ops has a return value, its
> caller will get a random return value from it, because the return
> value of related BPF_PROG_TYPE_STRUCT_OPS prog is just dropped.
>
> So adding a new flag BPF_TRAMP_F_RET_FENTRY_RET to tell bpf trampoline
> to save and return the return value of struct_ops prog if ret_size of
> the function ptr is greater than 0. Also restricting the flag to be
> used alone.
>
> Fixes: 85d33df357b6 ("bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS")
> Signed-off-by: Hou Tao <houtao1@...wei.com>
Acked-by: Martin KaFai Lau <kafai@...com>
Powered by blists - more mailing lists