Thread (30 messages) 30 messages, 4 authors, 2021-04-21

Re: [PATCH bpf-next 11/15] bpf: Add bpf_sys_close() helper.

From: Al Viro <viro@zeniv.linux.org.uk>
Date: 2021-04-17 04:04:39
Also in: bpf

On Fri, Apr 16, 2021 at 08:46:05PM -0700, Alexei Starovoitov wrote:
On Fri, Apr 16, 2021 at 8:42 PM Al Viro [off-list ref] wrote:
quoted
On Fri, Apr 16, 2021 at 08:32:20PM -0700, Alexei Starovoitov wrote:
quoted
From: Alexei Starovoitov <ast@kernel.org>

Add bpf_sys_close() helper to be used by the syscall/loader program to close
intermediate FDs and other cleanup.
Conditional NAK.  In a lot of contexts close_fd() is very much unsafe.
In particular, anything that might call it between fdget() and fdput()
is Right Fucking Out(tm).
In which contexts can that thing be executed?
user context only.
It's not for all of bpf _obviously_.
Let me restate the question: what call chains could lead to bpf_sys_close()?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help