-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
I found that the fstype of some mount rules is set to none. For example:
// bind, rbind, remount, move, umount
mountContent, err = newBpfMountRule("/proc**", "none", unix.MS_BIND|unix.MS_REC|unix.MS_REMOUNT|unix.MS_MOVE|AaMayUmount, 0)referer: https://github.com/bytedance/vArmor/blob/main/internal/profile/bpf/bpf.go#L347
I analyzed the code in eBPF and found that there is only matching for *, but no matching for none.
static __noinline bool mount_fstype_check(unsigned char *rule_fstype, unsigned char *fstype) {
DEBUG_PRINT("mount_fstype_check()");
if (rule_fstype[0] == '*') {
return true;
}
for (int i = 0; i < FILE_SYSTEM_TYPE_MAX; i++) {
if (rule_fstype[i] == 0 && fstype[i] == 0)
return true;
if (rule_fstype[i] != fstype[i])
break;
}
return false;
}referer: https://github.com/bytedance/vArmor-ebpf/blob/main/pkg/bpfenforcer/bpf/mount.h#L48
I understand that when fstype is set to none, it means to ignore fstype. So according to the code, should it be set to * instead?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels