Repository navigation
Keep open flags for kretprobes - #495
Draft
nicholasberlin wants to merge 1 commit into
Draft
nicholasberlin wants to merge 1 commit into
nicholasberlin wants to merge 1 commit into
Conversation
nicholasberlin
force-pushed
the
nberlin/fa2-10-kprobe-flags
branch
from
October 29, 2026 21:34
612adc2 to
a61bf7f
Compare
nicholasberlin
force-pushed
the
nberlin/fa2-10-kprobe-flags
branch
from
October 30, 2026 00:28
a61bf7f to
bf52652
Compare
nicholasberlin
force-pushed
the
nberlin/fa2-10-kprobe-flags
branch
from
October 30, 2026 01:31
bf52652 to
35b34ac
Compare
nicholasberlin
force-pushed
the
nberlin/fa2-10-kprobe-flags
branch
2 times, most recently
from
October 30, 2026 02:16
6d75686 to
eab18b8
Compare
nicholasberlin
force-pushed
the
nberlin/fa2-10-kprobe-flags
branch
from
October 30, 2026 13:04
eab18b8 to
2047b6e
Compare
nicholasberlin
force-pushed
the
nberlin/fa2-10-kprobe-flags
branch
2 times, most recently
from
November 2, 2026 19:17
ba7b1bc to
5d2fe18
Compare
nicholasberlin
force-pushed
the
nberlin/fa2-10-kprobe-flags
branch
from
November 2, 2026 20:28
5d2fe18 to
9de3471
Compare
nicholasberlin
force-pushed
the
nberlin/fa2-10-kprobe-flags
branch
from
November 2, 2026 20:52
9de3471 to
03cda09
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A kretprobe cannot read the open function arguments at return. This PR adds an entry kprobe that saves the
open_flagspointer. The return probe uses that pointer and removes the saved state. The loader supports bothdo_filp_open()anddo_file_open()and loads the entry probe only forQQ_FILE_ACCESS.If entry state is unavailable, the probe uses file flags. Those flags can lack
O_CREAT,O_EXCL,O_NOCTTYandO_TRUNC; the manual states this limit. The live tests now require creation and truncation flags in kprobe mode. The saved state contains only the argument that this feature uses.Validation
5d2fe18dbb85, the source audit passed. Compared withba7b1bc1041b, changes are limited to the approved comments. Executable C tokens are unchanged.ba7b1bc1041b.Earlier results, before these comment changes:
mainat1e0279c0da62.ba7b1bc1041b, the C and BPF build passed with-WerrorandWITH_BTFHUB=y, including Go programs.ba7b1bc1041b, the full eBPF suite passed in the krun test image on Ubuntu 26.04 kernel7.0.0-42-genericwith fentry and with-K, and on kernel5.15.0-139-generic.ba7b1bc1041b, the guests used 512 MiB of RAM and KVM.ba7b1bc1041b, the VM runs required the filesystem fixture withQUARK_TEST_FS_REQUIRED=1.Earlier results, before this rebase:
a61bf7f3e005, the C and BPF build passed with-Werror.a61bf7f3e005, the full eBPF suite passed with krun on Ubuntu 26.04 kernel7.0.0-42-genericwith fentry and with-K, and on kernel5.15.0-139-generic.a61bf7f3e005required the filesystem fixture withQUARK_TEST_FS_REQUIRED=1.612adc228941,mandoc -Tlint -Wallpassed for the changed pages. All quark manual references exist at that commit.Stack
part 10 of 19
Depends on #494 (part 9).
Derived from original #477 and the loader changes in original #478.