]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
scripts/bad_stable: provide some info about the patch being marked
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Dec 2025 13:10:42 +0000 (14:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Dec 2025 13:10:42 +0000 (14:10 +0100)
Instead of having to always "remember", have the script do some work for
us ahead of time.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/bad_stable

index 97375d092f6c519ee44d137fa475e4a3f6d53f44..8c8b0cf139e8239032a05ef9036002b6703da1a0 100755 (executable)
@@ -7,6 +7,17 @@ EMAIL_ADDRESS='<gregkh@linuxfoundation.org>'
 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")