From fc8097500f672efbc8c2db69bb333fec7fc0af1c Mon Sep 17 00:00:00 2001 From: Chani Jindal Date: Sat, 30 Nov 2024 08:22:07 +0000 Subject: [PATCH] Fix two regex issues in the github actions 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 --- kernelctf/check-submission.py | 2 +- kernelctf/metadata.schema.v3.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernelctf/check-submission.py b/kernelctf/check-submission.py index a0870424..90fcbb89 100755 --- a/kernelctf/check-submission.py +++ b/kernelctf/check-submission.py @@ -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('_') diff --git a/kernelctf/metadata.schema.v3.json b/kernelctf/metadata.schema.v3.json index 010ad518..ae5631b4 100644 --- a/kernelctf/metadata.schema.v3.json +++ b/kernelctf/metadata.schema.v3.json @@ -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": {