Bug 218775

Summary: Some eBPF kretprobe do not survive suspend/resume cycle
Product: Power Management Reporter: qjerome
Component: Hibernation/SuspendAssignee: Rafael J. Wysocki (rjw)
Status: NEW ---    
Severity: normal    
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: 6.6.28 Subsystem:
Regression: No Bisected commit-id:

Description qjerome 2024-04-25 05:45:57 UTC
While developing eBPF programs, I noticed that kretprobes attached to some kernel functions do not survive to suspend/resume cycle (NB: I didn't try with hibernation). I confirmed the issue on the following kernels: 6.6.26-lts, 6.6.28-lts, 5.4.0-153 (just for testing as I had such an old kernel).

Steps to reproduce the issue (require bpftrace):

1) sudo bpftrace -e 'kretprobe:__sys_recvmsg { printf("%s\n", comm); }' 

2) systemctl suspend

3) Resume

4) see that nothing gets printed anymore on stdout

It seems other functions suffer from the same issues (i.e. *_recvmsg) however it is hard for me to tell if there are others, as I didn't make the test for all kernel functions and I was not able to understand why those are impacted. The expected behavior, based on other kretprobes, is actually to survive to a suspend/resume cycle. 

NB: this is not a bpftrace issue as I just used bpftrace to reproduce the issue I was observing while developing my eBPF program (completely non related to bpftrace).