Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request iovisor#4089 from davemarchevsky/davemarchevsky_fi… #4

Merged
merged 17 commits into from
Jul 5, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
libbpf-tools: Allow filelife to run on kernels without CONIFG_SECURITY
security_inode_create does NOT exist if CONIFG_SECURITY is not set.
The tool filelife attaches to security_inode_create unconditionally
and result in attach error. Fix it by checking symbol existence.

Signed-off-by: Hengqi Chen <[email protected]>
  • Loading branch information
chenhengqi authored and yonghong-song committed Jul 3, 2022
commit c3c99a929bb39008a2249574cc415ae73bbfccf8
3 changes: 3 additions & 0 deletions libbpf-tools/filelife.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ int main(int argc, char **argv)
/* initialize global data (filtering options) */
obj->rodata->targ_tgid = env.pid;

if (!kprobe_exists("security_inode_create"))
bpf_program__set_autoload(obj->progs.security_inode_create, false);

err = filelife_bpf__load(obj);
if (err) {
fprintf(stderr, "failed to load BPF object: %d\n", err);
Expand Down