Skip to content

Commit

Permalink
Fix two regex issues in the github actions
Browse files Browse the repository at this point in the history
Directory name check wasn't allowing _2 https://google.github.io/security-research/kernelctf/rules.html#exploit-pr-file-structure

Regex in schema wasn't allowing mitigation-v3b
  • Loading branch information
chanijindal1 committed Nov 30, 2024
1 parent 11d8044 commit fc80975
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kernelctf/check-submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
prFiles = checkList(prFiles, lambda f: f.startswith(POC_FOLDER), f"The following files are outside of the `{POC_FOLDER}` folder which is not allowed")

subDirName = checkOnlyOne(subdirEntries(prFiles, POC_FOLDER), "Only one submission is allowed per PR. Found multiple submissions")
checkRegex(subDirName, r"^CVE-\d+-\d+(_lts|_cos|_mitigation)+$", f"The submission folder name is invalid (`{subDirName}`)")
checkRegex(subDirName, r"^CVE-\d+-\d+(_lts|_cos|_mitigation)+(_\d+)?$", f"The submission folder name is invalid (`{subDirName}`)")

print(f"[-] Processing submission... Folder = {subDirName}")
cve, *targets = subDirName.split('_')
Expand Down
2 changes: 1 addition & 1 deletion kernelctf/metadata.schema.v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^((lts-[0-9]+.[0-9]+(\\.[0-9]+)?)|(mitigation-(v[0-9]+-)?[0-9]+\\.[0-9]+(\\.[0-9]+)?)|(cos-[0-9]{2,}-[0-9]+\\.[0-9]+\\.[0-9]+)|extra-.*)$": {
"^((lts-[0-9]+.[0-9]+(\\.[0-9]+)?)|(mitigation-(v[0-9]+[a-z]?-)?[0-9]+\\.[0-9]+(\\.[0-9]+)?)|(cos-[0-9]{2,}-[0-9]+\\.[0-9]+\\.[0-9]+)|extra-.*)$": {
"type": "object",
"required": ["uses", "requires_separate_kaslr_leak", "stability_notes"],
"properties": {
Expand Down

0 comments on commit fc80975

Please sign in to comment.