Closed Trigary closed 4 months ago
fs_type
check is sufficient, as filesystem type is enforced on kernel level. Rough explanation - you can specify pretty much anything as a source to (some? all? we care about bpf
here) virtual filesystems, it's ignored and passed as-is.
e.g.
# mount -t bpf abcdef /mnt/bpf
# mount -t tmpfs xyz /mnt/tmp
# mount -t bpf /dev/sda /mnt/bpf2
# mount -t bpf /dev/nonexistent /mnt/bpf3
# mount | tail -4
abcdef on /mnt/bpf type bpf (rw,relatime)
xyz on /mnt/tmp type tmpfs (rw,relatime)
/dev/sda on /mnt/bpf2 type bpf (rw,relatime)
/dev/nonexistent on /mnt/bpf3 type bpf (rw,relatime)
Thanks @mikroskeem, that was I was not sure about in my review.
I use NIKSS on a Hyper-V VM running Ubuntu 20.04 (kernel: 5.8). With this setup, BPF is mounted on device "none":
nikss-ctl validate-os
interpreted this as BPF not being mounted:This PR fixes that issue by removing the check that requires the mounted device to be named
bpf
.Credit goes to @mikroskeem for discovering why validate-os was rejecting my system.