From: Greg Kroah-Hartman Date: Fri, 29 Oct 2010 21:17:30 +0000 (-0700) Subject: .32 patches X-Git-Tag: v2.6.27.56~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aecd19c3dd0a3a0a6216a60ca1a0ace08f4eb1e1;p=thirdparty%2Fkernel%2Fstable-queue.git .32 patches --- diff --git a/queue-2.6.32/pcmcia-synclink_cs-fix-information-leak-to-userland.patch b/queue-2.6.32/pcmcia-synclink_cs-fix-information-leak-to-userland.patch new file mode 100644 index 00000000000..3b014442128 --- /dev/null +++ b/queue-2.6.32/pcmcia-synclink_cs-fix-information-leak-to-userland.patch @@ -0,0 +1,31 @@ +From 5b917a1420d3d1a9c8da49fb0090692dc9aaee86 Mon Sep 17 00:00:00 2001 +From: Vasiliy Kulikov +Date: Sun, 17 Oct 2010 18:41:24 +0400 +Subject: pcmcia: synclink_cs: fix information leak to userland + +From: Vasiliy Kulikov + +commit 5b917a1420d3d1a9c8da49fb0090692dc9aaee86 upstream. + +Structure new_line is copied to userland with some padding fields unitialized. +It leads to leaking of stack memory. + +Signed-off-by: Vasiliy Kulikov +Signed-off-by: Dominik Brodowski +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/pcmcia/synclink_cs.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/char/pcmcia/synclink_cs.c ++++ b/drivers/char/pcmcia/synclink_cs.c +@@ -4164,6 +4164,8 @@ static int hdlcdev_ioctl(struct net_devi + if (cmd != SIOCWANDEV) + return hdlc_ioctl(dev, ifr, cmd); + ++ memset(&new_line, 0, size); ++ + switch(ifr->ifr_settings.type) { + case IF_GET_IFACE: /* return current sync_serial_settings */ + diff --git a/queue-2.6.32/powerpc-perf-fix-sampling-enable-for-ppc970.patch b/queue-2.6.32/powerpc-perf-fix-sampling-enable-for-ppc970.patch new file mode 100644 index 00000000000..bfa9fbb6ac3 --- /dev/null +++ b/queue-2.6.32/powerpc-perf-fix-sampling-enable-for-ppc970.patch @@ -0,0 +1,38 @@ +From 9f5f9ffe50e90ed73040d2100db8bfc341cee352 Mon Sep 17 00:00:00 2001 +From: Paul Mackerras +Date: Thu, 9 Sep 2010 19:02:40 +0000 +Subject: powerpc/perf: Fix sampling enable for PPC970 + +From: Paul Mackerras + +commit 9f5f9ffe50e90ed73040d2100db8bfc341cee352 upstream. + +The logic to distinguish marked instruction events from ordinary events +on PPC970 and derivatives was flawed. The result is that instruction +sampling didn't get enabled in the PMU for some marked instruction +events, so they would never trigger. This fixes it by adding the +appropriate break statements in the switch statement. + +Reported-by: David Binderman +Signed-off-by: Paul Mackerras +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/ppc970-pmu.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/powerpc/kernel/ppc970-pmu.c ++++ b/arch/powerpc/kernel/ppc970-pmu.c +@@ -173,9 +173,11 @@ static int p970_marked_instr_event(u64 e + switch (unit) { + case PM_VPU: + mask = 0x4c; /* byte 0 bits 2,3,6 */ ++ break; + case PM_LSU0: + /* byte 2 bits 0,2,3,4,6; all of byte 1 */ + mask = 0x085dff00; ++ break; + case PM_LSU1L: + mask = 0x50 << 24; /* byte 3 bits 4,6 */ + break; diff --git a/queue-2.6.32/sched-fix-string-comparison-in-proc-sched_features.patch b/queue-2.6.32/sched-fix-string-comparison-in-proc-sched_features.patch new file mode 100644 index 00000000000..0f82214efd3 --- /dev/null +++ b/queue-2.6.32/sched-fix-string-comparison-in-proc-sched_features.patch @@ -0,0 +1,62 @@ +From 7740191cd909b75d75685fb08a5d1f54b8a9d28b Mon Sep 17 00:00:00 2001 +From: Mathieu Desnoyers +Date: Mon, 13 Sep 2010 17:47:00 -0400 +Subject: sched: Fix string comparison in /proc/sched_features + +From: Mathieu Desnoyers + +commit 7740191cd909b75d75685fb08a5d1f54b8a9d28b upstream. + +Fix incorrect handling of the following case: + + INTERACTIVE + INTERACTIVE_SOMETHING_ELSE + +The comparison only checks up to each element's length. + +Changelog since v1: + - Embellish using some Rostedtisms. + [ mingo: ^^ == smaller and cleaner ] + +Signed-off-by: Mathieu Desnoyers +Reviewed-by: Steven Rostedt +Cc: Peter Zijlstra +Cc: Tony Lindgren +LKML-Reference: <20100913214700.GB16118@Krystal> +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sched.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/kernel/sched.c ++++ b/kernel/sched.c +@@ -741,7 +741,7 @@ sched_feat_write(struct file *filp, cons + size_t cnt, loff_t *ppos) + { + char buf[64]; +- char *cmp = buf; ++ char *cmp; + int neg = 0; + int i; + +@@ -752,6 +752,7 @@ sched_feat_write(struct file *filp, cons + return -EFAULT; + + buf[cnt] = 0; ++ cmp = strstrip(buf); + + if (strncmp(buf, "NO_", 3) == 0) { + neg = 1; +@@ -759,9 +760,7 @@ sched_feat_write(struct file *filp, cons + } + + for (i = 0; sched_feat_names[i]; i++) { +- int len = strlen(sched_feat_names[i]); +- +- if (strncmp(cmp, sched_feat_names[i], len) == 0) { ++ if (strcmp(cmp, sched_feat_names[i]) == 0) { + if (neg) + sysctl_sched_features &= ~(1UL << i); + else diff --git a/queue-2.6.32/staging-usbip-notify-usb-core-of-port-status-changes.patch b/queue-2.6.32/staging-usbip-notify-usb-core-of-port-status-changes.patch new file mode 100644 index 00000000000..d13c6fa388d --- /dev/null +++ b/queue-2.6.32/staging-usbip-notify-usb-core-of-port-status-changes.patch @@ -0,0 +1,36 @@ +From 0c9a32f0192e656daa2ff3c9149f6d71b4a1b873 Mon Sep 17 00:00:00 2001 +From: Max Vozeler +Date: Tue, 21 Sep 2010 17:31:40 +0200 +Subject: staging: usbip: Notify usb core of port status changes + +From: Max Vozeler + +commit 0c9a32f0192e656daa2ff3c9149f6d71b4a1b873 upstream. + +This patch changes vhci to behave like dummy and +other hcds when disconnecting a device. + +Previously detaching a device from the root hub +did not notify the usb core of the disconnect and +left the device visible. + +Signed-off-by: Max Vozeler +Reported-by: Marco Lancione +Tested-by: Luc Jalbert +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/usbip/vhci_hcd.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/staging/usbip/vhci_hcd.c ++++ b/drivers/staging/usbip/vhci_hcd.c +@@ -163,6 +163,8 @@ void rh_port_disconnect(int rhport) + * spin_unlock(&vdev->ud.lock); */ + + spin_unlock_irqrestore(&the_controller->lock, flags); ++ ++ usb_hcd_poll_rh_status(vhci_to_hcd(the_controller)); + } + + diff --git a/queue-2.6.32/staging-usbip-process-event-flags-without-delay.patch b/queue-2.6.32/staging-usbip-process-event-flags-without-delay.patch new file mode 100644 index 00000000000..dd7bc4402bb --- /dev/null +++ b/queue-2.6.32/staging-usbip-process-event-flags-without-delay.patch @@ -0,0 +1,97 @@ +From 584c5b7cf06194464240280483ee0376cdddbbae Mon Sep 17 00:00:00 2001 +From: Max Vozeler +Date: Tue, 21 Sep 2010 17:43:30 +0200 +Subject: staging: usbip: Process event flags without delay + +From: Max Vozeler + +commit 584c5b7cf06194464240280483ee0376cdddbbae upstream. + +The way the event handler works can cause it to delay +events until eventual wakeup for another event. + +For example, on device detach (vhci): + + - Write to sysfs detach file + -> usbip_event_add(VDEV_EVENT_DOWN) + -> wakeup() + +#define VDEV_EVENT_DOWN (USBIP_EH_SHUTDOWN | USBIP_EH_RESET). + + - Event thread wakes up and passes the event to + event_handler() to process. + + - It processes and clears the USBIP_EH_SHUTDOWN + flag then returns. + + - The outer event loop (event_handler_loop()) calls + wait_event_interruptible(). + +The processing of the second flag which is part of +VDEV_EVENT_DOWN (USBIP_EH_RESET) did not happen yet. +It is delayed until the next event. + +This means the ->reset callback may not happen for +a long time (if ever), leaving the usbip port in a +weird state which prevents its reuse. + +This patch changes the handler to process all flags +before waiting for another wakeup. + +I have verified this change to fix a problem which +prevented reattach of a usbip device. It also helps +for socket errors which missed the RESET as well. + +The delayed event processing also affects the stub +side of usbip and the error handling there. + +Signed-off-by: Max Vozeler +Reported-by: Marco Lancione +Tested-by: Luc Jalbert +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/usbip/usbip_event.c | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +--- a/drivers/staging/usbip/usbip_event.c ++++ b/drivers/staging/usbip/usbip_event.c +@@ -38,21 +38,13 @@ static int event_handler(struct usbip_de + ud->eh_ops.shutdown(ud); + + ud->event &= ~USBIP_EH_SHUTDOWN; +- +- break; + } + +- /* Stop the error handler. */ +- if (ud->event & USBIP_EH_BYE) +- return -1; +- + /* Reset the device. */ + if (ud->event & USBIP_EH_RESET) { + ud->eh_ops.reset(ud); + + ud->event &= ~USBIP_EH_RESET; +- +- break; + } + + /* Mark the device as unusable. */ +@@ -60,13 +52,11 @@ static int event_handler(struct usbip_de + ud->eh_ops.unusable(ud); + + ud->event &= ~USBIP_EH_UNUSABLE; +- +- break; + } + +- /* NOTREACHED */ +- printk(KERN_ERR "%s: unknown event\n", __func__); +- return -1; ++ /* Stop the error handler. */ ++ if (ud->event & USBIP_EH_BYE) ++ return -1; + } + + return 0;