Thread (19 messages) 19 messages, 7 authors, 2020-06-17

Re: [PATCH bpf-next 2/4] bpf: Implement bpf_local_storage for inodes

From: KP Singh <hidden>
Date: 2020-05-27 12:38:48
Also in: bpf, linux-fsdevel, lkml

On 26-May 22:08, Christoph Hellwig wrote:
On Tue, May 26, 2020 at 06:33:34PM +0200, KP Singh wrote:
quoted
From: KP Singh <redacted>

Similar to bpf_local_storage for sockets, add local storage for inodes.
The life-cycle of storage is managed with the life-cycle of the inode.
i.e. the storage is destroyed along with the owning inode.

Since, the intention is to use this in LSM programs, the destruction is
done after security_inode_free in __destroy_inode.
NAK onbloating the inode structure.  Please find an out of line way
to store your information.
The other alternative is to use lbs_inode (security blobs) and we can
do this without adding fields to struct inode.

Here is a rough diff (only illustrative, won't apply cleanly) of the
changes needed to this patch:

 https://gist.github.com/sinkap/1d213d17fb82a5e8ffdc3f320ec37d79

Once tracing has gets a whitelist based access to inode storage, I
guess it, too, can use bpf_local_storage for inodes if CONFIG_BPF_LSM
is enabled. Does this sound reasonable to the BPF folks?

- KP

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help