Skip to content

Commit 4a41c27

Browse files
committed
cve_push: Set the same topic for multi-part CVEs
1 parent 9c0a3dc commit 4a41c27

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cve_push.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,16 @@ def run(kernel_repo, input_file, gerrit_user, branch):
178178
# checkout the commit for the given CVE id
179179
cmd = ["git", "-C", kernel_repo, "checkout", cve_sha]
180180
rc = subprocess.call(cmd, stdout=subprocess.DEVNULL)
181+
# remove the CVE id suffix starting with an underscore
182+
# we do this so we can identify multiple git patches belonging to the
183+
# same CVE and set the topic accordingly
184+
actual_cve_id = cve_id
185+
suffix_start = cve_id.rfind('_')
186+
if suffix_start > 0:
187+
actual_cve_id = cve_id[0:suffix_start]
181188
# perform the actual push
182189
rc = push_to_gerrit(kernel_repo, gerrit_remote, gerrit_user, branch,
183-
cve_id)
190+
actual_cve_id)
184191
if rc != 0:
185192
print("[E] Failed to push " + cve_id + " to Gerrit")
186193

0 commit comments

Comments
 (0)