Thread (22 messages) flat view 22 messages, 3 authors, 2023-11-27

Re: [PATCH v10 bpf-next 03/17] bpf: introduce BPF token object

From: Christian Brauner <brauner@kernel.org>
Date: 2023-11-27 16:05:36
Also in: bpf, linux-fsdevel, netdev

+	if (path.mnt->mnt_root != path.dentry) {
You want to verify that you can only create tokens from the root of the
bpffs mount. So for

  sudo mount -t bpf bpf /mnt

you want bpf tokens to be creatable from:

  fd = open("/mnt")

or from bind-mounts of the fs root:

  sudo mount --bind /mnt /srv
  fd = open("/srv")

but not from

  sudo mount --bind /mnt/foo /opt
  fd = open("/opt")

But I think your current check allows for that because if you bind-mount
/mnt/foo to /opt then fd = open("/opt")

  path.mnt->mnt_root == foo and path.dentry == foo

I think

path.dentry != path.mnt->mnt_sb->s_root

should give you what you want.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help