From: Greg Kroah-Hartman Date: Mon, 3 Jul 2017 07:20:40 +0000 (+0200) Subject: 3.18-stable patches X-Git-Tag: v3.18.60~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7bedc338f4098f7dd7e6d715f040f0e97402ffd4;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: arm64-cpuinfo-missing-null-terminator-in-compat_hwcap_str.patch --- diff --git a/queue-3.18/arm64-cpuinfo-missing-null-terminator-in-compat_hwcap_str.patch b/queue-3.18/arm64-cpuinfo-missing-null-terminator-in-compat_hwcap_str.patch new file mode 100644 index 00000000000..ddee26323a6 --- /dev/null +++ b/queue-3.18/arm64-cpuinfo-missing-null-terminator-in-compat_hwcap_str.patch @@ -0,0 +1,44 @@ +From f228b494e56d949be8d8ea09d4f973d1979201bf Mon Sep 17 00:00:00 2001 +From: Julien Grall +Date: Tue, 10 May 2016 15:40:31 +0100 +Subject: arm64: cpuinfo: Missing NULL terminator in compat_hwcap_str + +From: Julien Grall + +commit f228b494e56d949be8d8ea09d4f973d1979201bf upstream. + +The loop that browses the array compat_hwcap_str will stop when a NULL +is encountered, however NULL is missing at the end of array. This will +lead to overrun until a NULL is found somewhere in the following memory. +In reality, this works out because the compat_hwcap2_str array tends to +follow immediately in memory, and that *is* terminated correctly. +Furthermore, the unsigned int compat_elf_hwcap is checked before +printing each capability, so we end up doing the right thing because +the size of the two arrays is less than 32. Still, this is an obvious +mistake and should be fixed. + +Note for backporting: commit 12d11817eaafa414 ("arm64: Move +/proc/cpuinfo handling code") moved this code in v4.4. Prior to that +commit, the same change should be made in arch/arm64/kernel/setup.c. + +Fixes: 44b82b7700d0 "arm64: Fix up /proc/cpuinfo" +Signed-off-by: Julien Grall +Signed-off-by: Will Deacon +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/kernel/setup.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm64/kernel/setup.c ++++ b/arch/arm64/kernel/setup.c +@@ -473,7 +473,8 @@ static const char *compat_hwcap_str[] = + "idivt", + "vfpd32", + "lpae", +- "evtstrm" ++ "evtstrm", ++ NULL + }; + + static const char *compat_hwcap2_str[] = { diff --git a/queue-3.18/series b/queue-3.18/series index c7f33199683..aabdfe35c3b 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -12,3 +12,4 @@ ipv6-fix-calling-in6_ifa_hold-incorrectly-for-dad-work.patch decnet-always-not-take-dst-__refcnt-when-inserting-dst-into-hash-table.patch net-8021q-fix-one-possible-panic-caused-by-bug_on-in-free_netdev.patch nfsv4-fix-a-reference-leak-caused-warning-messages.patch +arm64-cpuinfo-missing-null-terminator-in-compat_hwcap_str.patch