From 30b19c9d637dc9d9d9616f7de4c90d34e5b874c8 Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Tue, 23 May 2023 14:47:26 +0200 Subject: [PATCH] find-provides.ksyms, find-requires.ksyms: use "read -r" To avoid all kinds of fun that might stem from interpreting the user-supplied input. * find-provides.ksyms: Supply -r option to the read call. * find-requires.ksyms (all_provides): Likewise. Fixes: cd7e9e8a2fc2 "find-provides.ksyms, find-requires.ksyms: rewrite indirect CRC parsing" Signed-off-by: Eugene Syromiatnikov --- find-provides.ksyms | 2 +- find-requires.ksyms | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/find-provides.ksyms b/find-provides.ksyms index e5f139c..8bd93c2 100755 --- a/find-provides.ksyms +++ b/find-provides.ksyms @@ -48,7 +48,7 @@ for module in $(grep -E '/lib/modules/.+\.ko(\.gz|\.bz2|\.xz|\.zst)?$') "$@"; do objdump -t "$module" \ | sed -n 's/^[0-9a-f][0-9a-f]* [gl]...... \(.*\) [0-9a-f][0-9a-f]* __crc_.*$/\1/p' \ | sort -u \ - | while read sectname; do + | while read -r sectname; do [ -n "$sectname" ] || continue ELFSECTDATA=$(readelf -R "$sectname" "$module" | awk '/0x/{printf $2$3$4$5}') diff --git a/find-requires.ksyms b/find-requires.ksyms index 732214d..8dc6eff 100755 --- a/find-requires.ksyms +++ b/find-requires.ksyms @@ -48,7 +48,7 @@ all_provides() { objdump -t "$module" \ | sed -n 's/^[0-9a-f][0-9a-f]* [gl]...... \(.*\) [0-9a-f][0-9a-f]* __crc_.*$/\1/p' \ | sort -u \ - | while read sectname; do + | while read -r sectname; do [ -n "$sectname" ] || continue ELFSECTDATA=$(readelf -R "$sectname" "$module" | awk '/0x/{printf $2$3$4$5}')