Re: [PATCH bpf-next 1/2] selftests/bpf: fix for veristat file/prog filters processing
Eduard Zingerman <[email protected]>
| Newsgroups | org.kernel.vger.bpf |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2026-08-11 at 18:41 +0000, [email protected] wrote: > > selftests/bpf: fix for veristat file/prog filters processing > > > > At the moment veristat filtering behaves unexpectedly for the > > following filter expression: > > > > -f !file/prog > > > > The expression rejects all programs with name 'prog', and all programs > > in a file with name 'file'. This commit fixes the expression to > > exclude only a program 'prog' from a file 'file'. Additionally, > > the commit makes empty filters like '-f ""' or '-f "/"' and error. > > Here is the filtering behaviour compared old versus new: > > > > | filter | file | prog | old verdict | new verdict | > > |----------+------+------+-------------+-------------| > > | !foo | foo | bar | skipped | skipped | > > | !foo | bar | foo | skipped | skipped | > > | !foo/bar | foo | bar | skipped | skipped | > > | !foo/bar | foo | buz | skipped | processed | (!) > > | !foo/bar | bar | bar | skipped | processed | (!) > > | !foo/ | foo | bar | skipped | skipped | > > | !foo/ | bar | bar | processed | processed | > > | !/bar | foo | bar | skipped | skipped | > > | !/bar | foo | foo | processed | processed | > > | !/ | foo | bar | processed | error | (!) > > | ! | foo | bar | processed | error | (!) > > |----------+------+------+-------------+-------------| > > | foo | foo | bar | processed | processed | > > | foo | bar | foo | processed | processed | > > | foo/bar | foo | bar | processed | processed | > > | foo/bar | foo | buz | skipped | skipped | > > | foo/bar | bar | bar | skipped | skipped | > > | foo/ | foo | bar | processed | processed | > > | foo/ | bar | bar | skipped | skipped | > > | /bar | foo | bar | processed | processed | > > | /bar | foo | foo | skipped | skipped | > > | / | foo | bar | processed | error | (!) > > | | foo | bar | skipped | error | (!) > > > > Signed-off-by: Eduard Zingerman <[email protected]> > > This looks like a bug fix for existing tooling. The changelog table marks > four behavior rows with '(!)', showing the OR-matching bug being fixed and > empty filters now being rejected. Should this include a Fixes: tag? > > The broken semantics - deny filter matching on file OR prog independently, > and empty filters being silently accepted - were introduced when the separate > should_process_file() and should_process_prog() helpers were merged into > should_process_file_prog(): > > Fixes: 10b1b3f3e56a ("selftests/bpf: consolidate and improve file/prog filtering in veristat") > Yeah, fixes tag should be added.