mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
bpftool: Fix inverted tracefs validation when scanning /proc/mounts
The /proc/mounts fallback in get_tracefs_pipe() accepts only non-tracefs
mount points, so a tracefs mounted outside the default locations is
ignored: bpftool prog tracelog then mounts a second tracefs, or exits
silently with --nomount. Negate the condition.
Fixes: be3245e22d ("tools: bpftool: attempt to mount tracefs if required for tracelog cmd")
Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20261016015057.127061-1-chenyuan_fl@163.com
This commit is contained in:
parent
34d527e513
commit
21c755efaa
|
|
@ -86,7 +86,7 @@ static bool get_tracefs_pipe(char *mnt)
|
|||
fclose(fp);
|
||||
|
||||
/* The string from fscanf() might be truncated, check mnt is valid */
|
||||
if (found && validate_tracefs_mnt(mnt, TRACEFS_MAGIC))
|
||||
if (found && !validate_tracefs_mnt(mnt, TRACEFS_MAGIC))
|
||||
goto exit_found;
|
||||
|
||||
if (block_mount)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user