iovisor / iovisor/bcc

Libbpf.c crash in method

Open
#2,407 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

Regarding the function in libbpf.c: void bpf_program__unload(struct bpf_program *prog)

I received a crash on the expression:

for (i = 0; i < prog->instances.nr; i++)
zclose(prog->instances.fds[i]);

I believe prog->instances.nr is not the proper length of prog->instances.fds[], unless my implementation of this method is wrong.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in libbpf.c at bpf_program__unload and inspect how prog->instances.nr relates to prog->instances.fds[]. Reproduce or trace the reported crash, then verify the unload path uses the valid instance range without accessing outside the file-descriptor array.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.