From b84ef25c603809bf486448aeca55305c453981f5 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Apr 26 2024 17:53:15 +0000 Subject: Merge branch 'users/mhocko/scripts/for-next' into scripts --- diff --git a/scripts/check-kernel-fix b/scripts/check-kernel-fix index 31f435c..dd7073f 100755 --- a/scripts/check-kernel-fix +++ b/scripts/check-kernel-fix @@ -52,8 +52,12 @@ usage() echo " -f sha: provide explicit Fixes tag. Use when the one in the commit is" echo " unknown but you could figure it from the code inspection." echo " Specify repeteadly if more are required" + echo " -c CVE-XXXX-YYYY: provide CVE number for the given sha. Use for" + echo " CVEs issued before the process has changed and VULNS_GIT doesn't" + echo " recognize this CVE" } +SUSE_GET_MAINTAINERS=/usr/bin/suse-get-maintainers branch= bprefix= sha= @@ -191,6 +195,7 @@ print_action() ;; missing_references) + [ -z $verbose_mode ] && return patch=$(grep "^$branch:" "$patch_file" | cut -d : -f 2) if [ -n "$patch" ] ; then ref_args=$(printf -- '-r %s ' $references) @@ -340,7 +345,7 @@ quiet_mode= flat_mode=0 expl_fixes="" -while getopts "hvrqts:b:f:" OPT +while getopts "hvrqts:b:f:c:" OPT do case $OPT in h) @@ -367,6 +372,9 @@ do ;; f) expl_fixes="$expl_fixes $OPTARG" + ;; + c) + cve=$OPTARG esac done @@ -387,6 +395,7 @@ fi sha=$1 if ! sha_in_upstream "$1" ; then + [ -n "$cve" ] && fail "SHA expected when -c CVE-XXXXXX-YYYY is used" sha=$(cve2sha $1 $refresh) if [ -z "$sha" ] then @@ -397,7 +406,7 @@ fi print_upstream_sha_summary $sha "$expl_fixes" -cve=$(sha2cve $sha $refresh) +[ -z "$cve" ] && cve=$(sha2cve $sha $refresh) if [ -n "$cve" ] then [ -z "$bsc" ] && bsc=$(cve2bugzilla $cve $refresh) @@ -411,6 +420,13 @@ else [ -z "$cvss" ] && ccvss=0 fi +if [ -x $SUSE_GET_MAINTAINERS ] +then + echo -n "Experts candidates: " + $SUSE_GET_MAINTAINERS --sha $sha | tr "\n" " " + echo +fi + references="$cve $bsc" branches_conf="$(fetch_branches $refresh)"