aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-11 20:15:53 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-02-11 20:15:53 +0000
commitfb6dcb9b9b9cc901680a0188bb1d16c63c1719fd (patch)
tree292294f14da3bdd19b3465e90988c29a9f643866
parent380d9712829386fda27d28fda43c8c20462e36b3 (diff)
downloadvulns-fb6dcb9b9b9cc901680a0188bb1d16c63c1719fd.tar.gz
scripts/bippy: generate a vuln list in text form
Start working on a better mbox format Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rwxr-xr-xscripts/bippy21
1 files changed, 13 insertions, 8 deletions
diff --git a/scripts/bippy b/scripts/bippy
index 4ec8becb..dfb99165 100755
--- a/scripts/bippy
+++ b/scripts/bippy
@@ -476,22 +476,25 @@ for entry in ${fixed_pairs[@]}; do
dbg "${entry}"
done
-# Generate the "vulerable kernel json mess
-# TODO, use the ${vuln_kernels} array to match up with the fixed kernels
-# somehow, for now we just iterate over the fixed_kernels
-vuln_array=""
+# Generate the "vulnerable" kernel json and mbox information
+vuln_array_json=""
+vuln_array_mbox=()
for entry in ${fixed_pairs[@]}; do
x=(${entry//:/ })
vuln=${x[0]}
fix=${x[1]}
- vuln_array+="versions[]=$(jo -- \
+ vuln_array_json+="versions[]=$(jo -- \
-s version="${vuln}" \
-s lessThan="${fix}" \
-s status="affected" \
-s versionType="custom" \
) "
+
+ vuln_array_mbox+=("Issue introduced in ${vuln} and fixed in ${fix}")
done
-dbg "vuln_array=${vuln_array}"
+dbg "vuln_array_json=${vuln_array_json}"
+dbg "vuln_array_mbox=${vuln_array_mbox[@]}"
+
#########################
# Compose the json knowing what we now know, using the 'jo' tool
@@ -535,7 +538,7 @@ if [[ "${JSON_FILE}" != "" ]] ; then
product="Linux" \
vendor="Linux" \
defaultStatus="affected" \
- ${vuln_array} \
+ ${vuln_array_json} \
)
affected=$(jo -a -- "${a}")
@@ -579,8 +582,10 @@ ${CVE_NUMBER} has been assigned for the following issue:
${commit_text}
Affected versions:
-
EOF
+ for line in "${vuln_array_mbox[@]}"; do
+ echo " ${line}" >> ${MBOX_FILE}
+ done
dbg "mbox file written to ${MBOX_FILE}"
fi # end mbox creation