libbpf-rs icon indicating copy to clipboard operation
libbpf-rs copied to clipboard

Problems with internal maps (.rodata) and old kernels

Open trtt opened this issue 2 years ago • 5 comments

Found some problems with >= libbpf-sys 0.6.0 and old kernels (in my case it was CentOS/RHEL 7). The problems were with internal maps (.rodata) generated (but not really used) by a relatively new compiler.

What I found:

  1. double free in the error path that actually resulted in segfault
  2. after getting rid of the segfault there remains an error with loading such programs

trtt avatar Apr 12 '22 18:04 trtt

Thanks for finding this and submitting a fix! I left a comment in your 2nd commit but other than that, this makes sense to me!

insearchoflosttime avatar Apr 13 '22 20:04 insearchoflosttime

Hey, I'm still interested in fixing this. Could you give me a clearer indication on what needs to change? Do you all agree on removing the fd < 0 check completely? Or maps with -1 fd should be filtered out instead of causing error? Or something else entirely?

trtt avatar Jul 26 '22 08:07 trtt

Thanks for following up @trtt! imo the consensus is that if fd < 0 then we should skip it.

insearchoflosttime avatar Jul 26 '22 21:07 insearchoflosttime

Thanks for following up @trtt! imo the consensus is that if fd < 0 then we should skip it.

done

trtt avatar Jul 27 '22 17:07 trtt

+1

dafu-wu avatar Sep 20 '22 08:09 dafu-wu

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label or comment or it will be closed in 5 days.

github-actions[bot] avatar Dec 28 '23 02:12 github-actions[bot]

Closing pull request as it is stale.

github-actions[bot] avatar Jan 02 '24 02:01 github-actions[bot]