diff options
| author | Hou Tao <[email protected]> | 2021-09-14 02:33:51 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2021-09-14 18:09:50 +0000 |
| commit | 356ed64991c6847a0c4f2e8fa3b1133f7a14f1fc (patch) | |
| tree | 770425a34bcd9a948033c5164e64a127e1b4a94c /net/unix/af_unix.c | |
| parent | Revert "Revert "ipv4: fix memory leaks in ip_cmsg_send() callers"" (diff) | |
| download | kernel-356ed64991c6847a0c4f2e8fa3b1133f7a14f1fc.tar.gz kernel-356ed64991c6847a0c4f2e8fa3b1133f7a14f1fc.zip | |
bpf: Handle return value of BPF_PROG_TYPE_STRUCT_OPS prog
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
