mirror of
https://github.com/dynup/kpatch
synced 2025-02-27 23:40:32 +00:00
kpatch-build: truncate long patch names
Otherwise the module name listed in /proc/modules is corrupted due to an array buffer overrun.
This commit is contained in:
parent
a0756a5f1d
commit
4f91924d7e
@ -255,9 +255,10 @@ if [[ "$PATCHNAME" =~ \.patch ]] || [[ "$PATCHNAME" =~ \.diff ]]; then
|
||||
PATCHNAME="${PATCHNAME%.*}"
|
||||
fi
|
||||
|
||||
# Only allow alphanumerics and '_' and '-' in the module name.
|
||||
# Everything else is replaced with '-'.
|
||||
PATCHNAME=${PATCHNAME//[^a-zA-Z0-9_-]/-}
|
||||
# Only allow alphanumerics and '_' and '-' in the module name. Everything else
|
||||
# is replaced with '-'. Also truncate to 48 chars so the full name fits in the
|
||||
# kernel's 56-byte module name array.
|
||||
PATCHNAME=$(echo ${PATCHNAME//[^a-zA-Z0-9_-]/-} |cut -c 1-48)
|
||||
|
||||
find_dirs || die "can't find supporting tools"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user