iovisor / iovisor/bcc

biosnoop fails w/ stack smashing detected

Open
#5,468 0 comments 1 reaction 2 assignees Claimed by @ekyooo View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
5d 13h
Merged PRs (30d)
3

Description

### 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

- Downstream issue: https://gitlab.archlinux.org/archlinux/packaging/packages/bcc/-/issues/6

[Diagnosed]: https://gitlab.archlinux.org/archlinux/packaging/packages/bcc/-/issues/6#note_418051

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.