Skip to content

KFunc bpf_get_file_xattr

v6.8

Get xattr of a file

Definition

Get xattr name__str of file and store the output in value_ptr.

For security reasons, only name__str with prefix "user." is allowed.

Return

0 on success, a negative value on error.

int bpf_get_file_xattr(struct file *file, const char *name__str, struct bpf_dynptr_kern *value_ptr)

Note

This function may sleep, and therefore can only be used from sleepable programs.

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

The following program types can make use of this kfunc:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome