/* Matches caller of test_get_xattr() in prog_tests/fs_kfuncs.c */ staticconstchar xattr_names[][64] = { /* The following work. */ "user.kfuncs", "security.bpf.xxx",
/* The following do not work. */ "security.bpf", "security.selinux"
};
SEC("lsm.s/file_open") int BPF_PROG(test_file_open, struct file *f)
{ struct bpf_dynptr value_ptr;
__u32 pid; int ret, i;
for (i = 0; i < ARRAY_SIZE(xattr_names); i++) {
ret = bpf_get_dentry_xattr(dentry, xattr_names[i], &value_ptr); if (ret == sizeof(expected_value)) break;
} if (ret != sizeof(expected_value)) return 0; if (bpf_strncmp(value2, ret, expected_value)) return 0;
found_xattr_from_dentry = 1;
/* return non-zero to fail getxattr from user space */ return -EINVAL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.