Re: [PATCH 18/39] bpf maps: switch to CLASS(fd, ...)
From: Christian Brauner <brauner@kernel.org>
Date: 2024-08-07 10:34:16
Also in:
bpf, cgroups, kvm, linux-fsdevel
From: Christian Brauner <brauner@kernel.org>
Date: 2024-08-07 10:34:16
Also in:
bpf, cgroups, kvm, linux-fsdevel
On Tue, Jul 30, 2024 at 01:16:04AM GMT, viro@kernel.org wrote:
From: Al Viro <viro@zeniv.linux.org.uk>
Calling conventions for __bpf_map_get() would be more convenient
if it left fpdut() on failure to callers. Makes for simpler logics
in the callers.
Among other things, the proof of memory safety no longer has to
rely upon file->private_data never being ERR_PTR(...) for bpffs files.
Original calling conventions made it impossible for the caller to tell
whether __bpf_map_get() has returned ERR_PTR(-EINVAL) because it has found
the file not be a bpf map one (in which case it would've done fdput())
or because it found that ERR_PTR(-EINVAL) in file->private_data of a
bpf map file (in which case fdput() would _not_ have been done).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---Reviewed-by: Christian Brauner <brauner@kernel.org>