From: Greg Kroah-Hartman Date: Tue, 18 Oct 2011 18:05:58 +0000 (-0700) Subject: 3.0 patches X-Git-Tag: v3.0.8~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa6adbe98a2ea7f419f669f6ed761eac8e18a6e0;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0 patches --- diff --git a/queue-3.0/avoid-using-variable-length-arrays-in-kernel-sys.c.patch b/queue-3.0/avoid-using-variable-length-arrays-in-kernel-sys.c.patch new file mode 100644 index 00000000000..32b59bfb986 --- /dev/null +++ b/queue-3.0/avoid-using-variable-length-arrays-in-kernel-sys.c.patch @@ -0,0 +1,42 @@ +From a84a79e4d369a73c0130b5858199e949432da4c6 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Mon, 17 Oct 2011 08:24:24 -0700 +Subject: Avoid using variable-length arrays in kernel/sys.c + +From: Linus Torvalds + +commit a84a79e4d369a73c0130b5858199e949432da4c6 upstream. + +The size is always valid, but variable-length arrays generate worse code +for no good reason (unless the function happens to be inlined and the +compiler sees the length for the simple constant it is). + +Also, there seems to be some code generation problem on POWER, where +Henrik Bakken reports that register r28 can get corrupted under some +subtle circumstances (interrupt happening at the wrong time?). That all +indicates some seriously broken compiler issues, but since variable +length arrays are bad regardless, there's little point in trying to +chase it down. + +"Just don't do that, then". + +Reported-by: Henrik Grindal Bakken +Cc: Benjamin Herrenschmidt +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sys.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/sys.c ++++ b/kernel/sys.c +@@ -1135,7 +1135,7 @@ DECLARE_RWSEM(uts_sem); + static int override_release(char __user *release, int len) + { + int ret = 0; +- char buf[len]; ++ char buf[65]; + + if (current->personality & UNAME26) { + char *rest = UTS_RELEASE; diff --git a/queue-3.0/series b/queue-3.0/series index e0a9ae20085..1bd05380813 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -2,3 +2,4 @@ arm-7113-1-mm-align-bank-start-to-max_order_nr_pages.patch arm-7117-1-perf-fix-hw_cache_-events-on-cortex-a9.patch hid-usbhid-add-support-for-sigma-micro-chip.patch hwmon-w83627ehf-properly-report-thermal-diode-sensors.patch +avoid-using-variable-length-arrays-in-kernel-sys.c.patch