Daniel Borkmann b08c8fc041 bpf: Re-support uid and gid when mounting bpffs
For a clean, conflict-free revert of the token-related patches in commit
d17aff807f84 ("Revert BPF token-related functionality"), the bpf fs commit
750e785796bb ("bpf: Support uid and gid when mounting bpffs") was undone
temporarily as well.

This patch manually re-adds the functionality from the original one back
in 750e785796bb, no other functional changes intended.

Testing:

  # mount -t bpf -o uid=65534,gid=65534 bpffs ./foo
  # ls -la . | grep foo
  drwxrwxrwt   2 nobody nogroup          0 Dec 20 13:16 foo
  # mount -t bpf
  bpffs on /root/foo type bpf (rw,relatime,uid=65534,gid=65534)

Also, passing invalid arguments for uid/gid are properly rejected as expected.

Fixes: d17aff807f84 ("Revert BPF token-related functionality")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Cc: Jie Jiang <jiejiang@chromium.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: linux-fsdevel@vger.kernel.org
Link: https://lore.kernel.org/bpf/20231220133805.20953-1-daniel@iogearbox.net
2023-12-21 14:24:30 +01:00
..
2023-11-15 04:02:25 +01:00
2023-11-03 15:44:25 -10:00
2023-11-08 09:47:52 -08:00
2022-09-26 10:13:13 -07:00
2023-10-30 20:13:17 -10:00
2023-03-24 11:01:29 +01:00
2023-10-19 11:02:48 +02:00
2023-08-30 09:16:56 -07:00
2023-10-09 16:59:47 +10:00
2023-06-28 15:51:08 -07:00
2023-09-19 13:21:33 -07:00
2023-10-18 14:34:15 -07:00
2023-10-30 17:56:53 -10:00
2023-10-04 10:41:57 -07:00
2023-11-01 15:28:33 -10:00
2023-11-01 15:28:33 -10:00
2023-08-15 15:26:17 -07:00
2023-10-11 08:46:01 -07:00