From c75f608f1cde97b86d8fde115c8989935de21ce4 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Mar 27 2024 13:17:19 +0000 Subject: Merge remote-tracking branch 'users/mhocko/scripts/for-next' into scripts --- diff --git a/scripts/check-kernel-fix b/scripts/check-kernel-fix index 4f752df..8ea73fe 100755 --- a/scripts/check-kernel-fix +++ b/scripts/check-kernel-fix @@ -346,6 +346,8 @@ if ! sha_in_upstream "$1" ; then fi fi +print_upstream_sha_summary $sha + cve=$(sha2cve $sha $refresh) bsc= if [ -n "$cve" ] @@ -353,6 +355,11 @@ then bsc=$(cve2bugzilla $cve $refresh) cvss=$(cve2cvss $cve $refresh) echo "Security fix for $cve $bsc with CVSS ${cvss:-unknown}" +else + # emulate no CVE fix as CVSS==0. This will typically happen + # for upstream commit with Fixes: which we want to target to + # less conservative branches only + cvss=0 fi references="$cve $bsc" diff --git a/scripts/common-functions b/scripts/common-functions index 6282072..2cd4a78 100644 --- a/scripts/common-functions +++ b/scripts/common-functions @@ -160,6 +160,28 @@ sha_get_upstream_git_fixes() git --git-dir="$upstream_git/.git" show $sha | grep -i "^[[:space:]]*fixes:" | awk '{print $2}' } +print_upstream_sha_info() +{ + local sha=$1 + local upstream_git=${2:-$LINUX_GIT} + + echo -n "$(git --git-dir="$upstream_git/.git" show -s --pretty='format:%h ("%s")' $sha) merged " + git --git-dir="$upstream_git/.git" describe --contains --abbrev=0 --match="v*" $sha +} + +print_upstream_sha_summary() +{ + local sha=$1 + local upstream_git=${2:-$LINUX_GIT} + + print_upstream_sha_info $sha $upstream_git + for fix in $(sha_get_upstream_git_fixes $1 $upstream_git) + do + echo -n "Fixes: " + print_upstream_sha_info $fix $upstream_git + done +} + sha_merged_in_upstream_tag() { local sha=$1