From: Greg Kroah-Hartman Date: Mon, 29 Dec 2025 13:10:42 +0000 (+0100) Subject: scripts/bad_stable: provide some info about the patch being marked X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87d4074bca3efe4f27eab7dfbbfade0957d8a376;p=thirdparty%2Fkernel%2Fstable-queue.git scripts/bad_stable: provide some info about the patch being marked Instead of having to always "remember", have the script do some work for us ahead of time. Signed-off-by: Greg Kroah-Hartman --- diff --git a/scripts/bad_stable b/scripts/bad_stable index 97375d092f..8c8b0cf139 100755 --- a/scripts/bad_stable +++ b/scripts/bad_stable @@ -7,6 +7,17 @@ EMAIL_ADDRESS='' REAL_SCRIPT=$(realpath -e "${BASH_SOURCE[0]}") SCRIPT_TOP="${SCRIPT_TOP:-$(dirname "${REAL_SCRIPT}")}" +txtund=$(tput sgr 0 1) # Underline +txtbld=$(tput bold) # Bold +txtred=$(tput setaf 1) # Red +txtgrn=$(tput setaf 2) # Green +txtylw=$(tput setaf 3) # Yellow +txtblu=$(tput setaf 4) # Blue +txtpur=$(tput setaf 5) # Purple +txtcyn=$(tput setaf 6) # Cyan +txtwht=$(tput setaf 7) # White +txtrst=$(tput sgr0) # Text reset + extract_addr() { read l @@ -187,7 +198,30 @@ if [ "${git_id}" == "" ] ; then exit; fi -echo "git_id = ${git_id}" +full_git_id=$(git log -1 --format="%H" "${git_id}") +if [[ "${full_git_id}" == "" ]]; then + echo "git id ${git_id} not found" + exit; +fi +git_id="${full_git_id}" +echo "Commit id ${txtcyn}${git_id}${txtrst}" + +queued_in=$(cd ${SCRIPT_TOP}/.. && grep -l -r ${git_id} queue-* | sort -Vr) +if [[ "${queued_in}" != "" ]]; then + for q in ${queued_in}; do + echo " queued in: ${txtgrn}${q}${txtrst}" + done +fi + +lines=$(git show ${git_id} | grep -i "fixes:" | sed -e 's/^[ \t]*//' | cut -f 2 -d ':' | sed -e 's/^[ \t]*//' | cut -f 1 -d ' ') +for fix in ${lines}; do + fix_id=$(git log -1 --format="%H" "${fix}") + if [[ "${fix_id}" != "" ]]; then + #echo "fix_id=${fix_id}" + release=$(/home/gregkh/linux/vulns/tools/verhaal/id_found_in "${fix_id}") + echo " fixed in: ${txtylw}${release}${txtrst}" + fi +done if [ "$#" == "0" ] ; then versions=$("${SCRIPT_TOP}/active_kernel_versions_get.sh")