Skip to content

Commit

Permalink
msg-filter: tweak kernel path fixup for z-stream releases
Browse files Browse the repository at this point in the history
The original rule was able to translate:
`kernel-4.18.0-552.el8/linux-4.18.0-552.el8.x86_64/` -> `kernel-4.18.0-552.el8/`

... but it did not work for z-stream releases, where the paths are
unnecessarily inconsistent (`el8_9` on the first level vs. `el8`
on the second level):
`kernel-4.18.0-513.5.1.el8_9/linux-4.18.0-513.5.1.el8.x86_64/`

Related: https://issues.redhat.com/browse/OSH-563
Closes: csutils#171
  • Loading branch information
kdudka committed Apr 16, 2024
1 parent ee1d553 commit 482b9d8
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/msg-filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct MsgFilter::Private {
TSubstMap fileSubsts;

const std::string strKrn = "^[a-zA-Z+]+";
const RE reKrn = RE(strKrn);
const RE reKrn = RE(strKrn + /* convert el8_9 -> el8 */ "|_[0-9]+$");
const RE reDir = RE("^([^:]*/)");
const RE reFile = RE("[^/]+$");
const RE rePath = RE("^(?:/builddir/build/BUILD/)?([^/]+)/(.*)(\\.[ly])?$");
Expand Down
1 change: 1 addition & 0 deletions tests/csdiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ test_csdiff(diff-misc 17-cov-parser-key-event)
test_csdiff(diff-misc 18-cov-parser-key-event)
test_csdiff(diff-misc 19-cov-parser-key-event)
test_csdiff(diff-misc 21-kernel-shell-code)
test_csdiff(diff-misc 22-kernel-zstream-path)

add_subdirectory(filter-file)
Empty file.
Empty file.
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions tests/csdiff/diff-misc/22-kernel-zstream-path-new.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Error: UNINIT (CWE-457):
kernel-4.18.0-552.el8/linux-4.18.0-552.el8.x86_64/arch/x86/crypto/chacha20_glue.c:71:2: var_decl: Declaring variable "walk" without initializer.
kernel-4.18.0-552.el8/linux-4.18.0-552.el8.x86_64/arch/x86/crypto/chacha20_glue.c:74:2: path: Condition "__cond", taking false branch.
kernel-4.18.0-552.el8/linux-4.18.0-552.el8.x86_64/arch/x86/crypto/chacha20_glue.c:77:2: path: Condition "req->cryptlen <= 64", taking false branch.
kernel-4.18.0-552.el8/linux-4.18.0-552.el8.x86_64/arch/x86/crypto/chacha20_glue.c:77:2: path: Condition "!may_use_simd()", taking false branch.
kernel-4.18.0-552.el8/linux-4.18.0-552.el8.x86_64/arch/x86/crypto/chacha20_glue.c:80:2: uninit_use_in_call: Using uninitialized value "walk.flags" when calling "skcipher_walk_virt".
# 78| return crypto_chacha20_crypt(req);
# 79|
# 80|-> err = skcipher_walk_virt(&walk, req, true);
# 81|
# 82| crypto_chacha20_init(state, ctx, walk.iv);
11 changes: 11 additions & 0 deletions tests/csdiff/diff-misc/22-kernel-zstream-path-old.err
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Error: UNINIT (CWE-457):
kernel-4.18.0-513.5.1.el8_9/linux-4.18.0-513.5.1.el8.x86_64/arch/x86/crypto/chacha20_glue.c:71: var_decl: Declaring variable "walk" without initializer.
kernel-4.18.0-513.5.1.el8_9/linux-4.18.0-513.5.1.el8.x86_64/arch/x86/crypto/chacha20_glue.c:74: path: Condition "__cond", taking false branch.
kernel-4.18.0-513.5.1.el8_9/linux-4.18.0-513.5.1.el8.x86_64/arch/x86/crypto/chacha20_glue.c:77: path: Condition "req->cryptlen <= 64", taking false branch.
kernel-4.18.0-513.5.1.el8_9/linux-4.18.0-513.5.1.el8.x86_64/arch/x86/crypto/chacha20_glue.c:77: path: Condition "!may_use_simd()", taking false branch.
kernel-4.18.0-513.5.1.el8_9/linux-4.18.0-513.5.1.el8.x86_64/arch/x86/crypto/chacha20_glue.c:80: uninit_use_in_call: Using uninitialized value "walk.flags" when calling "skcipher_walk_virt".
# 78| return crypto_chacha20_crypt(req);
# 79|
# 80|-> err = skcipher_walk_virt(&walk, req, true);
# 81|
# 82| crypto_chacha20_init(state, ctx, walk.iv);

0 comments on commit 482b9d8

Please sign in to comment.