From 9f07d919a87d1db880a022c69c790bb2a2a7b872 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Mar 22 2024 19:43:51 +0000 Subject: scripts/check-kernel-fix: allow CVE argument --- diff --git a/scripts/check-kernel-fix b/scripts/check-kernel-fix index c5665ea..6c209db 100755 --- a/scripts/check-kernel-fix +++ b/scripts/check-kernel-fix @@ -7,7 +7,7 @@ usage() { echo "Check state of a kernel fix and eventually suggest needed actions" echo - echo "Expect upstream kernel tree sha as the parameter. The script checks" + echo "Expect upstream kernel tree sha or CVE number as the parameter. The script checks" echo "whether the commit is already in the upstream baseline or backported" echo "in kernel-source tree. When backported, it checks whether it has CVE" echo "reference if there is any" @@ -327,11 +327,15 @@ if [ -z "$1" ] ; then exit 1 fi +sha=$1 if ! sha_in_upstream "$1" ; then - fail "Can find't sha in upstream: $1" + sha=$(cve2sha $1) + if [ -z "$sha" ] + then + fail "Can find't sha in upstream: $1" + fi fi -sha=$1 cve=$(sha2cve $sha) bsc= [ -n "$cve" ] && bsc=$(cve2bugzilla $cve)