Skip to content

biosnoop fails w/ stack smashing detected #5468

@5long

Description

@5long

Environment

  • OS: Arch Linux
  • Package version: bcc-libbpf-tools=0.36.1-1
  • Kernel: "vanilla" kernel. Version 6.18.9.arch1-2

Steps to reproduce

  • Run sudo biosnoop. Also reproducible with biotop and biostacks (maybe more)

Expected Behavior

Works as usual

Actual Behavior

Exits with the following error message:

*** stack smashing detected ***: terminated
fish: Job 1, 'sudo biotop' terminated by signal SIGABRT (Abort)

Exit code is 134.

Possible Root Cause

Diagnosed by @heftig:

wc -L /proc/kallsyms reports 306 /proc/kallsyms for linux-zen. There's at least one symbol with a very long name, up to 287 characters. It's probably one of the mangled symbols of Rust code.

The ksyms__load function uses an on-stack string (char sym_name[256]) to hold the name of each symbol it reads, and reading any name longer than 255 characters causes a buffer overflow.

Misc

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions