linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 000/173] 2.6.27.59-longterm review
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 001/173] USB: EHCI: ASPM quirk of ISOC on AMD SB800 Willy Tarreau
                   ` (172 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review

This is the start of the longterm review cycle for the 2.6.27.59 release.

This release is quite large, because it contains accumulated changes
from the last 2.5 months.  I spent all the day carefully reviewing 380
patches and backporting 173 of them.  I *think* the patches are OK, make
allmodconfig is happy and the code runs here, though I have only tested
x86 and x86_64.  There were a bunch of powerpc fixes that I could not
test but which applied well.  Any check on them will be appreciated.

All patches will be posted as a response to this one.  If anyone has any
issues with these being applied, please let me know.  If anyone is a
maintainer of the proper subsystem, and wants to add a Signed-off-by:
line to the patch, please respond with it.

The full quilt queue can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/longterm/longterm-queue-2.6.27.git

Responses should be made within 72 hours. Anything received after that
time might be too late.

The whole patch series can be found in one patch at:
        kernel.org/pub/linux/kernel/v2.6/longterm-review/patch-2.6.27.59-rc1.gz
and the diffstat can be found below.

 Documentation/kernel-parameters.txt             |    1 +
 MAINTAINERS                                     |    2 -
 arch/arm/kernel/signal.c                        |    4 +-
 arch/ia64/sn/pci/tioca_provider.c               |    2 +-
 arch/parisc/kernel/firmware.c                   |   23 +------
 arch/parisc/kernel/irq.c                        |    2 +-
 arch/powerpc/include/asm/hvcall.h               |    1 +
 arch/powerpc/kernel/cpu_setup_6xx.S             |   40 ++++++------
 arch/powerpc/kernel/crash.c                     |   42 ++++++++++++-
 arch/powerpc/kernel/machine_kexec_64.c          |   25 +++++++
 arch/powerpc/kernel/rtas_flash.c                |   39 ++++++-----
 arch/powerpc/kernel/setup_64.c                  |   17 ++++-
 arch/powerpc/platforms/pseries/hvCall.S         |   38 +++++++++++
 arch/powerpc/platforms/pseries/lpar.c           |   35 ++++++----
 arch/powerpc/platforms/pseries/plpar_wrappers.h |   18 +++++
 arch/powerpc/sysdev/fsl_rio.c                   |    1 -
 arch/s390/include/asm/processor.h               |    5 --
 arch/s390/kernel/traps.c                        |   37 -----------
 arch/x86/kernel/e820.c                          |    3 +
 arch/x86/kernel/early-quirks.c                  |    7 ++-
 arch/x86/kernel/entry_64.S                      |    2 +-
 arch/x86/lib/semaphore_32.S                     |    2 +-
 arch/x86/mm/pgtable.c                           |    3 +-
 drivers/acpi/asus_acpi.c                        |    8 +--
 drivers/ata/ahci.c                              |   15 ++++
 drivers/ata/libata-core.c                       |   24 ++++---
 drivers/ata/pata_mpc52xx.c                      |    2 +-
 drivers/block/cciss.h                           |    1 +
 drivers/block/pktcdvd.c                         |    2 +-
 drivers/bluetooth/btusb.c                       |    3 +
 drivers/char/tpm/tpm.c                          |   12 ++--
 drivers/firmware/dcdbas.c                       |    4 +-
 drivers/hwmon/f71882fg.c                        |    2 +-
 drivers/hwmon/via686a.c                         |   14 +++-
 drivers/infiniband/core/cm.c                    |    1 +
 drivers/infiniband/core/cma.c                   |   15 ++++
 drivers/input/serio/i8042-x86ia64io.h           |   21 ++++++
 drivers/input/serio/i8042.c                     |    6 ++-
 drivers/input/xen-kbdfront.c                    |   45 +++++++------
 drivers/isdn/hisax/config.c                     |   18 ++++-
 drivers/isdn/hisax/hisax.h                      |    1 +
 drivers/isdn/i4l/isdn_tty.c                     |    6 --
 drivers/md/dm-raid1.c                           |    2 +-
 drivers/md/md.c                                 |    8 ++-
 drivers/media/dvb/ttpci/av7110_ca.c             |    2 +-
 drivers/media/radio/radio-aimslab.c             |   24 ++-----
 drivers/media/video/sn9c102/sn9c102_core.c      |    6 +-
 drivers/message/fusion/mptscsih.c               |    2 +
 drivers/mfd/ucb1x00-ts.c                        |   12 +++-
 drivers/misc/acer-wmi.c                         |    6 +-
 drivers/misc/tc1100-wmi.c                       |    2 +-
 drivers/net/myri10ge/myri10ge.c                 |    1 +
 drivers/net/r8169.c                             |    6 ++
 drivers/net/wireless/hostap/hostap_cs.c         |   10 +--
 drivers/net/wireless/rt2x00/rt73usb.c           |    1 +
 drivers/pci/quirks.c                            |   63 +++++++++++++++---
 drivers/rtc/rtc-ds1511.c                        |    2 +-
 drivers/s390/char/keyboard.c                    |    3 +-
 drivers/scsi/libsas/sas_scsi_host.c             |    1 +
 drivers/scsi/sd.c                               |    9 ++-
 drivers/scsi/ses.c                              |    4 +-
 drivers/serial/8250.c                           |    3 +-
 drivers/usb/class/cdc-acm.c                     |    3 +-
 drivers/usb/core/hcd-pci.c                      |    4 +-
 drivers/usb/core/hub.c                          |    5 ++
 drivers/usb/gadget/printer.c                    |   14 ++--
 drivers/usb/host/ehci-hcd.c                     |   28 ++++++--
 drivers/usb/host/ehci-pci.c                     |   39 +++++++++++
 drivers/usb/host/ehci-q.c                       |   27 +++-----
 drivers/usb/host/ehci-sched.c                   |   79 +++++++++++++++++++++++
 drivers/usb/host/ehci.h                         |    1 +
 drivers/usb/host/ohci-hcd.c                     |    9 ++-
 drivers/usb/host/ohci-pci.c                     |   18 +++++
 drivers/usb/host/ohci.h                         |    1 +
 drivers/usb/host/pci-quirks.c                   |   18 +++--
 drivers/usb/misc/iowarrior.c                    |    2 +-
 drivers/usb/misc/uss720.c                       |    7 +-
 drivers/usb/musb/omap2430.c                     |    1 +
 drivers/usb/serial/ch341.c                      |    1 +
 drivers/usb/serial/io_edgeport.c                |    4 +-
 drivers/usb/serial/kobil_sct.c                  |    2 +-
 drivers/usb/serial/pl2303.c                     |    2 +
 drivers/usb/serial/pl2303.h                     |    2 +
 drivers/usb/serial/ti_usb_3410_5052.c           |    2 +-
 drivers/usb/storage/unusual_devs.h              |   16 +++++
 drivers/video/console/tileblit.c                |    2 +-
 drivers/virtio/virtio_pci.c                     |    1 +
 fs/aio.c                                        |    4 +-
 fs/compat.c                                     |   28 ++++----
 fs/dquot.c                                      |   11 +--
 fs/ecryptfs/keystore.c                          |    1 +
 fs/exec.c                                       |   30 ++++++++-
 fs/ext2/namei.c                                 |    9 +--
 fs/ext3/namei.c                                 |    2 +-
 fs/ext3/super.c                                 |    7 ++
 fs/ext4/inode.c                                 |   11 ++--
 fs/gfs2/bmap.c                                  |    2 +-
 fs/nfs/direct.c                                 |   34 ++++++----
 fs/nfs/file.c                                   |    2 +-
 fs/nfsd/lockd.c                                 |    1 -
 fs/nfsd/nfs4xdr.c                               |    8 +-
 fs/nfsd/vfs.c                                   |    2 +-
 fs/ocfs2/aops.c                                 |    6 ++
 fs/ocfs2/stack_user.c                           |    2 +-
 fs/partitions/ldm.c                             |    5 ++
 fs/partitions/mac.c                             |   17 +++--
 fs/proc/array.c                                 |    7 +--
 fs/proc/base.c                                  |    9 ++-
 fs/proc/task_mmu.c                              |    4 +-
 fs/ramfs/file-nommu.c                           |    1 +
 fs/ubifs/commit.c                               |    2 +-
 fs/ubifs/file.c                                 |    3 +
 fs/ubifs/lpt.c                                  |    7 +-
 fs/xfs/linux-2.6/xfs_ioctl.c                    |   11 ++-
 fs/xfs/xfs_fsops.c                              |    3 +
 include/asm-x86/mach-default/smpboot_hooks.h    |    2 +-
 include/asm-x86/mmu_context_32.h                |    5 +-
 include/asm-x86/mmu_context_64.h                |    5 +-
 include/asm-x86/pgtable-3level.h                |   11 +--
 include/drm/drm_pciids.h                        |    1 -
 include/linux/binfmts.h                         |    5 ++
 include/linux/pid.h                             |    2 +-
 include/net/sctp/command.h                      |    1 +
 include/scsi/scsi_device.h                      |    2 +-
 include/sound/soc-dapm.h                        |   16 ++--
 init/calibrate.c                                |    6 +-
 kernel/irq/manage.c                             |    2 +-
 kernel/kgdb.c                                   |    9 +--
 kernel/pid.c                                    |    5 +-
 kernel/ptrace.c                                 |    2 +-
 kernel/signal.c                                 |    8 ++-
 mm/mremap.c                                     |   19 ++++--
 mm/shmem.c                                      |    1 +
 net/ax25/af_ax25.c                              |    2 +-
 net/bluetooth/bnep/sock.c                       |    1 +
 net/bluetooth/sco.c                             |    1 +
 net/bridge/netfilter/ebtables.c                 |    2 +
 net/can/bcm.c                                   |    4 +-
 net/core/filter.c                               |   64 ++++++++++--------
 net/dccp/input.c                                |    7 +-
 net/econet/af_econet.c                          |    8 ++-
 net/ipv4/inet_diag.c                            |   27 +++++---
 net/ipv4/netfilter/arp_tables.c                 |    3 +
 net/ipv4/netfilter/ip_tables.c                  |    3 +
 net/ipv4/netfilter/ipt_CLUSTERIP.c              |    5 +-
 net/ipv4/tcp.c                                  |    3 +-
 net/ipv6/netfilter/ip6_tables.c                 |    3 +
 net/irda/af_irda.c                              |   16 +++--
 net/irda/iriap.c                                |    6 ++
 net/irda/irnet/irnet_ppp.c                      |    3 +
 net/mac80211/sta_info.c                         |    1 +
 net/packet/af_packet.c                          |    3 +-
 net/rose/rose_subr.c                            |   18 +++++-
 net/sctp/auth.c                                 |    8 ++-
 net/sctp/sm_make_chunk.c                        |   32 +++------
 net/sctp/sm_sideeffect.c                        |   26 ++++++++
 net/sctp/sm_statefuns.c                         |    8 ++-
 net/sunrpc/cache.c                              |    4 +-
 net/sunrpc/sched.c                              |   14 ++--
 net/tipc/socket.c                               |    1 +
 net/x25/x25_link.c                              |    4 +
 sound/oss/dev_table.h                           |    2 +-
 sound/oss/midi_synth.c                          |   34 +++++-----
 sound/oss/midi_synth.h                          |    2 +-
 sound/oss/opl3.c                                |   23 ++++--
 sound/oss/sequencer.c                           |    2 +-
 sound/pci/au88x0/au88x0_pcm.c                   |   24 ++++++-
 sound/pci/ens1370.c                             |   23 ++++++-
 168 files changed, 1162 insertions(+), 560 deletions(-)




^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 001/173] USB: EHCI: ASPM quirk of ISOC on AMD SB800
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
  2011-04-25 20:02 ` [PATCH 000/173] 2.6.27.59-longterm review Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 002/173] rt2x00: add device id for windy31 usb device Willy Tarreau
                   ` (171 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Alex He, David Brownell, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alex He <alex.he@amd.com>

commit 05570297ecbe834b1756b522412b68eaffb9ab11 upstream.

When ASPM PM Feature is enabled on UMI link, devices that use ISOC stream of
data transfer may be exposed to longer latency causing less than optimal per-
formance of the device. The longer latencies are normal and are due to link
wake time coming out of low power state which happens frequently to save
power when the link is not active.
The following code will make exception for certain features of ASPM to be by
passed and keep the logic normal state only when the ISOC device is connected
and active. This change will allow the device to run at optimal performance
yet minimize the impact on overall power savings.

Signed-off-by: Alex He <alex.he@amd.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-hcd.c   |    8 ++++
 drivers/usb/host/ehci-pci.c   |   32 +++++++++++++++++
 drivers/usb/host/ehci-sched.c |   79 ++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/ehci.h       |    1 
 4 files changed, 120 insertions(+)

Index: longterm-2.6.27/drivers/usb/host/ehci-hcd.c
===================================================================
--- longterm-2.6.27.orig/drivers/usb/host/ehci-hcd.c	2011-01-29 11:22:46.000000000 +0100
+++ longterm-2.6.27/drivers/usb/host/ehci-hcd.c	2011-04-25 11:14:47.042278735 +0200
@@ -103,6 +103,9 @@
 
 #define	INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
 
+/* for ASPM quirk of ISOC on AMD SB800 */
+static struct pci_dev *amd_nb_dev;
+
 /*-------------------------------------------------------------------------*/
 
 #include "ehci.h"
@@ -450,6 +453,11 @@
 	spin_unlock_irq (&ehci->lock);
 	ehci_mem_cleanup (ehci);
 
+	if (amd_nb_dev) {
+		pci_dev_put(amd_nb_dev);
+		amd_nb_dev = NULL;
+	}
+
 #ifdef	EHCI_STATS
 	ehci_dbg (ehci, "irq normal %ld err %ld reclaim %ld (lost %ld)\n",
 		ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim,
Index: longterm-2.6.27/drivers/usb/host/ehci-pci.c
===================================================================
--- longterm-2.6.27.orig/drivers/usb/host/ehci-pci.c	2011-01-23 10:52:26.000000000 +0100
+++ longterm-2.6.27/drivers/usb/host/ehci-pci.c	2011-04-25 11:14:47.046278205 +0200
@@ -61,6 +61,35 @@
 	return 0;
 }
 
+static int ehci_quirk_amd_SB800(struct ehci_hcd *ehci)
+{
+	struct pci_dev *amd_smbus_dev;
+	u8 rev = 0;
+
+	amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI, 0x4385, NULL);
+	if (!amd_smbus_dev)
+		return 0;
+
+	pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev);
+	if (rev < 0x40) {
+		pci_dev_put(amd_smbus_dev);
+		amd_smbus_dev = NULL;
+		return 0;
+	}
+
+	if (!amd_nb_dev)
+		amd_nb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1510, NULL);
+	if (!amd_nb_dev)
+		ehci_err(ehci, "QUIRK: unable to get AMD NB device\n");
+
+	ehci_info(ehci, "QUIRK: Enable AMD SB800 L1 fix\n");
+
+	pci_dev_put(amd_smbus_dev);
+	amd_smbus_dev = NULL;
+
+	return 1;
+}
+
 /* called during probe() after chip reset completes */
 static int ehci_pci_setup(struct usb_hcd *hcd)
 {
@@ -119,6 +148,9 @@
 	/* cache this readonly data; minimize chip reads */
 	ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
 
+	if (ehci_quirk_amd_SB800(ehci))
+		ehci->amd_l1_fix = 1;
+
 	retval = ehci_halt(ehci);
 	if (retval)
 		return retval;
Index: longterm-2.6.27/drivers/usb/host/ehci-sched.c
===================================================================
--- longterm-2.6.27.orig/drivers/usb/host/ehci-sched.c	2011-01-23 10:52:26.000000000 +0100
+++ longterm-2.6.27/drivers/usb/host/ehci-sched.c	2011-04-25 11:14:47.052279777 +0200
@@ -1496,6 +1496,63 @@
 	ehci->periodic[frame] = cpu_to_hc32(ehci, itd->itd_dma | Q_TYPE_ITD);
 }
 
+#define AB_REG_BAR_LOW 0xe0
+#define AB_REG_BAR_HIGH 0xe1
+#define AB_INDX(addr) ((addr) + 0x00)
+#define AB_DATA(addr) ((addr) + 0x04)
+#define NB_PCIE_INDX_ADDR 0xe0
+#define NB_PCIE_INDX_DATA 0xe4
+#define NB_PIF0_PWRDOWN_0 0x01100012
+#define NB_PIF0_PWRDOWN_1 0x01100013
+
+static void ehci_quirk_amd_L1(struct ehci_hcd *ehci, int disable)
+{
+	u32 addr, addr_low, addr_high, val;
+
+	outb_p(AB_REG_BAR_LOW, 0xcd6);
+	addr_low = inb_p(0xcd7);
+	outb_p(AB_REG_BAR_HIGH, 0xcd6);
+	addr_high = inb_p(0xcd7);
+	addr = addr_high << 8 | addr_low;
+	outl_p(0x30, AB_INDX(addr));
+	outl_p(0x40, AB_DATA(addr));
+	outl_p(0x34, AB_INDX(addr));
+	val = inl_p(AB_DATA(addr));
+
+	if (disable) {
+		val &= ~0x8;
+		val |= (1 << 4) | (1 << 9);
+	} else {
+		val |= 0x8;
+		val &= ~((1 << 4) | (1 << 9));
+	}
+	outl_p(val, AB_DATA(addr));
+
+	if (amd_nb_dev) {
+		addr = NB_PIF0_PWRDOWN_0;
+		pci_write_config_dword(amd_nb_dev, NB_PCIE_INDX_ADDR, addr);
+		pci_read_config_dword(amd_nb_dev, NB_PCIE_INDX_DATA, &val);
+		if (disable)
+			val &= ~(0x3f << 7);
+		else
+			val |= 0x3f << 7;
+
+		pci_write_config_dword(amd_nb_dev, NB_PCIE_INDX_DATA, val);
+
+		addr = NB_PIF0_PWRDOWN_1;
+		pci_write_config_dword(amd_nb_dev, NB_PCIE_INDX_ADDR, addr);
+		pci_read_config_dword(amd_nb_dev, NB_PCIE_INDX_DATA, &val);
+		if (disable)
+			val &= ~(0x3f << 7);
+		else
+			val |= 0x3f << 7;
+
+		pci_write_config_dword(amd_nb_dev, NB_PCIE_INDX_DATA, val);
+	}
+
+	return;
+}
+
 /* fit urb's itds into the selected schedule slot; activate as needed */
 static int
 itd_link_urb (
@@ -1523,6 +1580,12 @@
 			next_uframe >> 3, next_uframe & 0x7);
 		stream->start = jiffies;
 	}
+
+	if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
+		if (ehci->amd_l1_fix == 1)
+			ehci_quirk_amd_L1(ehci, 1);
+	}
+
 	ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++;
 
 	/* fill iTDs uframe by uframe */
@@ -1649,6 +1712,11 @@
 	(void) disable_periodic(ehci);
 	ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
 
+	if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
+		if (ehci->amd_l1_fix == 1)
+			ehci_quirk_amd_L1(ehci, 0);
+	}
+
 	if (unlikely(list_is_singular(&stream->td_list))) {
 		ehci_to_hcd(ehci)->self.bandwidth_allocated
 				-= stream->bandwidth;
@@ -1936,6 +2004,12 @@
 			stream->interval, hc32_to_cpu(ehci, stream->splits));
 		stream->start = jiffies;
 	}
+
+	if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
+		if (ehci->amd_l1_fix == 1)
+			ehci_quirk_amd_L1(ehci, 1);
+	}
+
 	ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs++;
 
 	/* fill sITDs frame by frame */
@@ -2038,6 +2112,11 @@
 	(void) disable_periodic(ehci);
 	ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
 
+	if (ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs == 0) {
+		if (ehci->amd_l1_fix == 1)
+			ehci_quirk_amd_L1(ehci, 0);
+	}
+
 	if (list_is_singular(&stream->td_list)) {
 		ehci_to_hcd(ehci)->self.bandwidth_allocated
 				-= stream->bandwidth;
Index: longterm-2.6.27/drivers/usb/host/ehci.h
===================================================================
--- longterm-2.6.27.orig/drivers/usb/host/ehci.h	2011-01-23 10:52:26.000000000 +0100
+++ longterm-2.6.27/drivers/usb/host/ehci.h	2011-04-25 11:15:22.138279941 +0200
@@ -122,6 +122,7 @@
 	unsigned		has_fsl_port_bug:1; /* FreeScale */
 	unsigned		big_endian_mmio:1;
 	unsigned		big_endian_desc:1;
+	unsigned		amd_l1_fix:1;
 
 	u8			sbrn;		/* packed release number */
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 002/173] rt2x00: add device id for windy31 usb device
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
  2011-04-25 20:02 ` [PATCH 000/173] 2.6.27.59-longterm review Willy Tarreau
  2011-04-25 20:02 ` [PATCH 001/173] USB: EHCI: ASPM quirk of ISOC on AMD SB800 Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 003/173] hwmon: (via686a) Initialize fan_div values Willy Tarreau
                   ` (170 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Greg Kroah-Hartman, Ivo van Doorn, John W. Linville

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Greg Kroah-Hartman <gregkh@suse.de>

commit 9c4cf6d94fb362c27a24df5223ed6e327eb7279a upstream.

This patch adds the device id for the windy31 USB device to the rt73usb
driver.

Thanks to Ralf Flaxa for reporting this and providing testing and a
sample device.

Reported-by: Ralf Flaxa <rf@suse.de>
Tested-by: Ralf Flaxa <rf@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 0b4e859..029be3c 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2446,6 +2446,7 @@ static struct usb_device_id rt73usb_device_table[] = {
 	{ USB_DEVICE(0x04bb, 0x093d), USB_DEVICE_DATA(&rt73usb_ops) },
 	{ USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt73usb_ops) },
 	{ USB_DEVICE(0x148f, 0x2671), USB_DEVICE_DATA(&rt73usb_ops) },
+	{ USB_DEVICE(0x0812, 0x3101), USB_DEVICE_DATA(&rt73usb_ops) },
 	/* Qcom */
 	{ USB_DEVICE(0x18e8, 0x6196), USB_DEVICE_DATA(&rt73usb_ops) },
 	{ USB_DEVICE(0x18e8, 0x6229), USB_DEVICE_DATA(&rt73usb_ops) },



^ permalink raw reply related	[flat|nested] 192+ messages in thread

* [PATCH 003/173] hwmon: (via686a) Initialize fan_div values
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (2 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 002/173] rt2x00: add device id for windy31 usb device Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 004/173] USB: usb-storage: unusual_devs entry for CamSport Evo Willy Tarreau
                   ` (169 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jean Delvare, Guenter Roeck, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jean Delvare <khali@linux-fr.org>

commit f790674d3f87df6390828ac21a7d1530f71b59c8 upstream.

Functions set_fan_min() and set_fan_div() assume that the fan_div
values have already been read from the register. The driver currently
doesn't initialize them at load time, they are only set when function
via686a_update_device() is called. This means that set_fan_min() and
set_fan_div() misbehave if, for example, "sensors -s" is called
before any monitoring application (e.g. "sensors") is has been run.

Fix the problem by always initializing the fan_div values at device
bind time.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/hwmon/via686a.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

--- a/drivers/hwmon/via686a.c
+++ b/drivers/hwmon/via686a.c
@@ -687,6 +687,13 @@ static int __devexit via686a_remove(stru
 	return 0;
 }
 
+static void via686a_update_fan_div(struct via686a_data *data)
+{
+	int reg = via686a_read_value(data, VIA686A_REG_FANDIV);
+	data->fan_div[0] = (reg >> 4) & 0x03;
+	data->fan_div[1] = reg >> 6;
+}
+
 static void __devinit via686a_init_device(struct via686a_data *data)
 {
 	u8 reg;
@@ -700,6 +707,9 @@ static void __devinit via686a_init_devic
 	via686a_write_value(data, VIA686A_REG_TEMP_MODE,
 			    (reg & ~VIA686A_TEMP_MODE_MASK)
 			    | VIA686A_TEMP_MODE_CONTINUOUS);
+
+	/* Pre-read fan clock divisor values */
+	via686a_update_fan_div(data);
 }
 
 static struct via686a_data *via686a_update_device(struct device *dev)
@@ -751,9 +761,7 @@ static struct via686a_data *via686a_upda
 		    (via686a_read_value(data, VIA686A_REG_TEMP_LOW23) &
 		     0xc0) >> 6;
 
-		i = via686a_read_value(data, VIA686A_REG_FANDIV);
-		data->fan_div[0] = (i >> 4) & 0x03;
-		data->fan_div[1] = i >> 6;
+		via686a_update_fan_div(data);
 		data->alarms =
 		    via686a_read_value(data,
 				       VIA686A_REG_ALARM1) |



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 004/173] USB: usb-storage: unusual_devs entry for CamSport Evo
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (3 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 003/173] hwmon: (via686a) Initialize fan_div values Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 005/173] USB: EHCI: ASPM quirk of ISOC on AMD Hudson Willy Tarreau
                   ` (168 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Alan Stern, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit 12f68c480c7155a66bd2a76ab2fef28dd5f93fa2 upstream.

This patch (as1438) adds an unusual_devs entry for the MagicPixel
FW_Omega2 chip, used in the CamSport Evo camera.  The firmware
incorrectly reports a vendor-specific bDeviceClass.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: <ttkspam@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/storage/unusual_devs.h |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1043,6 +1043,15 @@ UNUSUAL_DEV(  0x084d, 0x0011, 0x0110, 0x
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_BULK32),
 
+/* Reported by <ttkspam@free.fr>
+ * The device reports a vendor-specific device class, requiring an
+ * explicit vendor/product match.
+ */
+UNUSUAL_DEV(  0x0851, 0x1542, 0x0002, 0x0002,
+		"MagicPixel",
+		"FW_Omega2",
+		US_SC_DEVICE, US_PR_DEVICE, NULL, 0),
+
 /* Andrew Lunn <andrew@lunn.ch>
  * PanDigital Digital Picture Frame. Does not like ALLOW_MEDIUM_REMOVAL
  * on LUN 4.



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 005/173] USB: EHCI: ASPM quirk of ISOC on AMD Hudson
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (4 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 004/173] USB: usb-storage: unusual_devs entry for CamSport Evo Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 006/173] USB: EHCI: fix DMA deallocation bug Willy Tarreau
                   ` (167 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Alex He, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alex He <alex.he@amd.com>

commit baab93afc2844b68d57b0dcca5e1d34c5d7cf411 upstream.

AMD Hudson also needs the same ASPM quirk as SB800

Signed-off-by: Alex He <alex.he@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-pci.c |   33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -41,28 +41,35 @@ static int ehci_pci_reinit(struct ehci_h
 	return 0;
 }
 
-static int ehci_quirk_amd_SB800(struct ehci_hcd *ehci)
+static int ehci_quirk_amd_hudson(struct ehci_hcd *ehci)
 {
 	struct pci_dev *amd_smbus_dev;
 	u8 rev = 0;
 
 	amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_ATI, 0x4385, NULL);
-	if (!amd_smbus_dev)
-		return 0;
-
-	pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev);
-	if (rev < 0x40) {
-		pci_dev_put(amd_smbus_dev);
-		amd_smbus_dev = NULL;
-		return 0;
+	if (amd_smbus_dev) {
+		pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev);
+		if (rev < 0x40) {
+			pci_dev_put(amd_smbus_dev);
+			amd_smbus_dev = NULL;
+			return 0;
+		}
+	} else {
+		amd_smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x780b, NULL);
+		if (!amd_smbus_dev)
+			return 0;
+		pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev);
+		if (rev < 0x11 || rev > 0x18) {
+			pci_dev_put(amd_smbus_dev);
+			amd_smbus_dev = NULL;
+			return 0;
+		}
 	}
 
 	if (!amd_nb_dev)
 		amd_nb_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1510, NULL);
-	if (!amd_nb_dev)
-		ehci_err(ehci, "QUIRK: unable to get AMD NB device\n");
 
-	ehci_info(ehci, "QUIRK: Enable AMD SB800 L1 fix\n");
+	ehci_info(ehci, "QUIRK: Enable exception for AMD Hudson ASPM\n");
 
 	pci_dev_put(amd_smbus_dev);
 	amd_smbus_dev = NULL;
@@ -128,7 +135,7 @@ static int ehci_pci_setup(struct usb_hcd
 	/* cache this readonly data; minimize chip reads */
 	ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
 
-	if (ehci_quirk_amd_SB800(ehci))
+	if (ehci_quirk_amd_hudson(ehci))
 		ehci->amd_l1_fix = 1;
 
 	retval = ehci_halt(ehci);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 006/173] USB: EHCI: fix DMA deallocation bug
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (5 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 005/173] USB: EHCI: ASPM quirk of ISOC on AMD Hudson Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 007/173] USB: g_printer: fix bug in module parameter definitions Willy Tarreau
                   ` (166 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Alan Stern, David Brownell, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit f75593ceaa08e6d27aec1a5de31cded19e850dd1 upstream.

This patch (as1440) fixes a bug in ehci-hcd.  ehci->periodic_size is
used to compute the size in a dma_alloc_coherent() call, but then it
gets changed later on.  As a result, the corresponding call to
dma_free_coherent() passes a different size from the original
allocation.  Fix the problem by adjusting ehci->periodic_size before
carrying out any of the memory allocations.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-hcd.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

Index: longterm-2.6.27/drivers/usb/host/ehci-hcd.c
===================================================================
--- longterm-2.6.27.orig/drivers/usb/host/ehci-hcd.c	2011-04-25 11:14:47.000000000 +0200
+++ longterm-2.6.27/drivers/usb/host/ehci-hcd.c	2011-04-25 11:43:03.837278216 +0200
@@ -488,17 +488,29 @@
 	ehci->iaa_watchdog.function = ehci_iaa_watchdog;
 	ehci->iaa_watchdog.data = (unsigned long) ehci;
 
+	hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
+
 	/*
 	 * hw default: 1K periodic list heads, one per frame.
 	 * periodic_size can shrink by USBCMD update if hcc_params allows.
 	 */
 	ehci->periodic_size = DEFAULT_I_TDPS;
 	INIT_LIST_HEAD(&ehci->cached_itd_list);
+
+	if (HCC_PGM_FRAMELISTLEN(hcc_params)) {
+		/* periodic schedule size can be smaller than default */
+		switch (EHCI_TUNE_FLS) {
+		case 0: ehci->periodic_size = 1024; break;
+		case 1: ehci->periodic_size = 512; break;
+		case 2: ehci->periodic_size = 256; break;
+		default:        BUG();
+		}
+	}
+
 	if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
 		return retval;
 
 	/* controllers may cache some of the periodic schedule ... */
-	hcc_params = ehci_readl(ehci, &ehci->caps->hcc_params);
 	if (HCC_ISOC_CACHE(hcc_params))		// full frame cache
 		ehci->i_thresh = 8;
 	else					// N microframes cached
@@ -546,12 +558,6 @@
 		/* periodic schedule size can be smaller than default */
 		temp &= ~(3 << 2);
 		temp |= (EHCI_TUNE_FLS << 2);
-		switch (EHCI_TUNE_FLS) {
-		case 0: ehci->periodic_size = 1024; break;
-		case 1: ehci->periodic_size = 512; break;
-		case 2: ehci->periodic_size = 256; break;
-		default:	BUG();
-		}
 	}
 	ehci->command = temp;
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 007/173] USB: g_printer: fix bug in module parameter definitions
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (6 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 006/173] USB: EHCI: fix DMA deallocation bug Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 008/173] USB: io_edgeport: fix the reported firmware major and minor Willy Tarreau
                   ` (165 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Alan Stern, Roland Kletzing, Craig W. Nadler, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit ad84e4a9efb7c8ed322bafb6ebdb9c3a49a3d3a8 upstream.

This patch (as1442) fixes a bug in g_printer: Module parameters should
not be marked "__initdata" if they are accessible in sysfs (i.e., if
the mode value in the module_param() macro is nonzero).  Otherwise
attempts to access the parameters will cause addressing violations.

Character-string module parameters must not be marked "__initdata"
if the module can be unloaded, because the kernel needs to access the
parameter variable at unload time in order to free the
dynamically-allocated string.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Roland Kletzing <devzero@web.de>
CC: Craig W. Nadler <craig@nadler.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/gadget/printer.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -130,31 +130,31 @@ static struct printer_dev usb_printer_ga
  * parameters are in UTF-8 (superset of ASCII's 7 bit characters).
  */
 
-static ushort __initdata idVendor;
+static ushort idVendor;
 module_param(idVendor, ushort, S_IRUGO);
 MODULE_PARM_DESC(idVendor, "USB Vendor ID");
 
-static ushort __initdata idProduct;
+static ushort idProduct;
 module_param(idProduct, ushort, S_IRUGO);
 MODULE_PARM_DESC(idProduct, "USB Product ID");
 
-static ushort __initdata bcdDevice;
+static ushort bcdDevice;
 module_param(bcdDevice, ushort, S_IRUGO);
 MODULE_PARM_DESC(bcdDevice, "USB Device version (BCD)");
 
-static char *__initdata iManufacturer;
+static char *iManufacturer;
 module_param(iManufacturer, charp, S_IRUGO);
 MODULE_PARM_DESC(iManufacturer, "USB Manufacturer string");
 
-static char *__initdata iProduct;
+static char *iProduct;
 module_param(iProduct, charp, S_IRUGO);
 MODULE_PARM_DESC(iProduct, "USB Product string");
 
-static char *__initdata iSerialNum;
+static char *iSerialNum;
 module_param(iSerialNum, charp, S_IRUGO);
 MODULE_PARM_DESC(iSerialNum, "1");
 
-static char *__initdata iPNPstring;
+static char *iPNPstring;
 module_param(iPNPstring, charp, S_IRUGO);
 MODULE_PARM_DESC(iPNPstring, "MFG:linux;MDL:g_printer;CLS:PRINTER;SN:1;");
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 008/173] USB: io_edgeport: fix the reported firmware major and minor
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (7 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 007/173] USB: g_printer: fix bug in module parameter definitions Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 009/173] USB: ti_usb: fix module removal Willy Tarreau
                   ` (164 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: BjÞrn Mork, Greg Kroah-Hartman

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1551 bytes --]

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Bjørn Mork <bjorn@mork.no>

commit 271c1150b4f8e1685e5a8cbf76e329ec894481da upstream.

The major and minor number saved in the product_info structure
were copied from the address instead of the data, causing an
inconsistency in the reported versions during firmware loading:

 usb 4-1: firmware: requesting edgeport/down.fw
 /usr/src/linux/drivers/usb/serial/io_edgeport.c: downloading firmware version (930) 1.16.4
 [..]
 /usr/src/linux/drivers/usb/serial/io_edgeport.c: edge_startup - time 3 4328191260
 /usr/src/linux/drivers/usb/serial/io_edgeport.c:   FirmwareMajorVersion  0.0.4

This can cause some confusion whether firmware loaded successfully
or not.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/io_edgeport.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -2935,8 +2935,8 @@ static void load_application_firmware(st
 
 	dbg("%s %d.%d.%d", fw_info, rec->data[0], rec->data[1], build);
 
-	edge_serial->product_info.FirmwareMajorVersion = fw->data[0];
-	edge_serial->product_info.FirmwareMinorVersion = fw->data[1];
+	edge_serial->product_info.FirmwareMajorVersion = rec->data[0];
+	edge_serial->product_info.FirmwareMinorVersion = rec->data[1];
 	edge_serial->product_info.FirmwareBuildNumber = cpu_to_le16(build);
 
 	for (rec = ihex_next_binrec(rec); rec;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 009/173] USB: ti_usb: fix module removal
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (8 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 008/173] USB: io_edgeport: fix the reported firmware major and minor Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 010/173] USB: Storage: Add unusual_devs entry for VTech Kidizoom Willy Tarreau
                   ` (163 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Ionut Nicu, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Ionut Nicu <ionut.nicu@gmail.com>

commit b14de3857227cd978f515247853fd15cc2425d3e upstream.

If usb_deregister() is called after usb_serial_deregister() when
the device is plugged in, the following Oops occurs:

[   95.337377] BUG: unable to handle kernel NULL pointer dereference at 00000010
[   95.338236] IP: [<c0776b2d>] klist_put+0x12/0x62
[   95.338356] *pdpt = 000000003001a001 *pde = 0000000000000000
[   95.338356] Oops: 0000 [#1] SMP
[   95.340499] last sysfs file: /sys/devices/pci0000:00/0000:00:1d.2/usb8/idVendor
[   95.340499] Modules linked in: ti_usb_3410_5052(-) usbserial cpufreq_ondemand acpi_cpufreq mperf iptable_nat nf_nat iptable_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables ipv6 uinput arc4 ecb iwlagn iwlcore mac80211 cfg80211 microcode pcspkr acer_wmi joydev wmi sky2 [last unloaded: scsi_wait_scan]
[   95.341908]
[   95.341908] Pid: 1532, comm: modprobe Not tainted 2.6.37-rc7+ #6 Eiger                          /Aspire 5930
[   95.341908] EIP: 0060:[<c0776b2d>] EFLAGS: 00010246 CPU: 0
[   95.341908] EIP is at klist_put+0x12/0x62
[   95.341908] EAX: 00000000 EBX: eedc0c84 ECX: c09c21b4 EDX: 00000001
[   95.341908] ESI: 00000000 EDI: efaa0c1c EBP: f214fe2c ESP: f214fe1c
[   95.341908]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[   95.341908] Process modprobe (pid: 1532, ti=f214e000 task=efaaf080 task.ti=f214e000)
[   95.341908] Stack:
[   95.341908]  f214fe24 eedc0c84 efaaf080 efaa0c1c f214fe34 c0776ba8 f214fe5c c0776c76
[   95.341908]  c09c21b4 c09c21b4 eedc0c84 efaaf080 00000000 c0634398 eafe2d1c f7b515f0
[   95.341908]  f214fe6c c0631b5c eafe2d50 eafe2d1c f214fe7c c0631ba2 eafe2d1c eafe2c00
[   95.341908] Call Trace:
[   95.341908]  [<c0776ba8>] ? klist_del+0xd/0xf
[   95.341908]  [<c0776c76>] ? klist_remove+0x48/0x74
[   95.341908]  [<c0634398>] ? devres_release_all+0x49/0x51
[   95.341908]  [<c0631b5c>] ? __device_release_driver+0x7b/0xa4
[   95.341908]  [<c0631ba2>] ? device_release_driver+0x1d/0x28
[   95.341908]  [<c06317c4>] ? bus_remove_device+0x92/0xa1
[   95.341908]  [<c062f3d8>] ? device_del+0xf9/0x13e
[   95.341908]  [<f7b06146>] ? usb_serial_disconnect+0xd9/0x116 [usbserial]
[   95.341908]  [<c0681e3f>] ? usb_disable_interface+0x32/0x40
[   95.341908]  [<c0683972>] ? usb_unbind_interface+0x48/0xfd
[   95.341908]  [<c0631b43>] ? __device_release_driver+0x62/0xa4
[   95.341908]  [<c06320b9>] ? driver_detach+0x62/0x81
[   95.341908]  [<c0631a41>] ? bus_remove_driver+0x8f/0xae
[   95.341908]  [<c063214c>] ? driver_unregister+0x50/0x57
[   95.341908]  [<c0682f95>] ? usb_deregister+0x77/0x84
[   95.341908]  [<f7b505b6>] ? ti_exit+0x26/0x28 [ti_usb_3410_5052]
[   95.341908]  [<c046a307>] ? sys_delete_module+0x181/0x1de
[   95.341908]  [<c04e2727>] ? path_put+0x1a/0x1d
[   95.341908]  [<c047f4c5>] ? audit_syscall_entry+0x116/0x138
[   95.341908]  [<c04094df>] ? sysenter_do_call+0x12/0x28
[   95.341908] Code: 00 83 7d f0 00 74 09 85 f6 74 05 89 f0 ff 55 f0 8b 43 04 5a 5b 5e 5f 5d c3 55 89 e5 57 56 53 89 c3 83 ec 04 8b 30 83 e6 fe 89 f0 <8b> 7e 10 88 55 f0 e8 47 26 01 00 8a 55 f0 84 d2 74 17 f6 03 01
[   95.341908] EIP: [<c0776b2d>] klist_put+0x12/0x62 SS:ESP 0068:f214fe1c
[   95.341908] CR2: 0000000000000010
[   95.342357] ---[ end trace 8124d00ad871ad18 ]---

Signed-off-by: Ionut Nicu <ionut.nicu@mindbit.ro>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/ti_usb_3410_5052.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -366,9 +366,9 @@ failed_1port:
 
 static void __exit ti_exit(void)
 {
+	usb_deregister(&ti_usb_driver);
 	usb_serial_deregister(&ti_1port_device);
 	usb_serial_deregister(&ti_2port_device);
-	usb_deregister(&ti_usb_driver);
 }
 
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 010/173] USB: Storage: Add unusual_devs entry for VTech Kidizoom
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (9 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 009/173] USB: ti_usb: fix module removal Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 011/173] USB: prevent buggy hubs from crashing the USB stack Willy Tarreau
                   ` (162 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Nick Holloway, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Nick Holloway <Nick.Holloway@pyrites.org.uk>

commit c25f6b1591b158f7ae3b9132367d0fa6d632e70e upstream.

This device suffers from the off-by-one error when reporting the capacity,
so add entry with US_FL_FIX_CAPACITY.

Signed-off-by: Nick Holloway <Nick.Holloway@pyrites.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/storage/unusual_devs.h |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1410,6 +1410,13 @@ UNUSUAL_DEV(  0x0fca, 0x0006, 0x0001, 0x
 		US_FL_IGNORE_DEVICE ),
 #endif
 
+/* Submitted by Nick Holloway */
+UNUSUAL_DEV( 0x0f88, 0x042e, 0x0100, 0x0100,
+		"VTech",
+		"Kidizoom",
+		US_SC_DEVICE, US_PR_DEVICE, NULL,
+		US_FL_FIX_CAPACITY ),
+
 /* Reported by Michael Stattmann <michael@stattmann.com> */
 UNUSUAL_DEV(  0x0fce, 0xd008, 0x0000, 0x0000,
 		"Sony Ericsson",



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 011/173] USB: prevent buggy hubs from crashing the USB stack
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (10 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 010/173] USB: Storage: Add unusual_devs entry for VTech Kidizoom Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 012/173] [SCSI] fix medium error problems with some arrays which can cause data corruption Willy Tarreau
                   ` (161 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Alan Stern, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit d199c96d41d80a567493e12b8e96ea056a1350c1 upstream.

If anyone comes across a high-speed hub that (by mistake or by design)
claims to have no Transaction Translators, plugging a full- or
low-speed device into it will cause the USB stack to crash.  This
patch (as1446) prevents the problem by ignoring such devices, since
the kernel has no way to communicate with them.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Perry Neben <neben@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/core/hub.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2683,6 +2683,11 @@ hub_port_init (struct usb_hub *hub, stru
 		udev->ttport = hdev->ttport;
 	} else if (udev->speed != USB_SPEED_HIGH
 			&& hdev->speed == USB_SPEED_HIGH) {
+		if (!hub->tt.hub) {
+			dev_err(&udev->dev, "parent hub has no TT\n");
+			retval = -EINVAL;
+			goto fail;
+		}
 		udev->tt = &hub->tt;
 		udev->ttport = port1;
 	}



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 012/173] [SCSI] fix medium error problems with some arrays which can cause data corruption
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (11 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 011/173] USB: prevent buggy hubs from crashing the USB stack Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 013/173] [SCSI] libsas: fix runaway error handler problem Willy Tarreau
                   ` (160 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: James Bottomley, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: James Bottomley <James.Bottomley@suse.de>

commit a8733c7baf457b071528e385a0b7d4aaec79287c upstream.

Our current handling of medium error assumes that data is returned up
to the bad sector.  This assumption holds good for all disk devices,
all DIF arrays and most ordinary arrays.  However, an LSI array engine
was recently discovered which reports a medium error without returning
any data.  This means that when we report good data up to the medium
error, we've reported junk originally in the buffer as good.  Worse,
if the read consists of requested data plus a readahead, and the error
occurs in readahead, we'll just strip off the readahead and report
junk up to userspace as good data with no error.

The fix for this is to have the error position computation take into
account the amount of data returned by the driver using the scsi
residual data.  Unfortunately, not every driver fills in this data,
but for those who don't, it's set to zero, which means we'll think a
full set of data was transferred and the behaviour will be identical
to the prior behaviour of the code (believe the buffer up to the error
sector).  All modern drivers seem to set the residual, so that should
fix up the LSI failure/corruption case.

Reported-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/sd.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1040,6 +1040,12 @@ static unsigned int sd_completed_bytes(s
 	u64 end_lba = blk_rq_pos(scmd->request) + (scsi_bufflen(scmd) / 512);
 	u64 bad_lba;
 	int info_valid;
+	/*
+	 * resid is optional but mostly filled in.  When it's unused,
+	 * its value is zero, so we assume the whole buffer transferred
+	 */
+	unsigned int transferred = scsi_bufflen(scmd) - scsi_get_resid(scmd);
+	unsigned int good_bytes;
 
 	if (!blk_fs_request(scmd->request))
 		return 0;
@@ -1073,7 +1079,8 @@ static unsigned int sd_completed_bytes(s
 	/* This computation should always be done in terms of
 	 * the resolution of the device's medium.
 	 */
-	return (bad_lba - start_lba) * scmd->device->sector_size;
+	good_bytes = (bad_lba - start_lba) * scmd->device->sector_size;
+	return min(good_bytes, transferred);
 }
 
 /**



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 013/173] [SCSI] libsas: fix runaway error handler problem
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (12 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 012/173] [SCSI] fix medium error problems with some arrays which can cause data corruption Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 014/173] [media] radio-aimslab.c: Fix gcc 4.5+ bug Willy Tarreau
                   ` (159 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: James Bottomley, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: James Bottomley <James.Bottomley@suse.de>

commit 9ee91f7fb550a4c82f82d9818e42493484c754af upstream.

libsas makes use of scsi_schedule_eh() but forgets to clear the
host_eh_scheduled flag in its error handling routine.  Because of this,
the error handler thread never gets to sleep; it's constantly awake and
trying to run the error routine leading to console spew and inability to
run anything else (at least on a UP system).  The fix is to clear the
flag as we splice the work queue.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/libsas/sas_scsi_host.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -648,6 +648,7 @@ void sas_scsi_recover_host(struct Scsi_H
 
 	spin_lock_irqsave(shost->host_lock, flags);
 	list_splice_init(&shost->eh_cmd_q, &eh_work_q);
+	shost->host_eh_scheduled = 0;
 	spin_unlock_irqrestore(shost->host_lock, flags);
 
 	SAS_DPRINTK("Enter %s\n", __func__);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 014/173] [media] radio-aimslab.c: Fix gcc 4.5+ bug
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (13 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 013/173] [SCSI] libsas: fix runaway error handler problem Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 015/173] ALSA : au88x0 - Limit number of channels to fix Oops via OSS emu Willy Tarreau
                   ` (158 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Mauro Carvalho Chehab <mchehab@redhat.com>

commit e3c92215198cb6aa00ad38db2780faa6b72e0a3f upstream.

gcc 4.5+ doesn't properly evaluate some inlined expressions.
A previous patch were proposed by Andrew Morton using noinline.
However, the entire inlined function is bogus, so let's just
remove it and be happy.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/media/radio/radio-aimslab.c |   23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

Index: longterm-2.6.27/drivers/media/radio/radio-aimslab.c
===================================================================
--- longterm-2.6.27.orig/drivers/media/radio/radio-aimslab.c	2011-01-23 10:52:18.000000000 +0100
+++ longterm-2.6.27/drivers/media/radio/radio-aimslab.c	2011-04-25 11:58:08.977279111 +0200
@@ -31,7 +31,6 @@
 #include <linux/module.h>	/* Modules 			*/
 #include <linux/init.h>		/* Initdata			*/
 #include <linux/ioport.h>	/* request_region		*/
-#include <linux/delay.h>	/* udelay			*/
 #include <asm/io.h>		/* outb, outb_p			*/
 #include <asm/uaccess.h>	/* copy to/from user		*/
 #include <linux/videodev2.h>	/* kernel radio structs		*/
@@ -60,27 +59,17 @@
 
 /* local things */
 
-static void sleep_delay(long n)
-{
-	/* Sleep nicely for 'n' uS */
-	int d=n/msecs_to_jiffies(1000);
-	if(!d)
-		udelay(n);
-	else
-		msleep(jiffies_to_msecs(d));
-}
-
 static void rt_decvol(void)
 {
 	outb(0x58, io);		/* volume down + sigstr + on	*/
-	sleep_delay(100000);
+	msleep(100);
 	outb(0xd8, io);		/* volume steady + sigstr + on	*/
 }
 
 static void rt_incvol(void)
 {
 	outb(0x98, io);		/* volume up + sigstr + on	*/
-	sleep_delay(100000);
+	msleep(100);
 	outb(0xd8, io);		/* volume steady + sigstr + on	*/
 }
 
@@ -109,7 +98,7 @@
 
 	if(vol == 0) {			/* volume = 0 means mute the card */
 		outb(0x48, io);		/* volume down but still "on"	*/
-		sleep_delay(2000000);	/* make sure it's totally down	*/
+		msleep(2000);		/* make sure it's totally down	*/
 		outb(0xd0, io);		/* volume steady, off		*/
 		dev->curvol = 0;	/* track the volume state!	*/
 		mutex_unlock(&lock);
@@ -144,7 +133,7 @@
 		outb_p(128+64+16+8+  1, port);  /* on + wr-enable + data low */
 		outb_p(128+64+16+8+2+1, port);  /* clock */
 	}
-	sleep_delay(1000);
+	msleep(1);
 }
 
 static void send_1_byte(int port, struct rt_device *dev)
@@ -158,7 +147,7 @@
 		outb_p(128+64+16+8+4+2+1, port); /* clock */
 	}
 
-	sleep_delay(1000);
+	msleep(1);
 }
 
 static int rt_setfreq(struct rt_device *dev, unsigned long freq)
@@ -440,7 +429,7 @@
 
 	/* this ensures that the volume is all the way down  */
 	outb(0x48, io);		/* volume down but still "on"	*/
-	sleep_delay(2000000);	/* make sure it's totally down	*/
+	msleep(2000);		/* make sure it's totally down	*/
 	outb(0xc0, io);		/* steady volume, mute card	*/
 	rtrack_unit.curvol = 0;
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 015/173] ALSA : au88x0 - Limit number of channels to fix Oops via OSS emu
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (14 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 014/173] [media] radio-aimslab.c: Fix gcc 4.5+ bug Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 016/173] Input: i8042 - introduce notimeout blacklist for Dell Vostro V13 Willy Tarreau
                   ` (157 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Raymond Yau, Takashi Iwai, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Raymond Yau <superquad.vortex2@gmail.com>

commit d9ab344336f74c012f6643ed3d1ad8ca0136de3b upstream.

Fix playback/capture channels patch to change supported playback
channels of au8830 to 1,2,4 and capture channels to 1,2.
This prevent oops when oss emulation use SNDCTL_DSP_CHANNELS to
set 3 Channels

Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/au88x0/au88x0_pcm.c |   24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -42,11 +42,7 @@ static struct snd_pcm_hardware snd_vorte
 	.rate_min = 5000,
 	.rate_max = 48000,
 	.channels_min = 1,
-#ifdef CHIP_AU8830
-	.channels_max = 4,
-#else
 	.channels_max = 2,
-#endif
 	.buffer_bytes_max = 0x10000,
 	.period_bytes_min = 0x1,
 	.period_bytes_max = 0x1000,
@@ -115,6 +111,17 @@ static struct snd_pcm_hardware snd_vorte
 	.periods_max = 64,
 };
 #endif
+#ifdef CHIP_AU8830
+static unsigned int au8830_channels[3] = {
+	1, 2, 4,
+};
+
+static struct snd_pcm_hw_constraint_list hw_constraints_au8830_channels = {
+	.count = ARRAY_SIZE(au8830_channels),
+	.list = au8830_channels,
+	.mask = 0,
+};
+#endif
 /* open callback */
 static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
 {
@@ -156,6 +163,15 @@ static int snd_vortex_pcm_open(struct sn
 		if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB
 		    || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S)
 			runtime->hw = snd_vortex_playback_hw_adb;
+#ifdef CHIP_AU8830
+		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+			VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) {
+			runtime->hw.channels_max = 4;
+			snd_pcm_hw_constraint_list(runtime, 0,
+				SNDRV_PCM_HW_PARAM_CHANNELS,
+				&hw_constraints_au8830_channels);
+		}
+#endif
 		substream->runtime->private_data = NULL;
 	}
 #ifndef CHIP_AU8810



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 016/173] Input: i8042 - introduce notimeout blacklist for Dell Vostro V13
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (15 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 015/173] ALSA : au88x0 - Limit number of channels to fix Oops via OSS emu Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 017/173] NFS: Fix "kernel BUG at fs/aio.c:554!" Willy Tarreau
                   ` (156 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jiri Kosina, Dmitry Torokhov, Tim Gardner, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jiri Kosina <jkosina@suse.cz>

commit f8313ef1f448006207f12c107123522c8bc00f15 upstream.

i8042 controller present in Dell Vostro V13 errorneously signals spurious
timeouts.

Introduce i8042.notimeout parameter for ignoring i8042-signalled timeouts
and apply this quirk automatically for Dell Vostro V13, based on DMI match.

In addition to that, this machine also needs to be added to nomux blacklist.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Cc: Tim Gardner <tcanonical@tpi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 Documentation/kernel-parameters.txt   |    1 +
 drivers/input/serio/i8042-x86ia64io.h |   21 +++++++++++++++++++++
 drivers/input/serio/i8042.c           |    6 +++++-
 3 files changed, 27 insertions(+), 1 deletion(-)

Index: longterm-2.6.27/Documentation/kernel-parameters.txt
===================================================================
--- longterm-2.6.27.orig/Documentation/kernel-parameters.txt	2011-04-25 18:15:55.582278324 +0200
+++ longterm-2.6.27/Documentation/kernel-parameters.txt	2011-04-25 18:17:23.642279890 +0200
@@ -811,6 +811,7 @@
 	i8042.panicblink=
 			[HW] Frequency with which keyboard LEDs should blink
 			     when kernel panics (default is 0.5 sec)
+	i8042.notimeout	[HW] Ignore timeout condition signalled by conroller
 	i8042.reset	[HW] Reset the controller during init and cleanup
 	i8042.unlock	[HW] Unlock (ignore) the keylock
 
Index: longterm-2.6.27/drivers/input/serio/i8042-x86ia64io.h
===================================================================
--- longterm-2.6.27.orig/drivers/input/serio/i8042-x86ia64io.h	2011-04-25 18:15:55.587278158 +0200
+++ longterm-2.6.27/drivers/input/serio/i8042-x86ia64io.h	2011-04-25 18:17:23.650279028 +0200
@@ -430,6 +430,13 @@
 			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
 		},
 	},
+	{
+		/* Dell Vostro V13 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
+		},
+	},
 	{ }
 };
 
@@ -655,6 +662,17 @@
 {
 	int retval;
 
+static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
+	{
+		/* Dell Vostro V13 */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
+		},
+	},
+	{ }
+};
+
 /*
  * On ix86 platforms touching the i8042 data register region can do really
  * bad things. Because of this the region is always reserved on ix86 boxes.
@@ -681,6 +699,9 @@
 	if (dmi_check_system(i8042_dmi_nomux_table))
 		i8042_nomux = 1;
 
+	if (dmi_check_system(i8042_dmi_notimeout_table))
+		i8042_notimeout = true;
+
 	if (dmi_check_system(i8042_dmi_dritek_table))
 		i8042_dritek = 1;
 #endif /* CONFIG_X86 */
Index: longterm-2.6.27/drivers/input/serio/i8042.c
===================================================================
--- longterm-2.6.27.orig/drivers/input/serio/i8042.c	2011-04-25 18:15:55.591278225 +0200
+++ longterm-2.6.27/drivers/input/serio/i8042.c	2011-04-25 18:17:56.769279088 +0200
@@ -63,6 +63,10 @@
 module_param_named(panicblink, i8042_blink_frequency, uint, 0600);
 MODULE_PARM_DESC(panicblink, "Frequency with which keyboard LEDs should blink when kernel panics");
 
+static unsigned int i8042_notimeout;
+module_param_named(notimeout, i8042_notimeout, bool, 0);
+MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042");
+
 #ifdef CONFIG_X86
 static unsigned int i8042_dritek;
 module_param_named(dritek, i8042_dritek, bool, 0);
@@ -362,7 +366,7 @@
 	} else {
 
 		dfl = ((str & I8042_STR_PARITY) ? SERIO_PARITY : 0) |
-		      ((str & I8042_STR_TIMEOUT) ? SERIO_TIMEOUT : 0);
+		      ((str & I8042_STR_TIMEOUT && !i8042_notimeout) ? SERIO_TIMEOUT : 0);
 
 		port_no = (str & I8042_STR_AUXDATA) ?
 				I8042_AUX_PORT_NO : I8042_KBD_PORT_NO;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 017/173] NFS: Fix "kernel BUG at fs/aio.c:554!"
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (16 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 016/173] Input: i8042 - introduce notimeout blacklist for Dell Vostro V13 Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 018/173] rapidio: fix hang on RapidIO doorbell queue full condition Willy Tarreau
                   ` (155 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Chuck Lever, Trond Myklebust, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Chuck Lever <chuck.lever@oracle.com>

commit 839f7ad6932d95f4d5ae7267b95c574714ff3d5b upstream.

Nick Piggin reports:

> I'm getting use after frees in aio code in NFS
>
> [ 2703.396766] Call Trace:
> [ 2703.396858]  [<ffffffff8100b057>] ? native_sched_clock+0x27/0x80
> [ 2703.396959]  [<ffffffff8108509e>] ? put_lock_stats+0xe/0x40
> [ 2703.397058]  [<ffffffff81088348>] ? lock_release_holdtime+0xa8/0x140
> [ 2703.397159]  [<ffffffff8108a2a5>] lock_acquire+0x95/0x1b0
> [ 2703.397260]  [<ffffffff811627db>] ? aio_put_req+0x2b/0x60
> [ 2703.397361]  [<ffffffff81039701>] ? get_parent_ip+0x11/0x50
> [ 2703.397464]  [<ffffffff81612a31>] _raw_spin_lock_irq+0x41/0x80
> [ 2703.397564]  [<ffffffff811627db>] ? aio_put_req+0x2b/0x60
> [ 2703.397662]  [<ffffffff811627db>] aio_put_req+0x2b/0x60
> [ 2703.397761]  [<ffffffff811647fe>] do_io_submit+0x2be/0x7c0
> [ 2703.397895]  [<ffffffff81164d0b>] sys_io_submit+0xb/0x10
> [ 2703.397995]  [<ffffffff8100307b>] system_call_fastpath+0x16/0x1b
>
> Adding some tracing, it is due to nfs completing the request then
> returning something other than -EIOCBQUEUED, so aio.c
> also completes the request.

To address this, prevent the NFS direct I/O engine from completing
async iocbs when the forward path returns an error without starting
any I/O.

This fix appears to survive ^C during both "xfstest no. 208" and "fsx
-Z."

It's likely this bug has existed for a very long while, as we are seeing
very similar symptoms in OEL 5.  Copying stable.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/nfs/direct.c |   34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -401,15 +401,18 @@ static ssize_t nfs_direct_read_schedule_
 		pos += vec->iov_len;
 	}
 
+	/*
+	 * If no bytes were started, return the error, and let the
+	 * generic layer handle the completion.
+	 */
+	if (requested_bytes == 0) {
+		nfs_direct_req_release(dreq);
+		return result < 0 ? result : -EIO;
+	}
+
 	if (put_dreq(dreq))
 		nfs_direct_complete(dreq);
-
-	if (requested_bytes != 0)
-		return 0;
-
-	if (result < 0)
-		return result;
-	return -EIO;
+	return 0;
 }
 
 static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,
@@ -829,15 +832,18 @@ static ssize_t nfs_direct_write_schedule
 		pos += vec->iov_len;
 	}
 
+	/*
+	 * If no bytes were started, return the error, and let the
+	 * generic layer handle the completion.
+	 */
+	if (requested_bytes == 0) {
+		nfs_direct_req_release(dreq);
+		return result < 0 ? result : -EIO;
+	}
+
 	if (put_dreq(dreq))
 		nfs_direct_write_complete(dreq, dreq->inode);
-
-	if (requested_bytes != 0)
-		return 0;
-
-	if (result < 0)
-		return result;
-	return -EIO;
+	return 0;
 }
 
 static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 018/173] rapidio: fix hang on RapidIO doorbell queue full condition
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (17 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 017/173] NFS: Fix "kernel BUG at fs/aio.c:554!" Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 019/173] serial: unbreak billionton CF card Willy Tarreau
                   ` (154 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Thomas Taranowski, Alexandre Bounine, Kumar Gala, Matt Porter,
	Li Yang, Thomas Moll, Micha Nelissen, Benjamin Herrenschmidt,
	Grant Likely, Andrew Morton, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Thomas Taranowski <tom@baringforge.com>

commit 12a4dc43911785f51a596f771ae0701b18d436f1 upstream.

In fsl_rio_dbell_handler() the code currently simply acknowledges the QFI
queue full interrupt, but does nothing to resolve the queue full
condition.  Instead, it jumps to the end of the isr.  When a queue full
condition occurs, the isr is then re-entered immediately and continually,
forever.

The fix is to just fall through and read out current doorbell entries.

Signed-off-by: Thomas Taranowski <tom@baringforge.com>
Cc: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Thomas Moll <thomas.moll@sysgo.com>
Cc: Micha Nelissen <micha@neli.hopto.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/sysdev/fsl_rio.c |    1 -
 1 file changed, 1 deletion(-)

--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -832,7 +832,6 @@ fsl_rio_dbell_handler(int irq, void *dev
 	if (dsr & DOORBELL_DSR_QFI) {
 		pr_info("RIO: doorbell queue full\n");
 		out_be32(&priv->msg_regs->dsr, DOORBELL_DSR_QFI);
-		goto out;
 	}
 
 	/* XXX Need to check/dispatch until queue empty */



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 019/173] serial: unbreak billionton CF card
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (18 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 018/173] rapidio: fix hang on RapidIO doorbell queue full condition Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 020/173] ptrace: use safer wake up on ptrace_detach() Willy Tarreau
                   ` (153 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Pavel Machek, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Pavel Machek <pavel@ucw.cz>

commit d0694e2aeb815042aa0f3e5036728b3db4446f1d upstream.

Unbreak Billionton CF bluetooth card. This actually fixes a regression
on zaurus.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/serial/8250.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -255,7 +255,8 @@ static const struct serial8250_config ua
 		.fifo_size	= 128,
 		.tx_loadsz	= 128,
 		.fcr		= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
-		.flags		= UART_CAP_FIFO | UART_CAP_EFR | UART_CAP_SLEEP,
+		/* UART_CAP_EFR breaks billionon CF bluetooth card. */
+		.flags		= UART_CAP_FIFO | UART_CAP_SLEEP,
 	},
 	[PORT_RSA] = {
 		.name		= "RSA",



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 020/173] ptrace: use safer wake up on ptrace_detach()
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (19 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 019/173] serial: unbreak billionton CF card Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 021/173] fix jiffy calculations in calibrate_delay_direct to handle overflow Willy Tarreau
                   ` (152 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Tejun Heo, Roland McGrath, Oleg Nesterov, Andrew Morton,
	Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Tejun Heo <tj@kernel.org>

commit 01e05e9a90b8f4c3997ae0537e87720eb475e532 upstream.

The wake_up_process() call in ptrace_detach() is spurious and not
interlocked with the tracee state.  IOW, the tracee could be running or
sleeping in any place in the kernel by the time wake_up_process() is
called.  This can lead to the tracee waking up unexpectedly which can be
dangerous.

The wake_up is spurious and should be removed but for now reduce its
toxicity by only waking up if the tracee is in TRACED or STOPPED state.

This bug can possibly be used as an attack vector.  I don't think it
will take too much effort to come up with an attack which triggers oops
somewhere.  Most sleeps are wrapped in condition test loops and should
be safe but we have quite a number of places where sleep and wakeup
conditions are expected to be interlocked.  Although the window of
opportunity is tiny, ptrace can be used by non-privileged users and with
some loading the window can definitely be extended and exploited.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/ptrace.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: longterm-2.6.27/kernel/ptrace.c
===================================================================
--- longterm-2.6.27.orig/kernel/ptrace.c	2011-01-23 10:52:37.000000000 +0100
+++ longterm-2.6.27/kernel/ptrace.c	2011-04-25 12:29:36.100278176 +0200
@@ -213,7 +213,7 @@
 	__ptrace_unlink(child);
 	/* .. and wake it up. */
 	if (child->exit_state != EXIT_ZOMBIE)
-		wake_up_process(child);
+		wake_up_state(child, TASK_TRACED | TASK_STOPPED);
 }
 
 int ptrace_detach(struct task_struct *child, unsigned int data)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 021/173] fix jiffy calculations in calibrate_delay_direct to handle overflow
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (20 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 020/173] ptrace: use safer wake up on ptrace_detach() Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 022/173] USB: serial: pl2303: Hybrid reader Uniform HCR331 Willy Tarreau
                   ` (151 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Tim Deegan, Jan Beulich, Jiri Slaby, Jeremy Fitzhardinge,
	Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Tim Deegan <Tim.Deegan@citrix.com>

commit 70a062286b9dfcbd24d2e11601aecfead5cf709a upstream.

Fixes a hang when booting as dom0 under Xen, when jiffies can be
quite large by the time the kernel init gets this far.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
[jbeulich@novell.com: !time_after() -> time_before_eq() as suggested by Jiri Slaby]
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 init/calibrate.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -66,7 +66,7 @@ static unsigned long __cpuinit calibrate
 		pre_start = 0;
 		read_current_timer(&start);
 		start_jiffies = jiffies;
-		while (jiffies <= (start_jiffies + 1)) {
+		while (time_before_eq(jiffies, start_jiffies + 1)) {
 			pre_start = start;
 			read_current_timer(&start);
 		}
@@ -74,8 +74,8 @@ static unsigned long __cpuinit calibrate
 
 		pre_end = 0;
 		end = post_start;
-		while (jiffies <=
-		       (start_jiffies + 1 + DELAY_CALIBRATION_TICKS)) {
+		while (time_before_eq(jiffies, start_jiffies + 1 +
+					       DELAY_CALIBRATION_TICKS)) {
 			pre_end = end;
 			read_current_timer(&end);
 		}



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 022/173] USB: serial: pl2303: Hybrid reader Uniform HCR331
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (21 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 021/173] fix jiffy calculations in calibrate_delay_direct to handle overflow Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 023/173] drivers: update to pl2303 usb-serial to support Motorola cables Willy Tarreau
                   ` (150 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Simone Contini <s.contini@oltrelinux.com>

commit 18344a1cd5889d48dac67229fcf024ed300030d5 upstream.

I tried a magnetic stripe reader
(http://www.kimaldi.com/kimaldi_eng/productos/lectores_de_tarjetas/lectores_tarjeta_chip_y_dni/lector_hibrido_uniform_hcr_331)
and I see that it is interfaced with a PL2303. I wrote a patch to use
your driver which simply adds the product ID for the device and it
seems working fine.


From: Simone Contini <s.contini@oltrelinux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/pl2303.c |    1 +
 drivers/usb/serial/pl2303.h |    1 +
 2 files changed, 2 insertions(+)

--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -59,6 +59,7 @@ static struct usb_device_id id_table []
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ALDIGA) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) },
+	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) },
 	{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
 	{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) },
 	{ USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -20,6 +20,7 @@
 #define PL2303_PRODUCT_ID_ALDIGA	0x0611
 #define PL2303_PRODUCT_ID_MMX		0x0612
 #define PL2303_PRODUCT_ID_GPRS		0x0609
+#define PL2303_PRODUCT_ID_HCR331	0x331a
 
 #define ATEN_VENDOR_ID		0x0557
 #define ATEN_VENDOR_ID2		0x0547



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 023/173] drivers: update to pl2303 usb-serial to support Motorola cables
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (22 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 022/173] USB: serial: pl2303: Hybrid reader Uniform HCR331 Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 024/173] powerpc: Fix some 6xx/7xxx CPU setup functions Willy Tarreau
                   ` (149 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Dario Lombardo, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dario Lombardo <dario.lombardo@libero.it>

commit 96a3e79edff6f41b0f115a82f1a39d66218077a7 upstream.

Added 0x0307 device id to support Motorola cables to the pl2303 usb
serial driver. This cable has a modified chip that is a pl2303, but
declares itself as 0307. Fixed by adding the right device id to the
supported devices list, assigning it the code labeled
PL2303_PRODUCT_ID_MOTOROLA.

Signed-off-by: Dario Lombardo <dario.lombardo@libero.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/pl2303.c |    1 +
 drivers/usb/serial/pl2303.h |    1 +
 2 files changed, 2 insertions(+)

--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -60,6 +60,7 @@ static struct usb_device_id id_table []
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MMX) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_GPRS) },
 	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) },
+	{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MOTOROLA) },
 	{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
 	{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) },
 	{ USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -21,6 +21,7 @@
 #define PL2303_PRODUCT_ID_MMX		0x0612
 #define PL2303_PRODUCT_ID_GPRS		0x0609
 #define PL2303_PRODUCT_ID_HCR331	0x331a
+#define PL2303_PRODUCT_ID_MOTOROLA	0x0307
 
 #define ATEN_VENDOR_ID		0x0557
 #define ATEN_VENDOR_ID2		0x0547



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 024/173] powerpc: Fix some 6xx/7xxx CPU setup functions
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (23 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 023/173] drivers: update to pl2303 usb-serial to support Motorola cables Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 025/173] parisc: pass through \t to early (iodc) console Willy Tarreau
                   ` (148 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Benjamin Herrenschmidt, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

commit 1f1936ff3febf38d582177ea319eaa278f32c91f upstream.

Some of those functions try to adjust the CPU features, for example
to remove NAP support on some revisions. However, they seem to use
r5 as an index into the CPU table entry, which might have been right
a long time ago but no longer is. r4 is the right register to use.

This probably caused some off behaviours on some PowerMac variants
using 750cx or 7455 processor revisions.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/cpu_setup_6xx.S |   40 ++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 20 deletions(-)

Index: longterm-2.6.27/arch/powerpc/kernel/cpu_setup_6xx.S
===================================================================
--- longterm-2.6.27.orig/arch/powerpc/kernel/cpu_setup_6xx.S	2011-01-23 10:52:08.000000000 +0100
+++ longterm-2.6.27/arch/powerpc/kernel/cpu_setup_6xx.S	2011-04-25 12:34:56.741279086 +0200
@@ -17,65 +17,65 @@
 #include <asm/cache.h>
 
 _GLOBAL(__setup_cpu_603)
-	mflr	r4
+	mflr	r5
 BEGIN_FTR_SECTION
 	bl	__init_fpu_registers
 END_FTR_SECTION_IFCLR(CPU_FTR_FPU_UNAVAILABLE)
 	bl	setup_common_caches
-	mtlr	r4
+	mtlr	r5
 	blr
 _GLOBAL(__setup_cpu_604)
-	mflr	r4
+	mflr	r5
 	bl	setup_common_caches
 	bl	setup_604_hid0
-	mtlr	r4
+	mtlr	r5
 	blr
 _GLOBAL(__setup_cpu_750)
-	mflr	r4
+	mflr	r5
 	bl	__init_fpu_registers
 	bl	setup_common_caches
 	bl	setup_750_7400_hid0
-	mtlr	r4
+	mtlr	r5
 	blr
 _GLOBAL(__setup_cpu_750cx)
-	mflr	r4
+	mflr	r5
 	bl	__init_fpu_registers
 	bl	setup_common_caches
 	bl	setup_750_7400_hid0
 	bl	setup_750cx
-	mtlr	r4
+	mtlr	r5
 	blr
 _GLOBAL(__setup_cpu_750fx)
-	mflr	r4
+	mflr	r5
 	bl	__init_fpu_registers
 	bl	setup_common_caches
 	bl	setup_750_7400_hid0
 	bl	setup_750fx
-	mtlr	r4
+	mtlr	r5
 	blr
 _GLOBAL(__setup_cpu_7400)
-	mflr	r4
+	mflr	r5
 	bl	__init_fpu_registers
 	bl	setup_7400_workarounds
 	bl	setup_common_caches
 	bl	setup_750_7400_hid0
-	mtlr	r4
+	mtlr	r5
 	blr
 _GLOBAL(__setup_cpu_7410)
-	mflr	r4
+	mflr	r5
 	bl	__init_fpu_registers
 	bl	setup_7410_workarounds
 	bl	setup_common_caches
 	bl	setup_750_7400_hid0
 	li	r3,0
 	mtspr	SPRN_L2CR2,r3
-	mtlr	r4
+	mtlr	r5
 	blr
 _GLOBAL(__setup_cpu_745x)
-	mflr	r4
+	mflr	r5
 	bl	setup_common_caches
 	bl	setup_745x_specifics
-	mtlr	r4
+	mtlr	r5
 	blr
 
 /* Enable caches for 603's, 604, 750 & 7400 */
@@ -189,10 +189,10 @@
 	cror	4*cr0+eq,4*cr0+eq,4*cr1+eq
 	cror	4*cr0+eq,4*cr0+eq,4*cr2+eq
 	bnelr
-	lwz	r6,CPU_SPEC_FEATURES(r5)
+	lwz	r6,CPU_SPEC_FEATURES(r4)
 	li	r7,CPU_FTR_CAN_NAP
 	andc	r6,r6,r7
-	stw	r6,CPU_SPEC_FEATURES(r5)
+	stw	r6,CPU_SPEC_FEATURES(r4)
 	blr
 
 /* 750fx specific
@@ -220,12 +220,12 @@
 	andis.	r11,r11,L3CR_L3E@h
 	beq	1f
 END_FTR_SECTION_IFSET(CPU_FTR_L3CR)
-	lwz	r6,CPU_SPEC_FEATURES(r5)
+	lwz	r6,CPU_SPEC_FEATURES(r4)
 	andi.	r0,r6,CPU_FTR_L3_DISABLE_NAP
 	beq	1f
 	li	r7,CPU_FTR_CAN_NAP
 	andc	r6,r6,r7
-	stw	r6,CPU_SPEC_FEATURES(r5)
+	stw	r6,CPU_SPEC_FEATURES(r4)
 1:
 	mfspr	r11,SPRN_HID0
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 025/173] parisc: pass through \t to early (iodc) console
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (24 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 024/173] powerpc: Fix some 6xx/7xxx CPU setup functions Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 026/173] parisc : Remove broken line wrapping handling pdc_iodc_print() Willy Tarreau
                   ` (147 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Kyle McMartin, Linus Torvalds

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kyle McMartin <kyle@mcmartin.ca>

commit d9b68e5e88248bb24fd4e455588bea1d56108fd6 upstream.

The firmware handles '\t' internally, so stop trying to emulate it
(which, incidentally, had a bug in it.)

Fixes a really weird hang at bootup in rcu_bootup_announce, which,
as far as I can tell, is the first printk in the core kernel to use
a tab as the first character.

Cc: stable@kernel.org
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index 4c247e0..df971fa 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -1123,7 +1123,6 @@ static char __attribute__((aligned(64))) iodc_dbuf[4096];
  */
 int pdc_iodc_print(const unsigned char *str, unsigned count)
 {
-	static int posx;        /* for simple TAB-Simulation... */
 	unsigned int i;
 	unsigned long flags;
 
@@ -1133,19 +1132,12 @@ int pdc_iodc_print(const unsigned char *str, unsigned count)
 			iodc_dbuf[i+0] = '\r';
 			iodc_dbuf[i+1] = '\n';
 			i += 2;
-			posx = 0;
 			goto print;
-		case '\t':
-			while (posx & 7) {
-				iodc_dbuf[i] = ' ';
-				i++, posx++;
-			}
-			break;
 		case '\b':	/* BS */
-			posx -= 2;
+			i--; /* overwrite last */
 		default:
 			iodc_dbuf[i] = str[i];
-			i++, posx++;
+			i++;
 			break;
 		}
 	}



^ permalink raw reply related	[flat|nested] 192+ messages in thread

* [PATCH 026/173] parisc : Remove broken line wrapping handling pdc_iodc_print()
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (25 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 025/173] parisc: pass through \t to early (iodc) console Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:02 ` [PATCH 027/173] hostap_cs: fix sleeping function called from invalid context Willy Tarreau
                   ` (146 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Guy Martin, James Bottomley, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Guy Martin <gmsoft@tuxicoman.be>

commit fbea668498e93bb38ac9226c7af9120a25957375 upstream.

Remove the broken line wrapping handling in pdc_iodc_print().
It is broken in 3 ways :
  - It doesn't keep track of the current screen position, it just
    assumes that the new buffer will be printed at the begining of the
    screen.
  - It doesn't take in account that non printable characters won't
    increase the current position on the screen.
  - And last but not least, it triggers a kernel panic if a backspace
    is the first char in the provided buffer :

 Backtrace:
  [<0000000040128ec4>] pdc_console_write+0x44/0x78
  [<0000000040128f18>] pdc_console_tty_write+0x20/0x38
  [<000000004032f1ac>] n_tty_write+0x2a4/0x550
  [<000000004032b158>] tty_write+0x1e0/0x2d8
  [<00000000401bb420>] vfs_write+0xb8/0x188
  [<00000000401bb630>] sys_write+0x68/0xb8
  [<0000000040104eb8>] syscall_exit+0x0/0x14

Most terminals handle the line wrapping just fine. I've confirmed that
it works correctly on a C8000 with both vga and serial output.

Signed-off-by: Guy Martin <gmsoft@tuxicoman.be>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/parisc/kernel/firmware.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -1126,15 +1126,13 @@ int pdc_iodc_print(const unsigned char *
 	unsigned int i;
 	unsigned long flags;
 
-	for (i = 0; i < count && i < 79;) {
+	for (i = 0; i < count;) {
 		switch(str[i]) {
 		case '\n':
 			iodc_dbuf[i+0] = '\r';
 			iodc_dbuf[i+1] = '\n';
 			i += 2;
 			goto print;
-		case '\b':	/* BS */
-			i--; /* overwrite last */
 		default:
 			iodc_dbuf[i] = str[i];
 			i++;
@@ -1142,15 +1140,6 @@ int pdc_iodc_print(const unsigned char *
 		}
 	}
 
-	/* if we're at the end of line, and not already inserting a newline,
-	 * insert one anyway. iodc console doesn't claim to support >79 char
-	 * lines. don't account for this in the return value.
-	 */
-	if (i == 79 && iodc_dbuf[i-1] != '\n') {
-		iodc_dbuf[i+0] = '\r';
-		iodc_dbuf[i+1] = '\n';
-	}
-
 print:
         spin_lock_irqsave(&pdc_lock, flags);
         real32_call(PAGE0->mem_cons.iodc_io,



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 027/173] hostap_cs: fix sleeping function called from invalid context
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (26 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 026/173] parisc : Remove broken line wrapping handling pdc_iodc_print() Willy Tarreau
@ 2011-04-25 20:02 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 028/173] md: fix regression with re-adding devices to arrays with no metadata Willy Tarreau
                   ` (145 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:02 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Stanislaw Gruszka, John W. Linville, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit 4e5518ca53be29c1ec3c00089c97bef36bfed515 upstream.

pcmcia_request_irq() and pcmcia_enable_device() are intended
to be called from process context (first function allocate memory
with GFP_KERNEL, second take a mutex). We can not take spin lock
and call them.

It's safe to move spin lock after pcmcia_enable_device() as we
still hold off IRQ until dev->base_addr is 0 and driver will
not proceed with interrupts when is not ready.

Patch resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=643758

Reported-and-tested-by: rbugz@biobind.com
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 drivers/net/wireless/hostap/hostap_cs.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -662,12 +662,6 @@ static int prism2_config(struct pcmcia_d
 	link->dev_node = &hw_priv->node;
 
 	/*
-	 * Make sure the IRQ handler cannot proceed until at least
-	 * dev->base_addr is initialized.
-	 */
-	spin_lock_irqsave(&local->irq_init_lock, flags);
-
-	/*
 	 * Allocate an interrupt line.  Note that this does not assign a
 	 * handler to the interrupt, unless the 'Handler' member of the
 	 * irq structure is initialized.
@@ -690,9 +684,10 @@ static int prism2_config(struct pcmcia_d
 	CS_CHECK(RequestConfiguration,
 		 pcmcia_request_configuration(link, &link->conf));
 
+	/* IRQ handler cannot proceed until at dev->base_addr is initialized */
+	spin_lock_irqsave(&local->irq_init_lock, flags);
 	dev->irq = link->irq.AssignedIRQ;
 	dev->base_addr = link->io.BasePort1;
-
 	spin_unlock_irqrestore(&local->irq_init_lock, flags);
 
 	/* Finally, report what we've done */
@@ -724,7 +719,6 @@ static int prism2_config(struct pcmcia_d
 	return ret;
 
  cs_failed:
-	spin_unlock_irqrestore(&local->irq_init_lock, flags);
 	cs_error(link, last_fn, last_ret);
 
  failed:



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 028/173] md: fix regression with re-adding devices to arrays with no metadata
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (27 preceding siblings ...)
  2011-04-25 20:02 ` [PATCH 027/173] hostap_cs: fix sleeping function called from invalid context Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 029/173] pata_mpc52xx: inherit from ata_bmdma_port_ops Willy Tarreau
                   ` (144 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: NeilBrown, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: NeilBrown <neilb@suse.de>

commit bf572541ab44240163eaa2d486b06f306a31d45a upstream.

Commit 1a855a0606 (2.6.37-rc4) fixed a problem where devices were
re-added when they shouldn't be but caused a regression in a less
common case that means sometimes devices cannot be re-added when they
should be.

In particular, when re-adding a device to an array without metadata
we should always access the device, but after the above commit we
didn't.

This patch sets the In_sync flag in that case so that the re-add
succeeds.

This patch is suitable for any -stable kernel to which 1a855a0606 was
applied.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/md/md.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4802,9 +4802,10 @@ static int add_new_disk(mddev_t * mddev,
 		/* set saved_raid_disk if appropriate */
 		if (!mddev->persistent) {
 			if (info->state & (1<<MD_DISK_SYNC)  &&
-			    info->raid_disk < mddev->raid_disks)
+			    info->raid_disk < mddev->raid_disks) {
 				rdev->raid_disk = info->raid_disk;
-			else
+				set_bit(In_sync, &rdev->flags);
+			} else
 				rdev->raid_disk = -1;
 		} else
 			super_types[mddev->major_version].



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 029/173] pata_mpc52xx: inherit from ata_bmdma_port_ops
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (28 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 028/173] md: fix regression with re-adding devices to arrays with no metadata Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-26 10:44   ` Sergei Shtylyov
  2011-04-25 20:03 ` [PATCH 030/173] TPM: Long default timeout fix Willy Tarreau
                   ` (143 subsequent siblings)
  173 siblings, 1 reply; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Tejun Heo, Sergei Shtylyov, Jeff Garzik, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Tejun Heo <tj@kernel.org>

commit 77c5fd19075d299fe820bb59bb21b0b113676e20 upstream.

pata_mpc52xx supports BMDMA but inherits ata_sff_port_ops which
triggers BUG_ON() when a DMA command is issued.  Fix it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Roman Fietze <roman.fietze@telemotive.de>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/ata/pata_mpc52xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -610,7 +610,7 @@ static struct scsi_host_template mpc52xx
 };
 
 static struct ata_port_operations mpc52xx_ata_port_ops = {
-	.inherits		= &ata_sff_port_ops,
+	.inherits		= &ata_bmdma_port_ops,
 	.sff_dev_select		= mpc52xx_ata_dev_select,
 	.set_piomode		= mpc52xx_ata_set_piomode,
 	.set_dmamode		= mpc52xx_ata_set_dmamode,



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 030/173] TPM: Long default timeout fix
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (29 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 029/173] pata_mpc52xx: inherit from ata_bmdma_port_ops Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 031/173] drm/radeon: remove 0x4243 pci id Willy Tarreau
                   ` (142 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Rajiv Andrade, James Morris, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Rajiv Andrade <srajiv@linux.vnet.ibm.com>

commit c4ff4b829ef9e6353c0b133b7adb564a68054979 upstream.

If duration variable value is 0 at this point, it's because
chip->vendor.duration wasn't filled by tpm_get_timeouts() yet.
This patch sets then the lowest timeout just to give enough
time for tpm_get_timeouts() to further succeed.

This fix avoids long boot times in case another entity attempts
to send commands to the TPM when the TPM isn't accessible.

Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/char/tpm/tpm.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -353,12 +353,14 @@ unsigned long tpm_calc_ordinal_duration(
 		    tpm_protected_ordinal_duration[ordinal &
 						   TPM_PROTECTED_ORDINAL_MASK];
 
-	if (duration_idx != TPM_UNDEFINED)
+	if (duration_idx != TPM_UNDEFINED) {
 		duration = chip->vendor.duration[duration_idx];
-	if (duration <= 0)
+		/* if duration is 0, it's because chip->vendor.duration wasn't */
+		/* filled yet, so we set the lowest timeout just to give enough */
+		/* time for tpm_get_timeouts() to succeed */
+		return (duration <= 0 ? HZ : duration);
+	} else
 		return 2 * 60 * HZ;
-	else
-		return duration;
 }
 EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 031/173] drm/radeon: remove 0x4243 pci id
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (30 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 030/173] TPM: Long default timeout fix Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 032/173] x86, mm: avoid possible bogus tlb entries by clearing prev mm_cpumask after switching mm Willy Tarreau
                   ` (141 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Alex Deucher, Dave Airlie, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alex Deucher <alexdeucher@gmail.com>

commit 63a507800c8aca5a1891d598ae13f829346e8e39 upstream.

0x4243 is a PCI bridge, not a GPU.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=33815

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/drm/drm_pciids.h |    1 -
 1 file changed, 1 deletion(-)

--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -28,7 +28,6 @@
 	{0x1002, 0x4156, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV350}, \
 	{0x1002, 0x4237, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP}, \
 	{0x1002, 0x4242, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \
-	{0x1002, 0x4243, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R200}, \
 	{0x1002, 0x4336, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \
 	{0x1002, 0x4337, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \
 	{0x1002, 0x4437, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS200|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 032/173] x86, mm: avoid possible bogus tlb entries by clearing prev mm_cpumask after switching mm
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (31 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 031/173] drm/radeon: remove 0x4243 pci id Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 033/173] NFSD: memory corruption due to writing beyond the stat array Willy Tarreau
                   ` (140 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Suresh Siddha, Ingo Molnar, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Suresh Siddha <suresh.b.siddha@intel.com>

commit 831d52bc153971b70e64eccfbed2b232394f22f8 upstream.

Clearing the cpu in prev's mm_cpumask early will avoid the flush tlb
IPI's while the cr3 is still pointing to the prev mm.  And this window
can lead to the possibility of bogus TLB fills resulting in strange
failures.  One such problematic scenario is mentioned below.

 T1. CPU-1 is context switching from mm1 to mm2 context and got a NMI
     etc between the point of clearing the cpu from the mm_cpumask(mm1)
     and before reloading the cr3 with the new mm2.

 T2. CPU-2 is tearing down a specific vma for mm1 and will proceed with
     flushing the TLB for mm1.  It doesn't send the flush TLB to CPU-1
     as it doesn't see that cpu listed in the mm_cpumask(mm1).

 T3. After the TLB flush is complete, CPU-2 goes ahead and frees the
     page-table pages associated with the removed vma mapping.

 T4. CPU-2 now allocates those freed page-table pages for something
     else.

 T5. As the CR3 and TLB caches for mm1 is still active on CPU-1, CPU-1
     can potentially speculate and walk through the page-table caches
     and can insert new TLB entries.  As the page-table pages are
     already freed and being used on CPU-2, this page walk can
     potentially insert a bogus global TLB entry depending on the
     (random) contents of the page that is being used on CPU-2.

 T6. This bogus TLB entry being global will be active across future CR3
     changes and can result in weird memory corruption etc.

To avoid this issue, for the prev mm that is handing over the cpu to
another mm, clear the cpu from the mm_cpumask(prev) after the cr3 is
changed.

Marking it for -stable, though we haven't seen any reported failure that
can be attributed to this.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/include/asm/mmu_context.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: longterm-2.6.27/include/asm-x86/mmu_context_32.h
===================================================================
--- longterm-2.6.27.orig/include/asm-x86/mmu_context_32.h	2011-01-23 10:52:33.000000000 +0100
+++ longterm-2.6.27/include/asm-x86/mmu_context_32.h	2011-04-25 13:24:51.827278137 +0200
@@ -17,8 +17,6 @@
 	int cpu = smp_processor_id();
 
 	if (likely(prev != next)) {
-		/* stop flush ipis for the previous mm */
-		cpu_clear(cpu, prev->cpu_vm_mask);
 #ifdef CONFIG_SMP
 		per_cpu(cpu_tlbstate, cpu).state = TLBSTATE_OK;
 		per_cpu(cpu_tlbstate, cpu).active_mm = next;
@@ -28,6 +26,9 @@
 		/* Re-load page tables */
 		load_cr3(next->pgd);
 
+		/* stop flush ipis for the previous mm */
+		cpu_clear(cpu, prev->cpu_vm_mask);
+
 		/*
 		 * load the LDT, if the LDT is different:
 		 */
Index: longterm-2.6.27/include/asm-x86/mmu_context_64.h
===================================================================
--- longterm-2.6.27.orig/include/asm-x86/mmu_context_64.h	2011-01-23 10:52:33.000000000 +0100
+++ longterm-2.6.27/include/asm-x86/mmu_context_64.h	2011-04-25 13:25:00.775278127 +0200
@@ -16,8 +16,6 @@
 {
 	unsigned cpu = smp_processor_id();
 	if (likely(prev != next)) {
-		/* stop flush ipis for the previous mm */
-		cpu_clear(cpu, prev->cpu_vm_mask);
 #ifdef CONFIG_SMP
 		write_pda(mmu_state, TLBSTATE_OK);
 		write_pda(active_mm, next);
@@ -25,6 +23,9 @@
 		cpu_set(cpu, next->cpu_vm_mask);
 		load_cr3(next->pgd);
 
+		/* stop flush ipis for the previous mm */
+		cpu_clear(cpu, prev->cpu_vm_mask);
+
 		if (unlikely(next->context.ldt != prev->context.ldt))
 			load_LDT_nolock(&next->context);
 	}



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 033/173] NFSD: memory corruption due to writing beyond the stat array
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (32 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 032/173] x86, mm: avoid possible bogus tlb entries by clearing prev mm_cpumask after switching mm Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 034/173] sctp: Fix out-of-bounds reading in sctp_asoc_get_hmac() Willy Tarreau
                   ` (139 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Konstantin Khorenko, J. Bruce Fields, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Konstantin Khorenko <khorenko@parallels.com>

commit 3aa6e0aa8ab3e64bbfba092c64d42fd1d006b124 upstream.

If nfsd fails to find an exported via NFS file in the readahead cache, it
should increment corresponding nfsdstats counter (ra_depth[10]), but due to a
bug it may instead write to ra_depth[11], corrupting the following field.

In a kernel with NFSDv4 compiled in the corruption takes the form of an
increment of a counter of the number of NFSv4 operation 0's received; since
there is no operation 0, this is harmless.

In a kernel with NFSDv4 disabled it corrupts whatever happens to be in the
memory beyond nfsdstats.

Signed-off-by: Konstantin Khorenko <khorenko@openvz.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/nfsd/vfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -823,7 +823,7 @@ nfsd_get_raparms(dev_t dev, ino_t ino)
 		if (ra->p_count == 0)
 			frap = rap;
 	}
-	depth = nfsdstats.ra_size*11/10;
+	depth = nfsdstats.ra_size;
 	if (!frap) {	
 		spin_unlock(&rab->pb_lock);
 		return NULL;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 034/173] sctp: Fix out-of-bounds reading in sctp_asoc_get_hmac()
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (33 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 033/173] NFSD: memory corruption due to writing beyond the stat array Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 035/173] ocfs2_connection_find() returns pointer to bad structure Willy Tarreau
                   ` (138 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, Vlad Yasevich, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit 51e97a12bef19b7e43199fc153cf9bd5f2140362 upstream.

The sctp_asoc_get_hmac() function iterates through a peer's hmac_ids
array and attempts to ensure that only a supported hmac entry is
returned.  The current code fails to do this properly - if the last id
in the array is out of range (greater than SCTP_AUTH_HMAC_ID_MAX), the
id integer remains set after exiting the loop, and the address of an
out-of-bounds entry will be returned and subsequently used in the parent
function, causing potentially ugly memory corruption.  This patch resets
the id integer to 0 on encountering an invalid id so that NULL will be
returned after finishing the loop if no valid ids are found.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/sctp/auth.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -542,16 +542,20 @@ struct sctp_hmac *sctp_auth_asoc_get_hma
 		id = ntohs(hmacs->hmac_ids[i]);
 
 		/* Check the id is in the supported range */
-		if (id > SCTP_AUTH_HMAC_ID_MAX)
+		if (id > SCTP_AUTH_HMAC_ID_MAX) {
+			id = 0;
 			continue;
+		}
 
 		/* See is we support the id.  Supported IDs have name and
 		 * length fields set, so that we can allocated and use
 		 * them.  We can safely just check for name, for without the
 		 * name, we can't allocate the TFM.
 		 */
-		if (!sctp_hmac_list[id].hmac_name)
+		if (!sctp_hmac_list[id].hmac_name) {
+			id = 0;
 			continue;
+		}
 
 		break;
 	}



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 035/173] ocfs2_connection_find() returns pointer to bad structure
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (34 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 034/173] sctp: Fix out-of-bounds reading in sctp_asoc_get_hmac() Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 036/173] Fix pktcdvd ioctl dev_minor range check Willy Tarreau
                   ` (137 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: dann frazier, Joel Becker, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: dann frazier <dann.frazier@canonical.com>

commit 226291aa4641fa13cb5dec3bcb3379faa83009e2 upstream.

If ocfs2_live_connection_list is empty, ocfs2_connection_find() will return
a pointer to the LIST_HEAD, cast as a ocfs2_live_connection. This can cause
an oops when ocfs2_control_send_down() dereferences c->oc_conn:

Call Trace:
  [<ffffffffa00c2a3c>] ocfs2_control_message+0x28c/0x2b0 [ocfs2_stack_user]
  [<ffffffffa00c2a95>] ocfs2_control_write+0x35/0xb0 [ocfs2_stack_user]
  [<ffffffff81143a88>] vfs_write+0xb8/0x1a0
  [<ffffffff8155cc13>] ? do_page_fault+0x153/0x3b0
  [<ffffffff811442f1>] sys_write+0x51/0x80
  [<ffffffff810121b2>] system_call_fastpath+0x16/0x1b

Fix by explicitly returning NULL if no match is found.

Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ocfs2/stack_user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -191,7 +191,7 @@ static struct ocfs2_live_connection *ocf
 			return c;
 	}
 
-	return c;
+	return NULL;
 }
 
 /*



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 036/173] Fix pktcdvd ioctl dev_minor range check
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (35 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 035/173] ocfs2_connection_find() returns pointer to bad structure Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 037/173] filter: make sure filters dont read uninitialized memory Willy Tarreau
                   ` (136 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit 252a52aa4fa22a668f019e55b3aac3ff71ec1c29 upstream.

The PKT_CTRL_CMD_STATUS device ioctl retrieves a pointer to a
pktcdvd_device from the global pkt_devs array.  The index into this
array is provided directly by the user and is a signed integer, so the
comparison to ensure that it falls within the bounds of this array will
fail when provided with a negative index.

This can be used to read arbitrary kernel memory or cause a crash due to
an invalid pointer dereference.  This can be exploited by users with
permission to open /dev/pktcdvd/control (on many distributions, this is
readable by group "cdrom").

Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
[ Rather than add a cast, just make the function take the right type -Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/block/pktcdvd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2408,7 +2408,7 @@ static void pkt_release_dev(struct pktcd
 	pkt_shrink_pktlist(pd);
 }
 
-static struct pktcdvd_device *pkt_find_dev_from_minor(int dev_minor)
+static struct pktcdvd_device *pkt_find_dev_from_minor(unsigned int dev_minor)
 {
 	if (dev_minor >= MAX_WRITERS)
 		return NULL;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 037/173] filter: make sure filters dont read uninitialized memory
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (36 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 036/173] Fix pktcdvd ioctl dev_minor range check Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 038/173] x25: decrement netdev reference counts on unload Willy Tarreau
                   ` (135 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Eric Dumazet, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: David S. Miller <davem@davemloft.net>

commit 57fe93b374a6b8711995c2d466c502af9f3a08bb upstream.

There is a possibility malicious users can get limited information about
uninitialized stack mem array. Even if sk_run_filter() result is bound
to packet length (0 .. 65535), we could imagine this can be used by
hostile user.

Initializing mem[] array, like Dan Rosenberg suggested in his patch is
expensive since most filters dont even use this array.

Its hard to make the filter validation in sk_chk_filter(), because of
the jumps. This might be done later.

In this patch, I use a bitmap (a single long var) so that only filters
using mem[] loads/stores pay the price of added security checks.

For other filters, additional cost is a single instruction.

[ Since we access fentry->k a lot now, cache it in a local variable
  and mark filter entry pointer as const. -DaveM ]

Reported-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[Backported by dann frazier <dannf@debian.org>]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/core/filter.c |   64 +++++++++++++++++++++++++++++-------------------------
 1 file changed, 35 insertions(+), 29 deletions(-)

--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -111,39 +111,41 @@ EXPORT_SYMBOL(sk_filter);
  */
 unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen)
 {
-	struct sock_filter *fentry;	/* We walk down these */
 	void *ptr;
 	u32 A = 0;			/* Accumulator */
 	u32 X = 0;			/* Index Register */
 	u32 mem[BPF_MEMWORDS];		/* Scratch Memory Store */
+	unsigned long memvalid = 0;
 	u32 tmp;
 	int k;
 	int pc;
 
+	BUILD_BUG_ON(BPF_MEMWORDS > BITS_PER_LONG);
 	/*
 	 * Process array of filter instructions.
 	 */
 	for (pc = 0; pc < flen; pc++) {
-		fentry = &filter[pc];
+		const struct sock_filter *fentry = &filter[pc];
+		u32 f_k = fentry->k;
 
 		switch (fentry->code) {
 		case BPF_ALU|BPF_ADD|BPF_X:
 			A += X;
 			continue;
 		case BPF_ALU|BPF_ADD|BPF_K:
-			A += fentry->k;
+			A += f_k;
 			continue;
 		case BPF_ALU|BPF_SUB|BPF_X:
 			A -= X;
 			continue;
 		case BPF_ALU|BPF_SUB|BPF_K:
-			A -= fentry->k;
+			A -= f_k;
 			continue;
 		case BPF_ALU|BPF_MUL|BPF_X:
 			A *= X;
 			continue;
 		case BPF_ALU|BPF_MUL|BPF_K:
-			A *= fentry->k;
+			A *= f_k;
 			continue;
 		case BPF_ALU|BPF_DIV|BPF_X:
 			if (X == 0)
@@ -151,49 +153,49 @@ unsigned int sk_run_filter(struct sk_buf
 			A /= X;
 			continue;
 		case BPF_ALU|BPF_DIV|BPF_K:
-			A /= fentry->k;
+			A /= f_k;
 			continue;
 		case BPF_ALU|BPF_AND|BPF_X:
 			A &= X;
 			continue;
 		case BPF_ALU|BPF_AND|BPF_K:
-			A &= fentry->k;
+			A &= f_k;
 			continue;
 		case BPF_ALU|BPF_OR|BPF_X:
 			A |= X;
 			continue;
 		case BPF_ALU|BPF_OR|BPF_K:
-			A |= fentry->k;
+			A |= f_k;
 			continue;
 		case BPF_ALU|BPF_LSH|BPF_X:
 			A <<= X;
 			continue;
 		case BPF_ALU|BPF_LSH|BPF_K:
-			A <<= fentry->k;
+			A <<= f_k;
 			continue;
 		case BPF_ALU|BPF_RSH|BPF_X:
 			A >>= X;
 			continue;
 		case BPF_ALU|BPF_RSH|BPF_K:
-			A >>= fentry->k;
+			A >>= f_k;
 			continue;
 		case BPF_ALU|BPF_NEG:
 			A = -A;
 			continue;
 		case BPF_JMP|BPF_JA:
-			pc += fentry->k;
+			pc += f_k;
 			continue;
 		case BPF_JMP|BPF_JGT|BPF_K:
-			pc += (A > fentry->k) ? fentry->jt : fentry->jf;
+			pc += (A > f_k) ? fentry->jt : fentry->jf;
 			continue;
 		case BPF_JMP|BPF_JGE|BPF_K:
-			pc += (A >= fentry->k) ? fentry->jt : fentry->jf;
+			pc += (A >= f_k) ? fentry->jt : fentry->jf;
 			continue;
 		case BPF_JMP|BPF_JEQ|BPF_K:
-			pc += (A == fentry->k) ? fentry->jt : fentry->jf;
+			pc += (A == f_k) ? fentry->jt : fentry->jf;
 			continue;
 		case BPF_JMP|BPF_JSET|BPF_K:
-			pc += (A & fentry->k) ? fentry->jt : fentry->jf;
+			pc += (A & f_k) ? fentry->jt : fentry->jf;
 			continue;
 		case BPF_JMP|BPF_JGT|BPF_X:
 			pc += (A > X) ? fentry->jt : fentry->jf;
@@ -208,7 +210,7 @@ unsigned int sk_run_filter(struct sk_buf
 			pc += (A & X) ? fentry->jt : fentry->jf;
 			continue;
 		case BPF_LD|BPF_W|BPF_ABS:
-			k = fentry->k;
+			k = f_k;
 load_w:
 			ptr = load_pointer(skb, k, 4, &tmp);
 			if (ptr != NULL) {
@@ -217,7 +219,7 @@ load_w:
 			}
 			break;
 		case BPF_LD|BPF_H|BPF_ABS:
-			k = fentry->k;
+			k = f_k;
 load_h:
 			ptr = load_pointer(skb, k, 2, &tmp);
 			if (ptr != NULL) {
@@ -226,7 +228,7 @@ load_h:
 			}
 			break;
 		case BPF_LD|BPF_B|BPF_ABS:
-			k = fentry->k;
+			k = f_k;
 load_b:
 			ptr = load_pointer(skb, k, 1, &tmp);
 			if (ptr != NULL) {
@@ -241,32 +243,34 @@ load_b:
 			X = skb->len;
 			continue;
 		case BPF_LD|BPF_W|BPF_IND:
-			k = X + fentry->k;
+			k = X + f_k;
 			goto load_w;
 		case BPF_LD|BPF_H|BPF_IND:
-			k = X + fentry->k;
+			k = X + f_k;
 			goto load_h;
 		case BPF_LD|BPF_B|BPF_IND:
-			k = X + fentry->k;
+			k = X + f_k;
 			goto load_b;
 		case BPF_LDX|BPF_B|BPF_MSH:
-			ptr = load_pointer(skb, fentry->k, 1, &tmp);
+			ptr = load_pointer(skb, f_k, 1, &tmp);
 			if (ptr != NULL) {
 				X = (*(u8 *)ptr & 0xf) << 2;
 				continue;
 			}
 			return 0;
 		case BPF_LD|BPF_IMM:
-			A = fentry->k;
+			A = f_k;
 			continue;
 		case BPF_LDX|BPF_IMM:
-			X = fentry->k;
+			X = f_k;
 			continue;
 		case BPF_LD|BPF_MEM:
-			A = mem[fentry->k];
+			A = (memvalid & (1UL << f_k)) ?
+				mem[f_k] : 0;
 			continue;
 		case BPF_LDX|BPF_MEM:
-			X = mem[fentry->k];
+			X = (memvalid & (1UL << f_k)) ?
+				mem[f_k] : 0;
 			continue;
 		case BPF_MISC|BPF_TAX:
 			X = A;
@@ -275,14 +279,16 @@ load_b:
 			A = X;
 			continue;
 		case BPF_RET|BPF_K:
-			return fentry->k;
+			return f_k;
 		case BPF_RET|BPF_A:
 			return A;
 		case BPF_ST:
-			mem[fentry->k] = A;
+			memvalid |= 1UL << f_k;
+			mem[f_k] = A;
 			continue;
 		case BPF_STX:
-			mem[fentry->k] = X;
+			memvalid |= 1UL << f_k;
+			mem[f_k] = X;
 			continue;
 		default:
 			WARN_ON(1);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 038/173] x25: decrement netdev reference counts on unload
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (37 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 037/173] filter: make sure filters dont read uninitialized memory Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 039/173] OHCI: work around for nVidia shutdown problem Willy Tarreau
                   ` (134 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Apollon Oikonomopoulos, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Apollon Oikonomopoulos <apollon@noc.grnet.gr>

commit 171995e5d82dcc92bea37a7d2a2ecc21068a0f19 upstream.

x25 does not decrement the network device reference counts on module unload.
Thus unregistering any pre-existing interface after unloading the x25 module
hangs and results in

 unregister_netdevice: waiting for tap0 to become free. Usage count = 1

This patch decrements the reference counts of all interfaces in x25_link_free,
the way it is already done in x25_link_device_down for NETDEV_DOWN events.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/x25/x25_link.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/x25/x25_link.c
+++ b/net/x25/x25_link.c
@@ -393,6 +393,7 @@ void __exit x25_link_free(void)
 	list_for_each_safe(entry, tmp, &x25_neigh_list) {
 		nb = list_entry(entry, struct x25_neigh, node);
 		__x25_remove_neigh(nb);
+		dev_put(nb->dev);
 	}
 	write_unlock_bh(&x25_neigh_list_lock);
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 039/173] OHCI: work around for nVidia shutdown problem
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (38 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 038/173] x25: decrement netdev reference counts on unload Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 21:24   ` Alan Stern
  2011-04-25 20:03 ` [PATCH 040/173] [media] [v3,media] av7110: check for negative array offset Willy Tarreau
                   ` (133 subsequent siblings)
  173 siblings, 1 reply; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Alan Stern, David Brownell, Greg Kroah-Hartman

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5780 bytes --]

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit 3df7169e73fc1d71a39cffeacc969f6840cdf52b upstream.

This patch (as1417) fixes a problem affecting some (or all) nVidia
chipsets.  When the computer is shut down, the OHCI controllers
continue to power the USB buses and evidently they drive a Reset
signal out all their ports.  This prevents attached devices from going
to low power.  Mouse LEDs stay on, for example, which is disconcerting
for users and a drain on laptop batteries.

The fix involves leaving each OHCI controller in the OPERATIONAL state
during system shutdown rather than putting it in the RESET state.
Although this nominally means the controller is running, in fact it's
not doing very much since all the schedules are all disabled.  However
there is ongoing DMA to the Host Controller Communications Area, so
the patch also disables the bus-master capability of all PCI USB
controllers after the shutdown routine runs.

The fix is applied only to nVidia-based PCI OHCI controllers, so it
shouldn't cause problems on systems using other hardware.  As an added
safety measure, in case the kernel encounters one of these running
controllers during boot, the patch changes quirk_usb_handoff_ohci()
(which runs early on during PCI discovery) to reset the controller
before anything bad can happen.

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: David Brownell <david-b@pacbell.net>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/core/hcd-pci.c    |    4 +++-
 drivers/usb/host/ohci-hcd.c   |    9 ++++++++-
 drivers/usb/host/ohci-pci.c   |   18 ++++++++++++++++++
 drivers/usb/host/ohci.h       |    1 +
 drivers/usb/host/pci-quirks.c |   18 +++++++++++-------
 5 files changed, 41 insertions(+), 9 deletions(-)

--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -197,8 +197,10 @@ void usb_hcd_pci_shutdown(struct pci_dev
 	if (!hcd)
 		return;
 
-	if (hcd->driver->shutdown)
+	if (hcd->driver->shutdown) {
 		hcd->driver->shutdown(hcd);
+		pci_disable_device(dev);
+	}
 }
 EXPORT_SYMBOL_GPL(usb_hcd_pci_shutdown);
 
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -398,7 +398,14 @@ ohci_shutdown (struct usb_hcd *hcd)
 
 	ohci = hcd_to_ohci (hcd);
 	ohci_writel (ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable);
-	ohci_usb_reset (ohci);
+	ohci->hc_control = ohci_readl(ohci, &ohci->regs->control);
+
+	/* If the SHUTDOWN quirk is set, don't put the controller in RESET */
+	ohci->hc_control &= (ohci->flags & OHCI_QUIRK_SHUTDOWN ?
+			OHCI_CTRL_RWC | OHCI_CTRL_HCFS :
+			OHCI_CTRL_RWC);
+	ohci_writel(ohci, ohci->hc_control, &ohci->regs->control);
+
 	/* flush the writes */
 	(void) ohci_readl (ohci, &ohci->regs->control);
 }
--- a/drivers/usb/host/ohci-pci.c
+++ b/drivers/usb/host/ohci-pci.c
@@ -201,6 +201,20 @@ static int ohci_quirk_amd700(struct usb_
 	return 0;
 }
 
+/* nVidia controllers continue to drive Reset signalling on the bus
+ * even after system shutdown, wasting power.  This flag tells the
+ * shutdown routine to leave the controller OPERATIONAL instead of RESET.
+ */
+static int ohci_quirk_nvidia_shutdown(struct usb_hcd *hcd)
+{
+	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
+
+	ohci->flags |= OHCI_QUIRK_SHUTDOWN;
+	ohci_dbg(ohci, "enabled nVidia shutdown quirk\n");
+
+	return 0;
+}
+
 /*
  * The hardware normally enables the A-link power management feature, which
  * lets the system lower the power consumption in idle states.
@@ -332,6 +346,10 @@ static const struct pci_device_id ohci_p
 		PCI_DEVICE(PCI_VENDOR_ID_ATI, 0x4399),
 		.driver_data = (unsigned long)ohci_quirk_amd700,
 	},
+	{
+		PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID),
+		.driver_data = (unsigned long) ohci_quirk_nvidia_shutdown,
+	},
 
 	/* FIXME for some of the early AMD 760 southbridges, OHCI
 	 * won't work at all.  blacklist them.
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -403,6 +403,7 @@ struct ohci_hcd {
 #define	OHCI_QUIRK_HUB_POWER	0x100			/* distrust firmware power/oc setup */
 #define	OHCI_QUIRK_AMD_ISO	0x200			/* ISO transfers*/
 #define	OHCI_QUIRK_AMD_PREFETCH	0x400			/* pre-fetch for ISO transfer */
+#define	OHCI_QUIRK_SHUTDOWN	0x800			/* nVidia power bug */
 	// there are also chip quirks/bugs in init logic
 
 	struct work_struct	nec_work;	/* Worker for NEC quirk */
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -169,6 +169,7 @@ static int __devinit mmio_resource_enabl
 static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
 {
 	void __iomem *base;
+	u32 control;
 
 	if (!mmio_resource_enabled(pdev, 0))
 		return;
@@ -177,10 +178,14 @@ static void __devinit quirk_usb_handoff_
 	if (base == NULL)
 		return;
 
+	control = readl(base + OHCI_CONTROL);
+
 /* On PA-RISC, PDC can leave IR set incorrectly; ignore it there. */
-#ifndef __hppa__
-{
-	u32 control = readl(base + OHCI_CONTROL);
+#ifdef __hppa__
+#define	OHCI_CTRL_MASK		(OHCI_CTRL_RWC | OHCI_CTRL_IR)
+#else
+#define	OHCI_CTRL_MASK		OHCI_CTRL_RWC
+
 	if (control & OHCI_CTRL_IR) {
 		int wait_time = 500; /* arbitrary; 5 seconds */
 		writel(OHCI_INTR_OC, base + OHCI_INTRENABLE);
@@ -194,13 +199,12 @@ static void __devinit quirk_usb_handoff_
 			dev_warn(&pdev->dev, "OHCI: BIOS handoff failed"
 					" (BIOS bug?) %08x\n",
 					readl(base + OHCI_CONTROL));
-
-		/* reset controller, preserving RWC */
-		writel(control & OHCI_CTRL_RWC, base + OHCI_CONTROL);
 	}
-}
 #endif
 
+	/* reset controller, preserving RWC (and possibly IR) */
+	writel(control & OHCI_CTRL_MASK, base + OHCI_CONTROL);
+
 	/*
 	 * disable interrupts
 	 */



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 040/173] [media] [v3,media] av7110: check for negative array offset
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (39 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 039/173] OHCI: work around for nVidia shutdown problem Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 041/173] NFS: fix the return value of nfs_file_fsync() Willy Tarreau
                   ` (132 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Carpenter, Mauro Carvalho Chehab, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Carpenter <error27@gmail.com>

commit cb26a24ee9706473f31d34cc259f4dcf45cd0644 upstream.

info->num comes from the user.  It's type int.  If the user passes
in a negative value that would cause memory corruption.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/media/dvb/ttpci/av7110_ca.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/dvb/ttpci/av7110_ca.c
+++ b/drivers/media/dvb/ttpci/av7110_ca.c
@@ -277,7 +277,7 @@ static int dvb_ca_ioctl(struct inode *in
 	{
 		ca_slot_info_t *info=(ca_slot_info_t *)parg;
 
-		if (info->num > 1)
+		if (info->num < 0 || info->num > 1)
 			return -EINVAL;
 		av7110->ci_slot[info->num].num = info->num;
 		av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ?



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 041/173] NFS: fix the return value of nfs_file_fsync()
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (40 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 040/173] [media] [v3,media] av7110: check for negative array offset Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 042/173] isdn: hisax: Replace the bogus access to irq stats Willy Tarreau
                   ` (131 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: J. R. Okajima, Trond Myklebust, Tim Gardner, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: J. R. Okajima <hooanon05@yahoo.co.jp>

commit 0702099bd86c33c2dcdbd3963433a61f3f503901 upstream.

By the commit af7fa16 2010-08-03 NFS: Fix up the fsync code
close(2) became returning the non-zero value even if it went well.
nfs_file_fsync() should return 0 when "status" is positive.

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/nfs/file.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -220,7 +220,7 @@ static int nfs_do_fsync(struct nfs_open_
 	have_error |= test_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags);
 	if (have_error)
 		ret = xchg(&ctx->error, 0);
-	if (!ret)
+	if (!ret && status < 0)
 		ret = status;
 	return ret;
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 042/173] isdn: hisax: Replace the bogus access to irq stats
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (41 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 041/173] NFS: fix the return value of nfs_file_fsync() Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 043/173] dm raid1: fail writes if errors are not handled and log fails Willy Tarreau
                   ` (130 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Thomas Gleixner, maximilian attems, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 40f08a724fcc21285cf3a75aec957aef908605c6 upstream.

Abusing irq stats in a driver for counting interrupts is a horrible
idea and not safe with shared interrupts. Replace it by a local
interrupt counter.

Noticed by the attempt to remove the irq stats export.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/isdn/hisax/config.c |   18 ++++++++++++++----
 drivers/isdn/hisax/hisax.h  |    1 +
 2 files changed, 15 insertions(+), 4 deletions(-)

--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -800,6 +800,16 @@ static void closecard(int cardnr)
 	ll_unload(csta);
 }
 
+static irqreturn_t card_irq(int intno, void *dev_id)
+{
+	struct IsdnCardState *cs = dev_id;
+	irqreturn_t ret = cs->irq_func(intno, cs);
+
+	if (ret == IRQ_HANDLED)
+		cs->irq_cnt++;
+	return ret;
+}
+
 static int init_card(struct IsdnCardState *cs)
 {
 	int 	irq_cnt, cnt = 3, ret;
@@ -808,10 +818,10 @@ static int init_card(struct IsdnCardStat
 		ret = cs->cardmsg(cs, CARD_INIT, NULL);
 		return(ret);
 	}
-	irq_cnt = kstat_irqs(cs->irq);
+	irq_cnt = cs->irq_cnt = 0;
 	printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ],
 	       cs->irq, irq_cnt);
-	if (request_irq(cs->irq, cs->irq_func, cs->irq_flags, "HiSax", cs)) {
+	if (request_irq(cs->irq, card_irq, cs->irq_flags, "HiSax", cs)) {
 		printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n",
 		       cs->irq);
 		return 1;
@@ -821,8 +831,8 @@ static int init_card(struct IsdnCardStat
 		/* Timeout 10ms */
 		msleep(10);
 		printk(KERN_INFO "%s: IRQ %d count %d\n",
-		       CardType[cs->typ], cs->irq, kstat_irqs(cs->irq));
-		if (kstat_irqs(cs->irq) == irq_cnt) {
+		       CardType[cs->typ], cs->irq, cs->irq_cnt);
+		if (cs->irq_cnt == irq_cnt) {
 			printk(KERN_WARNING
 			       "%s: IRQ(%d) getting no interrupts during init %d\n",
 			       CardType[cs->typ], cs->irq, 4 - cnt);
--- a/drivers/isdn/hisax/hisax.h
+++ b/drivers/isdn/hisax/hisax.h
@@ -959,6 +959,7 @@ struct IsdnCardState {
 	u_long		event;
 	struct work_struct tqueue;
 	struct timer_list dbusytimer;
+	unsigned int	irq_cnt;
 #ifdef ERROR_STATISTIC
 	int		err_crc;
 	int		err_tx;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 043/173] dm raid1: fail writes if errors are not handled and log fails
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (42 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 042/173] isdn: hisax: Replace the bogus access to irq stats Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 044/173] GFS2: Fix bmap allocation corner-case bug Willy Tarreau
                   ` (129 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Mikulas Patocka, Alasdair G Kergon, maximilian attems,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Mikulas Patocka <mpatocka@redhat.com>

commit 5528d17de1cf1462f285c40ccaf8e0d0e4c64dc0 upstream.

If the mirror log fails when the handle_errors option was not selected
and there is no remaining valid mirror leg, writes return success even
though they weren't actually written to any device.  This patch
completes them with EIO instead.

This code path is taken:
do_writes:
	bio_list_merge(&ms->failures, &sync);
do_failures:
	if (!get_valid_mirror(ms)) (false)
	else if (errors_handled(ms)) (false)
	else bio_endio(bio, 0);

The logic in do_failures is based on presuming that the write was already
tried: if it succeeded at least on one leg (without handle_errors) it
is reported as success.

Reference: https://bugzilla.redhat.com/show_bug.cgi?id=555197

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/md/dm-raid1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -659,7 +659,7 @@ static void do_writes(struct mirror_set
 	/*
 	 * Dispatch io.
 	 */
-	if (unlikely(ms->log_failure)) {
+	if (unlikely(ms->log_failure) && errors_handled(ms)) {
 		spin_lock_irq(&ms->lock);
 		bio_list_merge(&ms->failures, &sync);
 		spin_unlock_irq(&ms->lock);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 044/173] GFS2: Fix bmap allocation corner-case bug
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (43 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 043/173] dm raid1: fail writes if errors are not handled and log fails Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 045/173] sunrpc/cache: fix module refcnt leak in a failure path Willy Tarreau
                   ` (128 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Steven Whitehouse, maximilian attems, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Steven Whitehouse <swhiteho@redhat.com>

commit 07ccb7bf2c928fef4fea2cda69ba2e23479578db upstream.

This patch solves a corner case during allocation which occurs if both
metadata (indirect) and data blocks are required but there is an
obstacle in the filesystem (e.g. a resource group header or another
allocated block) such that when the allocation is requested only
enough blocks for the metadata are returned.

By changing the exit condition of this loop, we ensure that a
minimum of one data block will always be returned.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/gfs2/bmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -541,7 +541,7 @@ static int gfs2_bmap_alloc(struct inode
 				*ptr++ = cpu_to_be64(bn++);
 			break;
 		}
-	} while (state != ALLOC_DATA);
+	} while ((state != ALLOC_DATA) || !dblock);
 
 	ip->i_height = height;
 	gfs2_add_inode_blocks(&ip->i_inode, alloced);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 045/173] sunrpc/cache: fix module refcnt leak in a failure path
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (44 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 044/173] GFS2: Fix bmap allocation corner-case bug Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 046/173] tcp: Increase TCP_MAXSEG socket option minimum Willy Tarreau
                   ` (127 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Li Zefan, J. Bruce Fields, Neil Brown, Trond Myklebust,
	Andrew Morton, J. Bruce Fields, maximilian attems,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Li Zefan <lizf@cn.fujitsu.com>

commit a5990ea1254cd186b38744507aeec3136a0c1c95 upstream.

Don't forget to release the module refcnt if seq_open() returns failure.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: J. Bruce Fields <bfields@fieldses.org>
Cc: Neil Brown <neilb@suse.de>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/sunrpc/cache.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1234,8 +1234,10 @@ static int content_open(struct inode *in
 	if (!cd || !try_module_get(cd->owner))
 		return -EACCES;
 	han = __seq_open_private(file, &cache_content_op, sizeof(*han));
-	if (han == NULL)
+	if (han == NULL) {
+		module_put(cd->owner);
 		return -ENOMEM;
+	}
 
 	han->cd = cd;
 	return 0;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 046/173] tcp: Increase TCP_MAXSEG socket option minimum.
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (45 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 045/173] sunrpc/cache: fix module refcnt leak in a failure path Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 047/173] tcp: Make TCP_MAXSEG minimum more correct Willy Tarreau
                   ` (126 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: David S. Miller, Moritz Muehlenhoff, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: David S. Miller <davem@davemloft.net>

commit 7a1abd08d52fdeddb3e9a5a33f2f15cc6a5674d2 upstream.

As noted by Steve Chen, since commit
f5fff5dc8a7a3f395b0525c02ba92c95d42b7390 ("tcp: advertise MSS
requested by user") we can end up with a situation where
tcp_select_initial_window() does a divide by a zero (or
even negative) mss value.

The problem is that sometimes we effectively subtract
TCPOLEN_TSTAMP_ALIGNED and/or TCPOLEN_MD5SIG_ALIGNED from the mss.

Fix this by increasing the minimum from 8 to 64.

Reported-by: Steve Chen <schen@mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/tcp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2117,7 +2117,7 @@ static int do_tcp_setsockopt(struct sock
 		/* Values greater than interface MTU won't take effect. However
 		 * at the point when this call is done we typically don't yet
 		 * know which interface is going to be used */
-		if (val < 8 || val > MAX_TCP_WINDOW) {
+		if (val < 64 || val > MAX_TCP_WINDOW) {
 			err = -EINVAL;
 			break;
 		}



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 047/173] tcp: Make TCP_MAXSEG minimum more correct.
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (46 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 046/173] tcp: Increase TCP_MAXSEG socket option minimum Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 048/173] nfsd: correctly handle return value from nfsd_map_name_to_* Willy Tarreau
                   ` (125 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: David S. Miller, Moritz Muehlenhoff, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: David S. Miller <davem@davemloft.net>

commit c39508d6f118308355468314ff414644115a07f3 upstream.

Use TCP_MIN_MSS instead of constant 64.

Reported-by: Min Zhang <mzhang@mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/tcp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2117,7 +2117,7 @@ static int do_tcp_setsockopt(struct sock
 		/* Values greater than interface MTU won't take effect. However
 		 * at the point when this call is done we typically don't yet
 		 * know which interface is going to be used */
-		if (val < 64 || val > MAX_TCP_WINDOW) {
+		if (val < TCP_MIN_MSS || val > MAX_TCP_WINDOW) {
 			err = -EINVAL;
 			break;
 		}



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 048/173] nfsd: correctly handle return value from nfsd_map_name_to_*
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (47 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 047/173] tcp: Make TCP_MAXSEG minimum more correct Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 049/173] s390: remove task_show_regs Willy Tarreau
                   ` (124 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: NeilBrown, J. Bruce Fields, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: NeilBrown <neilb@suse.de>

commit 47c85291d3dd1a51501555000b90f8e281a0458e upstream.

These functions return an nfs status, not a host_err.  So don't
try to convert  before returning.

This is a regression introduced by
3c726023402a2f3b28f49b9d90ebf9e71151157d; I fixed up two of the callers,
but missed these two.

Reported-by: Herbert Poetzl <herbert@13thfloor.at>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/nfsd/nfs4xdr.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -323,8 +323,8 @@ nfsd4_decode_fattr(struct nfsd4_compound
 		READ_BUF(dummy32);
 		len += (XDR_QUADLEN(dummy32) << 2);
 		READMEM(buf, dummy32);
-		if ((host_err = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
-			goto out_nfserr;
+		if ((status = nfsd_map_name_to_uid(argp->rqstp, buf, dummy32, &iattr->ia_uid)))
+			return status;
 		iattr->ia_valid |= ATTR_UID;
 	}
 	if (bmval[1] & FATTR4_WORD1_OWNER_GROUP) {
@@ -334,8 +334,8 @@ nfsd4_decode_fattr(struct nfsd4_compound
 		READ_BUF(dummy32);
 		len += (XDR_QUADLEN(dummy32) << 2);
 		READMEM(buf, dummy32);
-		if ((host_err = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
-			goto out_nfserr;
+		if ((status = nfsd_map_name_to_gid(argp->rqstp, buf, dummy32, &iattr->ia_gid)))
+			return status;
 		iattr->ia_valid |= ATTR_GID;
 	}
 	if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) {



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 049/173] s390: remove task_show_regs
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (48 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 048/173] nfsd: correctly handle return value from nfsd_map_name_to_* Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 050/173] fs/partitions: Validate map_count in Mac partition tables Willy Tarreau
                   ` (123 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Martin Schwidefsky, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

commit 261cd298a8c363d7985e3482946edb4bfedacf98 upstream.

task_show_regs used to be a debugging aid in the early bringup days
of Linux on s390. /proc/<pid>/status is a world readable file, it
is not a good idea to show the registers of a process. The only
correct fix is to remove task_show_regs.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/s390/include/asm/processor.h |    5 -----
 arch/s390/kernel/traps.c          |   37 -------------------------------------
 fs/proc/array.c                   |    3 ---
 3 files changed, 45 deletions(-)

--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -150,11 +150,6 @@ extern int kernel_thread(int (*fn)(void
  */
 extern unsigned long thread_saved_pc(struct task_struct *t);
 
-/*
- * Print register of task into buffer. Used in fs/proc/array.c.
- */
-extern void task_show_regs(struct seq_file *m, struct task_struct *task);
-
 extern void show_code(struct pt_regs *regs);
 
 unsigned long get_wchan(struct task_struct *p);
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -243,43 +243,6 @@ void show_regs(struct pt_regs *regs)
 	show_last_breaking_event(regs);
 }
 
-/* This is called from fs/proc/array.c */
-void task_show_regs(struct seq_file *m, struct task_struct *task)
-{
-	struct pt_regs *regs;
-
-	regs = task_pt_regs(task);
-	seq_printf(m, "task: %p, ksp: %p\n",
-		       task, (void *)task->thread.ksp);
-	seq_printf(m, "User PSW : %p %p\n",
-		       (void *) regs->psw.mask, (void *)regs->psw.addr);
-
-	seq_printf(m, "User GPRS: " FOURLONG,
-			  regs->gprs[0], regs->gprs[1],
-			  regs->gprs[2], regs->gprs[3]);
-	seq_printf(m, "           " FOURLONG,
-			  regs->gprs[4], regs->gprs[5],
-			  regs->gprs[6], regs->gprs[7]);
-	seq_printf(m, "           " FOURLONG,
-			  regs->gprs[8], regs->gprs[9],
-			  regs->gprs[10], regs->gprs[11]);
-	seq_printf(m, "           " FOURLONG,
-			  regs->gprs[12], regs->gprs[13],
-			  regs->gprs[14], regs->gprs[15]);
-	seq_printf(m, "User ACRS: %08x %08x %08x %08x\n",
-			  task->thread.acrs[0], task->thread.acrs[1],
-			  task->thread.acrs[2], task->thread.acrs[3]);
-	seq_printf(m, "           %08x %08x %08x %08x\n",
-			  task->thread.acrs[4], task->thread.acrs[5],
-			  task->thread.acrs[6], task->thread.acrs[7]);
-	seq_printf(m, "           %08x %08x %08x %08x\n",
-			  task->thread.acrs[8], task->thread.acrs[9],
-			  task->thread.acrs[10], task->thread.acrs[11]);
-	seq_printf(m, "           %08x %08x %08x %08x\n",
-			  task->thread.acrs[12], task->thread.acrs[13],
-			  task->thread.acrs[14], task->thread.acrs[15]);
-}
-
 static DEFINE_SPINLOCK(die_lock);
 
 void die(const char * str, struct pt_regs * regs, long err)
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -336,9 +336,6 @@ int proc_pid_status(struct seq_file *m,
 	task_sig(m, task);
 	task_cap(m, task);
 	cpuset_task_status_allowed(m, task);
-#if defined(CONFIG_S390)
-	task_show_regs(m, task);
-#endif
 	task_context_switch_counts(m, task);
 	return 0;
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 050/173] fs/partitions: Validate map_count in Mac partition tables
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (49 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 049/173] s390: remove task_show_regs Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 051/173] [media] radio-aimslab.c needs #include <linux/delay.h> Willy Tarreau
                   ` (122 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Timo Warns, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Timo Warns <warns@pre-sense.de>

commit fa7ea87a057958a8b7926c1a60a3ca6d696328ed upstream.

Validate number of blocks in map and remove redundant variable.

Signed-off-by: Timo Warns <warns@pre-sense.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/partitions/mac.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Index: longterm-2.6.27/fs/partitions/mac.c
===================================================================
--- longterm-2.6.27.orig/fs/partitions/mac.c	2011-04-25 18:46:11.560278684 +0200
+++ longterm-2.6.27/fs/partitions/mac.c	2011-04-25 18:49:34.161384483 +0200
@@ -29,10 +29,9 @@
 
 int mac_partition(struct parsed_partitions *state, struct block_device *bdev)
 {
-	int slot = 1;
 	Sector sect;
 	unsigned char *data;
-	int blk, blocks_in_map;
+	int slot, blocks_in_map;
 	unsigned secsize;
 #ifdef CONFIG_PPC_PMAC
 	int found_root = 0;
@@ -59,10 +58,14 @@
 		put_dev_sector(sect);
 		return 0;		/* not a MacOS disk */
 	}
-	printk(" [mac]");
 	blocks_in_map = be32_to_cpu(part->map_count);
-	for (blk = 1; blk <= blocks_in_map; ++blk) {
-		int pos = blk * secsize;
+	if (blocks_in_map < 0 || blocks_in_map >= MAX_PART) {
+		put_dev_sector(sect);
+		return 0;
+	}
+	printk(" [mac]");
+	for (slot = 1; slot <= blocks_in_map; ++slot) {
+		int pos = slot * secsize;
 		put_dev_sector(sect);
 		data = read_dev_sector(bdev, pos/512, &sect);
 		if (!data)
@@ -113,13 +116,11 @@
 			}
 
 			if (goodness > found_root_goodness) {
-				found_root = blk;
+				found_root = slot;
 				found_root_goodness = goodness;
 			}
 		}
 #endif /* CONFIG_PPC_PMAC */
-
-		++slot;
 	}
 #ifdef CONFIG_PPC_PMAC
 	if (found_root_goodness)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 051/173] [media] radio-aimslab.c needs #include <linux/delay.h>
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (50 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 050/173] fs/partitions: Validate map_count in Mac partition tables Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 052/173] ARM: Ensure predictable endian state on signal handler entry Willy Tarreau
                   ` (121 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Geert Uytterhoeven, Mauro Carvalho Chehab, dann frazier,
	Greg Kroah-Hartman

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Geert Uytterhoeven <geert@linux-m68k.org>

commit 2400982a2e8a8e4e95f0a0e1517bbe63cc88038f upstream.

Commit e3c92215198cb6aa00ad38db2780faa6b72e0a3f ("[media] radio-aimslab.c: Fix
gcc 4.5+ bug") removed the include, but introduced new callers of msleep():

| drivers/media/radio/radio-aimslab.c: In function ‘rt_decvol’:
| drivers/media/radio/radio-aimslab.c:76: error: implicit declaration of function ‘msleep’

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: dann frazier <dannf@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/media/radio/radio-aimslab.c |    1 +
 1 file changed, 1 insertion(+)

Index: longterm-2.6.27/drivers/media/radio/radio-aimslab.c
===================================================================
--- longterm-2.6.27.orig/drivers/media/radio/radio-aimslab.c	2011-04-25 11:58:08.000000000 +0200
+++ longterm-2.6.27/drivers/media/radio/radio-aimslab.c	2011-04-25 14:19:13.054281433 +0200
@@ -33,6 +33,7 @@
 #include <linux/ioport.h>	/* request_region		*/
 #include <asm/io.h>		/* outb, outb_p			*/
 #include <asm/uaccess.h>	/* copy to/from user		*/
+#include <linux/delay.h>	/* msleep			*/
 #include <linux/videodev2.h>	/* kernel radio structs		*/
 #include <media/v4l2-common.h>
 #include <media/v4l2-ioctl.h>



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 052/173] ARM: Ensure predictable endian state on signal handler entry
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (51 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 051/173] [media] radio-aimslab.c needs #include <linux/delay.h> Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 053/173] platform: x86: asus_acpi: world-writable procfs files Willy Tarreau
                   ` (120 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dave Martin, Russell King, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Russell King <rmk+kernel@arm.linux.org.uk>

commit 53399053eb505cf541b2405bd9d9bca5ecfb96fb upstream.

Ensure a predictable endian state when entering signal handlers.  This
avoids programs which use SETEND to momentarily switch their endian
state from having their signal handlers entered with an unpredictable
endian state.

Acked-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/arm/kernel/signal.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -389,7 +389,9 @@ setup_return(struct pt_regs *regs, struc
 	unsigned long handler = (unsigned long)ka->sa.sa_handler;
 	unsigned long retcode;
 	int thumb = 0;
-	unsigned long cpsr = regs->ARM_cpsr & ~PSR_f;
+	unsigned long cpsr = regs->ARM_cpsr & ~(PSR_f | PSR_E_BIT);
+
+	cpsr |= PSR_ENDSTATE;
 
 	/*
 	 * Maybe we need to deliver a 32-bit signal to a 26-bit task.



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 053/173] platform: x86: asus_acpi: world-writable procfs files
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (52 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 052/173] ARM: Ensure predictable endian state on signal handler entry Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 054/173] acer-wmi: Fix capitalisation of GUID Willy Tarreau
                   ` (119 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Matthew Garrett, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 8040835760adf0ef66876c063d47f79f015fb55d upstream.

Don't allow everybody to change ACPI settings.  The comment says that it
is done deliberatelly, however, the comment before disp_proc_write()
says that at least one of these setting is experimental.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/platform/x86/asus_acpi.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1001,14 +1001,8 @@ static int asus_hotk_add_fs(struct acpi_
 	struct proc_dir_entry *proc;
 	mode_t mode;
 
-	/*
-	 * If parameter uid or gid is not changed, keep the default setting for
-	 * our proc entries (-rw-rw-rw-) else, it means we care about security,
-	 * and then set to -rw-rw----
-	 */
-
 	if ((asus_uid == 0) && (asus_gid == 0)) {
-		mode = S_IFREG | S_IRUGO | S_IWUGO;
+		mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
 	} else {
 		mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
 		printk(KERN_WARNING "  asus_uid and asus_gid parameters are "



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 054/173] acer-wmi: Fix capitalisation of GUID
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (53 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 053/173] platform: x86: asus_acpi: world-writable procfs files Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 22:00   ` Carlos Corbacho
  2011-04-25 20:03 ` [PATCH 055/173] platform: x86: acer-wmi: world-writable sysfs threeg file Willy Tarreau
                   ` (118 subsequent siblings)
  173 siblings, 1 reply; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Matthew Garrett, Carlos Corbacho, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Matthew Garrett <mjg@redhat.com>

commit bbb706079abe955a9e3f208f541de97d99449236 upstream.

6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3 needs to be
6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3 to match the hardware alias.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/platform/x86/acer-wmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -90,7 +90,7 @@ struct acer_quirks {
  */
 #define AMW0_GUID1		"67C3371D-95A3-4C37-BB61-DD47B491DAAB"
 #define AMW0_GUID2		"431F16ED-0C2B-444C-B267-27DEB140CF9C"
-#define WMID_GUID1		"6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3"
+#define WMID_GUID1		"6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3"
 #define WMID_GUID2		"95764E09-FB56-4e83-B31A-37761F60994A"
 
 MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB");



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 055/173] platform: x86: acer-wmi: world-writable sysfs threeg file
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (54 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 054/173] acer-wmi: Fix capitalisation of GUID Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 056/173] platform: x86: tc1100-wmi: world-writable sysfs wireless and jogdial files Willy Tarreau
                   ` (117 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Matthew Garrett, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit b80b168f918bba4b847e884492415546b340e19d upstream.

Don't allow everybody to write to hardware registers.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[wt: also fixed permission on interface]

---
 drivers/platform/x86/acer-wmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: longterm-2.6.27/drivers/misc/acer-wmi.c
===================================================================
--- longterm-2.6.27.orig/drivers/misc/acer-wmi.c	2011-04-25 14:48:12.000000000 +0200
+++ longterm-2.6.27/drivers/misc/acer-wmi.c	2011-04-25 14:57:17.405278940 +0200
@@ -957,7 +957,7 @@
 			return -EINVAL; \
 	return count; \
 } \
-static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \
+static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, \
 	show_bool_##value, set_bool_##value);
 
 show_set_bool(wireless, ACER_CAP_WIRELESS);
@@ -982,7 +982,7 @@
 	}
 }
 
-static DEVICE_ATTR(interface, S_IWUGO | S_IRUGO | S_IWUSR,
+static DEVICE_ATTR(interface, S_IRUGO | S_IWUSR,
 	show_interface, NULL);
 
 /*



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 056/173] platform: x86: tc1100-wmi: world-writable sysfs wireless and jogdial files
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (55 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 055/173] platform: x86: acer-wmi: world-writable sysfs threeg file Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 057/173] genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for now Willy Tarreau
                   ` (116 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Matthew Garrett, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 8a6a142c1286797978e4db266d22875a5f424897 upstream.

Don't allow everybody to change WMI settings.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/platform/x86/tc1100-wmi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/misc/tc1100-wmi.c
+++ b/drivers/misc/tc1100-wmi.c
@@ -177,7 +177,7 @@ set_bool_##value(struct device *dev, str
 			return -EINVAL; \
 	return count; \
 } \
-static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \
+static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, \
 	show_bool_##value, set_bool_##value);
 
 show_set_bool(wireless, TC1100_INSTANCE_WIRELESS);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 057/173] genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for now
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (56 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 056/173] platform: x86: tc1100-wmi: world-writable sysfs wireless and jogdial files Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 058/173] usb: musb: omap2430: fix kernel panic on reboot Willy Tarreau
                   ` (115 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Thomas Gleixner, Anton Vorontsov, David Woodhouse,
	Arjan van de Ven, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 6d83f94db95cfe65d2a6359cccdf61cf087c2598 upstream.

With CONFIG_SHIRQ_DEBUG=y we call a newly installed interrupt handler
in request_threaded_irq().

The original implementation (commit a304e1b8) called the handler
_BEFORE_ it was installed, but that caused problems with handlers
calling disable_irq_nosync(). See commit 377bf1e4.

It's braindead in the first place to call disable_irq_nosync in shared
handlers, but ....

Moving this call after we installed the handler looks innocent, but it
is very subtle broken on SMP.

Interrupt handlers rely on the fact, that the irq core prevents
reentrancy.

Now this debug call violates that promise because we run the handler
w/o the IRQ_INPROGRESS protection - which we cannot apply here because
that would result in a possibly forever masked interrupt line.

A concurrent real hardware interrupt on a different CPU results in
handler reentrancy and can lead to complete wreckage, which was
unfortunately observed in reality and took a fricking long time to
debug.

Leave the code here for now. We want this debug feature, but that's
not easy to fix. We really should get rid of those
disable_irq_nosync() abusers and remove that function completely.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/irq/manage.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1079,7 +1079,7 @@ int request_threaded_irq(unsigned int ir
 	if (retval)
 		kfree(action);
 
-#ifdef CONFIG_DEBUG_SHIRQ
+#ifdef CONFIG_DEBUG_SHIRQ_FIXME
 	if (irqflags & IRQF_SHARED) {
 		/*
 		 * It's a shared IRQ -- the driver ought to be prepared for it



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 058/173] usb: musb: omap2430: fix kernel panic on reboot
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (57 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 057/173] genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for now Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 059/173] ldm: corrupted partition table can cause kernel oops Willy Tarreau
                   ` (114 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Johan Hovold, Felipe Balbi, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Johan Hovold <jhovold@gmail.com>

commit b193b412e62b134adf69af286c7e7f8e99259350 upstream.

Cancel idle timer in musb_platform_exit.

The idle timer could trigger after clock had been disabled leading to
kernel panic when MUSB_DEVCTL is accessed in musb_do_idle on 2.6.37.

The fault below is no longer triggered on 2.6.38-rc4 (clock is disabled
later, and only if compiled as a module, and the offending memory access
has moved) but the timer should be cancelled nonetheless.

Rebooting... musb_hdrc musb_hdrc: remove, state 4
usb usb1: USB disconnect, address 1
musb_hdrc musb_hdrc: USB bus 1 deregistered
Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0ab060
Internal error: : 1028 [#1] PREEMPT
last sysfs file: /sys/kernel/uevent_seqnum
Modules linked in:
CPU: 0    Not tainted  (2.6.37+ #6)
PC is at musb_do_idle+0x24/0x138
LR is at musb_do_idle+0x18/0x138
pc : [<c02377d8>]    lr : [<c02377cc>]    psr: 80000193
sp : cf2bdd80  ip : cf2bdd80  fp : c048a20c
r10: c048a60c  r9 : c048a40c  r8 : cf85e110
r7 : cf2bc000  r6 : 40000113  r5 : c0489800  r4 : cf85e110
r3 : 00000004  r2 : 00000006  r1 : fa0ab000  r0 : cf8a7000
Flags: Nzcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: 8faac019  DAC: 00000015
Process reboot (pid: 769, stack limit = 0xcf2bc2f0)
Stack: (0xcf2bdd80 to 0xcf2be000)
dd80: 00000103 c0489800 c02377b4 c005fa34 00000555 c0071a8c c04a3858 cf2bdda8
dda0: 00000555 c048a00c cf2bdda8 cf2bdda8 1838beb0 00000103 00000004 cf2bc000
ddc0: 00000001 00000001 c04896c8 0000000a 00000000 c005ac14 00000001 c003f32c
dde0: 00000000 00000025 00000000 cf2bc000 00000002 00000001 cf2bc000 00000000
de00: 00000001 c005ad08 cf2bc000 c002e07c c03ec039 ffffffff fa200000 c0033608
de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
de60: 60000013 ffffffff c0033c04 00000000 01234567 fee1dead 00000000 c006627c
de80: 00000001 c00662c8 28121969 c00663ec cfa38c40 cf9f6a00 cf2bded0 cf9f6a0c
dea0: 00000000 cf92f000 00008914 c02cd284 c04a55c8 c028b398 c00715c0 becf24a8
dec0: 30687465 00000000 00000000 00000000 00000002 1301a8c0 00000000 00000000
dee0: 00000002 1301a8c0 00000000 00000000 c0450494 cf527920 00011f10 cf2bdf08
df00: 00011f10 cf2bdf10 00011f10 cf2bdf18 c00f0b44 c004f7e8 cf2bdf18 cf2bdf18
df20: 00011f10 cf2bdf30 00011f10 cf2bdf38 cf401300 cf486100 00000008 c00d2b28
df40: 00011f10 cf401300 00200200 c00d3388 00011f10 cfb63a88 cfb63a80 c00c2f08
df60: 00000000 00000000 cfb63a80 00000000 cf0a3480 00000006 c0033c04 cfb63a80
df80: 00000000 c00c0104 00000003 cf0a3480 cfb63a80 00000000 00000001 00000004
dfa0: 00000058 c0033a80 00000000 00000001 fee1dead 28121969 01234567 00000000
dfc0: 00000000 00000001 00000004 00000058 00000001 00000001 00000000 00000001
dfe0: 4024d200 becf2cb0 00009210 4024d218 60000010 fee1dead 00000000 00000000
[<c02377d8>] (musb_do_idle+0x24/0x138) from [<c005fa34>] (run_timer_softirq+0x1a8/0x26)
[<c005fa34>] (run_timer_softirq+0x1a8/0x26c) from [<c005ac14>] (__do_softirq+0x88/0x13)
[<c005ac14>] (__do_softirq+0x88/0x138) from [<c005ad08>] (irq_exit+0x44/0x98)
[<c005ad08>] (irq_exit+0x44/0x98) from [<c002e07c>] (asm_do_IRQ+0x7c/0xa0)
[<c002e07c>] (asm_do_IRQ+0x7c/0xa0) from [<c0033608>] (__irq_svc+0x48/0xa8)
Exception stack(0xcf2bde20 to 0xcf2bde68)
de20: 00000001 00000000 cf852c14 cf81f200 c045b714 c045b708 cf2bc000 c04a37e8
de40: c0033c04 cf2bc000 00000000 00000001 cf2bde68 cf2bde68 c01c3abc c004f7d8
de60: 60000013 ffffffff
[<c0033608>] (__irq_svc+0x48/0xa8) from [<c004f7d8>] (sub_preempt_count+0x0/0xb8)
Code: ebf86030 e5940098 e594108c e5902010 (e5d13060)
---[ end trace 3689c0d808f9bf7c ]---
Kernel panic - not syncing: Fatal exception in interrupt

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/musb/omap2430.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -309,6 +309,7 @@ static int musb_platform_resume(struct m
 
 int musb_platform_exit(struct musb *musb)
 {
+	del_timer_sync(&musb_idle_timer);
 
 	omap_vbus_power(musb, 0 /*off*/, 1);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 059/173] ldm: corrupted partition table can cause kernel oops
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (58 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 058/173] usb: musb: omap2430: fix kernel panic on reboot Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 060/173] md: correctly handle probe of an mdp device Willy Tarreau
                   ` (113 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Timo Warns, Eugene Teo, Richard Russon, Harvey Harrison,
	Andrew Morton, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Timo Warns <Warns@pre-sense.de>

commit 294f6cf48666825d23c9372ef37631232746e40d upstream.

The kernel automatically evaluates partition tables of storage devices.
The code for evaluating LDM partitions (in fs/partitions/ldm.c) contains
a bug that causes a kernel oops on certain corrupted LDM partitions.  A
kernel subsystem seems to crash, because, after the oops, the kernel no
longer recognizes newly connected storage devices.

The patch changes ldm_parse_vmdb() to Validate the value of vblk_size.

Signed-off-by: Timo Warns <warns@pre-sense.de>
Cc: Eugene Teo <eugeneteo@kernel.sg>
Acked-by: Richard Russon <ldm@flatcap.org>
Cc: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/partitions/ldm.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/fs/partitions/ldm.c
+++ b/fs/partitions/ldm.c
@@ -251,6 +251,11 @@ static bool ldm_parse_vmdb (const u8 *da
 	}
 
 	vm->vblk_size     = get_unaligned_be32(data + 0x08);
+	if (vm->vblk_size == 0) {
+		ldm_error ("Illegal VBLK size");
+		return false;
+	}
+
 	vm->vblk_offset   = get_unaligned_be32(data + 0x0C);
 	vm->last_vblk_seq = get_unaligned_be32(data + 0x04);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 060/173] md: correctly handle probe of an mdp device.
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (59 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 059/173] ldm: corrupted partition table can cause kernel oops Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 061/173] x25: Do not reference freed memory Willy Tarreau
                   ` (112 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: NeilBrown, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: NeilBrown <neilb@suse.de>

commit 8f5f02c460b7ca74ce55ce126ce0c1e58a3f923d upstream.

'mdp' devices are md devices with preallocated device numbers
for partitions. As such it is possible to mknod and open a partition
before opening the whole device.

this causes  md_probe() to be called with a device number of a
partition, which in-turn calls mddev_find with such a number.

However mddev_find expects the number of a 'whole device' and
does the wrong thing with partition numbers.

So add code to mddev_find to remove the 'partition' part of
a device number and just work with the 'whole device'.

This patch addresses https://bugzilla.kernel.org/show_bug.cgi?id=28652

Reported-by: hkmaly@bigfoot.com
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/md/md.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -305,6 +305,9 @@ static mddev_t * mddev_find(dev_t unit)
 {
 	mddev_t *mddev, *new = NULL;
 
+	if (unit && MAJOR(unit) != MD_MAJOR)
+		unit &= ~((1<<MdpMinorShift)-1);
+
  retry:
 	spin_lock(&all_mddevs_lock);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 061/173] x25: Do not reference freed memory.
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (60 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 060/173] md: correctly handle probe of an mdp device Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 062/173] mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo Willy Tarreau
                   ` (111 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: David S. Miller <davem@davemloft.net>

commit 96642d42f076101ba98866363d908cab706d156c upstream.

In x25_link_free(), we destroy 'nb' before dereferencing
'nb->dev'.  Don't do this, because 'nb' might be freed
by then.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/x25/x25_link.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/net/x25/x25_link.c
+++ b/net/x25/x25_link.c
@@ -391,9 +391,12 @@ void __exit x25_link_free(void)
 	write_lock_bh(&x25_neigh_list_lock);
 
 	list_for_each_safe(entry, tmp, &x25_neigh_list) {
+		struct net_device *dev;
+
 		nb = list_entry(entry, struct x25_neigh, node);
+		dev = nb->dev;
 		__x25_remove_neigh(nb);
-		dev_put(nb->dev);
+		dev_put(dev);
 	}
 	write_unlock_bh(&x25_neigh_list_lock);
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 062/173] mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (61 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 061/173] x25: Do not reference freed memory Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 063/173] x86: Use u32 instead of long to set reset vector back to 0 Willy Tarreau
                   ` (110 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jochen Friedrich, Samuel Ortiz, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jochen Friedrich <jochen@scram.de>

commit 9063f1f15eec35e5fd608879cef8be5728f2d12a upstream.

Call input_set_abs_params instead of manually setting absbit only.
This fixes this oops:

Unable to handle kernel NULL pointer dereference at virtual address 00000024
Internal error: Oops: 41b67017 [#1]
CPU: 0    Not tainted  (2.6.37 #4)
pc : [<c016d1fc>]    lr : [<00000000>]    psr: 20000093
sp : c19e5f30  ip : c19e5e6c  fp : c19e5f58
r10: 00000000  r9 : c19e4000  r8 : 00000003
r7 : 000001e4  r6 : 00000001  r5 : c1854400  r4 : 00000003
r3 : 00000018  r2 : 00000018  r1 : 00000018  r0 : c185447c
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: c1b6717f  Table: c1b6717f  DAC: 00000017
Stack: (0xc19e5f30 to 0xc19e6000)
5f20:                                     00000003 00000003 c1854400 00000013
5f40: 00000001 000001e4 000001c5 c19e5f80 c19e5f5c c016d5e8 c016cf5c 000001e4
5f60: c1854400 c18b5860 00000000 00000171 000001e4 c19e5fc4 c19e5f84 c01559a4
5f80: c016d584 c18b5868 00000000 c1bb5c40 c0035afc c18b5868 c18b5868 c1a55d54
5fa0: c18b5860 c0155750 00000013 00000000 00000000 00000000 c19e5ff4 c19e5fc8
5fc0: c0050174 c015575c 00000000 c18b5860 00000000 c19e5fd4 c19e5fd4 c1a55d54
5fe0: c00500f0 c003b464 00000000 c19e5ff8 c003b464 c00500fc 04000400 04000400
Backtrace:
Function entered at [<c016cf50>] from [<c016d5e8>]
Function entered at [<c016d578>] from [<c01559a4>]
 r8:000001e4 r7:00000171 r6:00000000 r5:c18b5860 r4:c1854400
Function entered at [<c0155750>] from [<c0050174>]
Function entered at [<c00500f0>] from [<c003b464>]
 r6:c003b464 r5:c00500f0 r4:c1a55d54
Code: e59520fc e1a03286 e0433186 e0822003 (e592000c)

>>PC;  c016d1fc <input_handle_event+2ac/5a0>   <=====

Trace; c016cf50 <input_handle_event+0/5a0>
Trace; c016d5e8 <input_event+70/88>
Trace; c016d578 <input_event+0/88>
Trace; c01559a4 <ucb1x00_thread+254/2dc>
Trace; c0155750 <ucb1x00_thread+0/2dc>
Trace; c0050174 <kthread+84/8c>
Trace; c00500f0 <kthread+0/8c>
Trace; c003b464 <do_exit+0/624>

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/mfd/ucb1x00-ts.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -385,12 +385,18 @@ static int ucb1x00_ts_add(struct ucb1x00
 	idev->close      = ucb1x00_ts_close;
 
 	__set_bit(EV_ABS, idev->evbit);
-	__set_bit(ABS_X, idev->absbit);
-	__set_bit(ABS_Y, idev->absbit);
-	__set_bit(ABS_PRESSURE, idev->absbit);
 
 	input_set_drvdata(idev, ts);
 
+	ucb1x00_adc_enable(ts->ucb);
+	ts->x_res = ucb1x00_ts_read_xres(ts);
+	ts->y_res = ucb1x00_ts_read_yres(ts);
+	ucb1x00_adc_disable(ts->ucb);
+
+	input_set_abs_params(idev, ABS_X, 0, ts->x_res, 0, 0);
+	input_set_abs_params(idev, ABS_Y, 0, ts->y_res, 0, 0);
+	input_set_abs_params(idev, ABS_PRESSURE, 0, 0, 0, 0);
+
 	err = input_register_device(idev);
 	if (err)
 		goto fail;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 063/173] x86: Use u32 instead of long to set reset vector back to 0
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (62 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 062/173] mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 064/173] ext2: Fix link count corruption under heavy link+rename load Willy Tarreau
                   ` (109 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Don Zickus, Matthew Garrett, Ingo Molnar, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Don Zickus <dzickus@redhat.com>

commit 299c56966a72b9109d47c71a6db52097098703dd upstream.

A customer of ours, complained that when setting the reset
vector back to 0, it trashed other data and hung their box.
They noticed when only 4 bytes were set to 0 instead of 8,
everything worked correctly.

Mathew pointed out:

 |
 | We're supposed to be resetting trampoline_phys_low and
 | trampoline_phys_high here, which are two 16-bit values.
 | Writing 64 bits is definitely going to overwrite space
 | that we're not supposed to be touching.
 |

So limit the area modified to u32.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Acked-by: Matthew Garrett <mjg@redhat.com>
LKML-Reference: <1297139100-424-1-git-send-email-dzickus@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/include/asm/smpboot_hooks.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: longterm-2.6.27/include/asm-x86/mach-default/smpboot_hooks.h
===================================================================
--- longterm-2.6.27.orig/include/asm-x86/mach-default/smpboot_hooks.h	2011-04-25 15:10:35.000000000 +0200
+++ longterm-2.6.27/include/asm-x86/mach-default/smpboot_hooks.h	2011-04-25 15:10:44.035278651 +0200
@@ -32,7 +32,7 @@
 	 */
 	CMOS_WRITE(0, 0xf);
 
-	*((volatile long *) phys_to_virt(0x467)) = 0;
+	*((volatile u32 *) phys_to_virt(0x467)) = 0;
 }
 
 static inline void __init smpboot_setup_io_apic(void)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 064/173] ext2: Fix link count corruption under heavy link+rename load
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (63 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 063/173] x86: Use u32 instead of long to set reset vector back to 0 Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 065/173] sctp: Fix oops when sending queued ASCONF chunks Willy Tarreau
                   ` (108 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Al Viro, Josh Hunt, Jan Kara, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Josh Hunt <johunt@akamai.com>

commit e8a80c6f769dd4622d8b211b398452158ee60c0b upstream.

vfs_rename_other() does not lock renamed inode with i_mutex. Thus changing
i_nlink in a non-atomic manner (which happens in ext2_rename()) can corrupt
it as reported and analyzed by Josh.

In fact, there is no good reason to mess with i_nlink of the moved file.
We did it presumably to simulate linking into the new directory and unlinking
from an old one. But the practical effect of this is disputable because fsck
can possibly treat file as being properly linked into both directories without
writing any error which is confusing. So we just stop increment-decrement
games with i_nlink which also fixes the corruption.

CC: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Josh Hunt <johunt@akamai.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ext2/namei.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Index: longterm-2.6.27/fs/ext2/namei.c
===================================================================
--- longterm-2.6.27.orig/fs/ext2/namei.c	2011-01-23 10:52:28.000000000 +0100
+++ longterm-2.6.27/fs/ext2/namei.c	2011-04-25 15:14:36.125277949 +0200
@@ -322,7 +322,6 @@
 		new_de = ext2_find_entry (new_dir, new_dentry, &new_page);
 		if (!new_de)
 			goto out_dir;
-		inode_inc_link_count(old_inode);
 		ext2_set_link(new_dir, new_de, new_page, old_inode);
 		new_inode->i_ctime = CURRENT_TIME_SEC;
 		if (dir_de)
@@ -334,12 +333,9 @@
 			if (new_dir->i_nlink >= EXT2_LINK_MAX)
 				goto out_dir;
 		}
-		inode_inc_link_count(old_inode);
 		err = ext2_add_link(new_dentry, old_inode);
-		if (err) {
-			inode_dec_link_count(old_inode);
+		if (err)
 			goto out_dir;
-		}
 		if (dir_de)
 			inode_inc_link_count(new_dir);
 	}
@@ -347,12 +343,11 @@
 	/*
 	 * Like most other Unix systems, set the ctime for inodes on a
  	 * rename.
-	 * inode_dec_link_count() will mark the inode dirty.
 	 */
 	old_inode->i_ctime = CURRENT_TIME_SEC;
+	mark_inode_dirty(old_inode);
 
 	ext2_delete_entry (old_de, old_page);
-	inode_dec_link_count(old_inode);
 
 	if (dir_de) {
 		ext2_set_link(old_inode, dir_de, dir_page, new_dir);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 065/173] sctp: Fix oops when sending queued ASCONF chunks
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (64 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 064/173] ext2: Fix link count corruption under heavy link+rename load Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 066/173] virtio: set pci bus master enable bit Willy Tarreau
                   ` (107 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Yuansong Qiao, Shuaijun Zhang, Vlad Yasevich, David S. Miller,
	maximilian attems, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vlad Yasevich <vladislav.yasevich@hp.com>

commit c0786693404cffd80ca3cb6e75ee7b35186b2825 upstream.

When we finish processing ASCONF_ACK chunk, we try to send
the next queued ASCONF.  This action runs the sctp state
machine recursively and it's not prepared to do so.

kernel BUG at kernel/timer.c:790!
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/module/ipv6/initstate
Modules linked in: sha256_generic sctp libcrc32c ipv6 dm_multipath
uinput 8139too i2c_piix4 8139cp mii i2c_core pcspkr virtio_net joydev
floppy virtio_blk virtio_pci [last unloaded: scsi_wait_scan]

Pid: 0, comm: swapper Not tainted 2.6.34-rc4 #15 /Bochs
EIP: 0060:[<c044a2ef>] EFLAGS: 00010286 CPU: 0
EIP is at add_timer+0xd/0x1b
EAX: cecbab14 EBX: 000000f0 ECX: c0957b1c EDX: 03595cf4
ESI: cecba800 EDI: cf276f00 EBP: c0957aa0 ESP: c0957aa0
 DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Process swapper (pid: 0, ti=c0956000 task=c0988ba0 task.ti=c0956000)
Stack:
 c0957ae0 d1851214 c0ab62e4 c0ab5f26 0500ffff 00000004 00000005 00000004
<0> 00000000 d18694fd 00000004 1666b892 cecba800 cecba800 c0957b14
00000004
<0> c0957b94 d1851b11 ceda8b00 cecba800 cf276f00 00000001 c0957b14
000000d0
Call Trace:
 [<d1851214>] ? sctp_side_effects+0x607/0xdfc [sctp]
 [<d1851b11>] ? sctp_do_sm+0x108/0x159 [sctp]
 [<d1863386>] ? sctp_pname+0x0/0x1d [sctp]
 [<d1861a56>] ? sctp_primitive_ASCONF+0x36/0x3b [sctp]
 [<d185657c>] ? sctp_process_asconf_ack+0x2a4/0x2d3 [sctp]
 [<d184e35c>] ? sctp_sf_do_asconf_ack+0x1dd/0x2b4 [sctp]
 [<d1851ac1>] ? sctp_do_sm+0xb8/0x159 [sctp]
 [<d1863334>] ? sctp_cname+0x0/0x52 [sctp]
 [<d1854377>] ? sctp_assoc_bh_rcv+0xac/0xe1 [sctp]
 [<d1858f0f>] ? sctp_inq_push+0x2d/0x30 [sctp]
 [<d186329d>] ? sctp_rcv+0x797/0x82e [sctp]

Tested-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Yuansong Qiao <ysqiao@research.ait.ie>
Signed-off-by: Shuaijun Zhang <szhang@research.ait.ie>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/net/sctp/command.h |    1 +
 net/sctp/sm_make_chunk.c   |   15 ---------------
 net/sctp/sm_sideeffect.c   |   26 ++++++++++++++++++++++++++
 net/sctp/sm_statefuns.c    |    8 +++++++-
 4 files changed, 34 insertions(+), 16 deletions(-)

Index: longterm-2.6.27/include/net/sctp/command.h
===================================================================
--- longterm-2.6.27.orig/include/net/sctp/command.h	2011-01-23 10:52:36.000000000 +0100
+++ longterm-2.6.27/include/net/sctp/command.h	2011-04-25 15:17:08.670279565 +0200
@@ -105,6 +105,7 @@
 	SCTP_CMD_ASSOC_SHKEY,    /* generate the association shared keys */
 	SCTP_CMD_T1_RETRAN,	 /* Mark for retransmission after T1 timeout  */
 	SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
+	SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
 	SCTP_CMD_LAST
 } sctp_verb_t;
 
Index: longterm-2.6.27/net/sctp/sm_make_chunk.c
===================================================================
--- longterm-2.6.27.orig/net/sctp/sm_make_chunk.c	2011-01-23 10:52:39.000000000 +0100
+++ longterm-2.6.27/net/sctp/sm_make_chunk.c	2011-04-25 15:16:30.299279806 +0200
@@ -3342,21 +3342,6 @@
 	sctp_chunk_free(asconf);
 	asoc->addip_last_asconf = NULL;
 
-	/* Send the next asconf chunk from the addip chunk queue. */
-	if (!list_empty(&asoc->addip_chunk_list)) {
-		struct list_head *entry = asoc->addip_chunk_list.next;
-		asconf = list_entry(entry, struct sctp_chunk, list);
-
-		list_del_init(entry);
-
-		/* Hold the chunk until an ASCONF_ACK is received. */
-		sctp_chunk_hold(asconf);
-		if (sctp_primitive_ASCONF(asoc, asconf))
-			sctp_chunk_free(asconf);
-		else
-			asoc->addip_last_asconf = asconf;
-	}
-
 	return retval;
 }
 
Index: longterm-2.6.27/net/sctp/sm_sideeffect.c
===================================================================
--- longterm-2.6.27.orig/net/sctp/sm_sideeffect.c	2011-02-09 22:45:33.000000000 +0100
+++ longterm-2.6.27/net/sctp/sm_sideeffect.c	2011-04-25 15:16:30.304279699 +0200
@@ -630,6 +630,29 @@
 	}
 }
 
+/* Sent the next ASCONF packet currently stored in the association.
+ * This happens after the ASCONF_ACK was succeffully processed.
+ */
+static void sctp_cmd_send_asconf(struct sctp_association *asoc)
+{
+	/* Send the next asconf chunk from the addip chunk
+	 * queue.
+	 */
+	if (!list_empty(&asoc->addip_chunk_list)) {
+		struct list_head *entry = asoc->addip_chunk_list.next;
+		struct sctp_chunk *asconf = list_entry(entry,
+						struct sctp_chunk, list);
+		list_del_init(entry);
+
+		/* Hold the chunk until an ASCONF_ACK is received. */
+		sctp_chunk_hold(asconf);
+		if (sctp_primitive_ASCONF(asoc, asconf))
+			sctp_chunk_free(asconf);
+		else
+			asoc->addip_last_asconf = asconf;
+	}
+}
+
 
 /* Helper function to update the heartbeat timer. */
 static void sctp_cmd_hb_timer_update(sctp_cmd_seq_t *cmds,
@@ -845,6 +868,9 @@
 			sctp_add_cmd_sf(cmds, SCTP_CMD_TIMER_STOP,
 					SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
 			break;
+		case SCTP_CMD_SEND_NEXT_ASCONF:
+			sctp_cmd_send_asconf(asoc);
+			break;
 		default:
 			break;
 		}
Index: longterm-2.6.27/net/sctp/sm_statefuns.c
===================================================================
--- longterm-2.6.27.orig/net/sctp/sm_statefuns.c	2011-01-23 10:52:39.000000000 +0100
+++ longterm-2.6.27/net/sctp/sm_statefuns.c	2011-04-25 15:16:30.312281199 +0200
@@ -3587,8 +3587,14 @@
 				SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
 
 		if (!sctp_process_asconf_ack((struct sctp_association *)asoc,
-					     asconf_ack))
+					     asconf_ack)) {
+			/* Successfully processed ASCONF_ACK.  We can
+			 * release the next asconf if we have one.
+			 */
+			sctp_add_cmd_sf(commands, SCTP_CMD_SEND_NEXT_ASCONF,
+					SCTP_NULL());
 			return SCTP_DISPOSITION_CONSUME;
+		}
 
 		abort = sctp_make_abort(asoc, asconf_ack,
 					sizeof(sctp_errhdr_t));



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 066/173] virtio: set pci bus master enable bit
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (65 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 065/173] sctp: Fix oops when sending queued ASCONF chunks Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 067/173] dccp: fix oops on Reset after close Willy Tarreau
                   ` (106 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Michael S. Tsirkin, maximilian attems, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Michael S. Tsirkin <mst@redhat.com>

commit bc505f373979692d51a86d40925f77a8b09d17b9 upstream.

As all virtio devices perform DMA, we
must enable bus mastering for them to be
spec compliant.

This patch fixes hotplug of virtio devices
with Linux guests and qemu 0.11-0.12.

Tested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: maximilian attems <max@stro.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/virtio/virtio_pci.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -647,6 +647,7 @@ static int __devinit virtio_pci_probe(st
 		goto out_req_regions;
 
 	pci_set_drvdata(pci_dev, vp_dev);
+	pci_set_master(pci_dev);
 
 	/* we use the subsystem vendor/device id as the virtio vendor/device
 	 * id.  this allows us to use the same PCI vendor/device id for all



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 067/173] dccp: fix oops on Reset after close
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (66 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 066/173] virtio: set pci bus master enable bit Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 068/173] r8169: disable ASPM Willy Tarreau
                   ` (105 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Gerrit Renker, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Gerrit Renker <gerrit@erg.abdn.ac.uk>

commit 720dc34bbbe9493c7bd48b2243058b4e447a929d upstream.

This fixes a bug in the order of dccp_rcv_state_process() that still permitted
reception even after closing the socket. A Reset after close thus causes a NULL
pointer dereference by not preventing operations on an already torn-down socket.

 dccp_v4_do_rcv()
	|
	| state other than OPEN
	v
 dccp_rcv_state_process()
	|
	| DCCP_PKT_RESET
	v
 dccp_rcv_reset()
	|
	v
 dccp_time_wait()

 WARNING: at net/ipv4/inet_timewait_sock.c:141 __inet_twsk_hashdance+0x48/0x128()
 Modules linked in: arc4 ecb carl9170 rt2870sta(C) mac80211 r8712u(C) crc_ccitt ah
 [<c0038850>] (unwind_backtrace+0x0/0xec) from [<c0055364>] (warn_slowpath_common)
 [<c0055364>] (warn_slowpath_common+0x4c/0x64) from [<c0055398>] (warn_slowpath_n)
 [<c0055398>] (warn_slowpath_null+0x1c/0x24) from [<c02b72d0>] (__inet_twsk_hashd)
 [<c02b72d0>] (__inet_twsk_hashdance+0x48/0x128) from [<c031caa0>] (dccp_time_wai)
 [<c031caa0>] (dccp_time_wait+0x40/0xc8) from [<c031c15c>] (dccp_rcv_state_proces)
 [<c031c15c>] (dccp_rcv_state_process+0x120/0x538) from [<c032609c>] (dccp_v4_do_)
 [<c032609c>] (dccp_v4_do_rcv+0x11c/0x14c) from [<c0286594>] (release_sock+0xac/0)
 [<c0286594>] (release_sock+0xac/0x110) from [<c031fd34>] (dccp_close+0x28c/0x380)
 [<c031fd34>] (dccp_close+0x28c/0x380) from [<c02d9a78>] (inet_release+0x64/0x70)

The fix is by testing the socket state first. Receiving a packet in Closed state
now also produces the required "No connection" Reset reply of RFC 4340, 8.3.1.

Reported-and-tested-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/dccp/input.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -616,6 +616,9 @@ int dccp_rcv_state_process(struct sock *
 		/* Caller (dccp_v4_do_rcv) will send Reset */
 		dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
 		return 1;
+	} else if (sk->sk_state == DCCP_CLOSED) {
+		dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
+		return 1;
 	}
 
 	if (sk->sk_state != DCCP_REQUESTING && sk->sk_state != DCCP_RESPOND) {
@@ -678,10 +681,6 @@ int dccp_rcv_state_process(struct sock *
 	}
 
 	switch (sk->sk_state) {
-	case DCCP_CLOSED:
-		dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION;
-		return 1;
-
 	case DCCP_REQUESTING:
 		queued = dccp_rcv_request_sent_state_process(sk, skb, dh, len);
 		if (queued >= 0)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 068/173] r8169: disable ASPM
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (67 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 067/173] dccp: fix oops on Reset after close Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 069/173] usb: iowarrior: dont trust report_size for buffer size Willy Tarreau
                   ` (104 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Stanislaw Gruszka, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit ba04c7c93bbcb48ce880cf75b6e9dffcd79d4c7b upstream.

For some time is known that ASPM is causing troubles on r8169, i.e. make
device randomly stop working without any errors in dmesg.

Currently Tomi Leppikangas reports that system with r8169 device hangs
with MCE errors when ASPM is enabled:
https://bugzilla.redhat.com/show_bug.cgi?id=642861#c4

Lets disable ASPM for r8169 devices at all, to avoid problems with
r8169 PCIe devices at least for some users.

Reported-by: Tomi Leppikangas <tomi.leppikangas@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/r8169.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -23,6 +23,7 @@
 #include <linux/tcp.h>
 #include <linux/init.h>
 #include <linux/dma-mapping.h>
+#include <linux/pci-aspm.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -3030,6 +3031,11 @@ rtl8169_init_one(struct pci_dev *pdev, c
 	mii->reg_num_mask = 0x1f;
 	mii->supports_gmii = !!(cfg->features & RTL_FEATURE_GMII);
 
+	/* disable ASPM completely as that cause random device stop working
+	 * problems as well as full system hangs for some PCIe devices users */
+	pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+				     PCIE_LINK_STATE_CLKPM);
+
 	/* enable device (incl. PCI PM wakeup and hotplug setup) */
 	rc = pci_enable_device(pdev);
 	if (rc < 0) {



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 069/173] usb: iowarrior: dont trust report_size for buffer size
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (68 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 068/173] r8169: disable ASPM Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 070/173] [S390] keyboard: integer underflow bug Willy Tarreau
                   ` (103 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Kees Cook, Greg Kroah-Hartman, Brandon Philips

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kees Cook <kees.cook@canonical.com>

commit 3ed780117dbe5acb64280d218f0347f238dafed0 upstream.

If the iowarrior devices in this case statement support more than 8 bytes
per report, it is possible to write past the end of a kernel heap allocation.
This will probably never be possible, but change the allocation to be more
defensive anyway.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Brandon Philips <bphilips@suse.de>


---
 drivers/usb/misc/iowarrior.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -373,7 +373,7 @@ static ssize_t iowarrior_write(struct fi
 	case USB_DEVICE_ID_CODEMERCS_IOWPV2:
 	case USB_DEVICE_ID_CODEMERCS_IOW40:
 		/* IOW24 and IOW40 use a synchronous call */
-		buf = kmalloc(8, GFP_KERNEL);	/* 8 bytes are enough for both products */
+		buf = kmalloc(count, GFP_KERNEL);
 		if (!buf) {
 			retval = -ENOMEM;
 			goto exit;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 070/173] [S390] keyboard: integer underflow bug
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (69 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 069/173] usb: iowarrior: dont trust report_size for buffer size Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 071/173] mm: fix possible cause of a page_mapped BUG Willy Tarreau
                   ` (102 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Carpenter, Martin Schwidefsky, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Carpenter <error27@gmail.com>

commit b652277b09d3d030cb074cc6a98ba80b34244c03 upstream.

The "ct" variable should be an unsigned int.  Both struct kbdiacrs
->kb_cnt and struct kbd_data ->accent_table_size are unsigned ints.

Making it signed causes a problem in KBDIACRUC because the user could
set the signed bit and cause a buffer overflow.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/s390/char/keyboard.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -462,7 +462,8 @@ kbd_ioctl(struct kbd_data *kbd, struct f
 	  unsigned int cmd, unsigned long arg)
 {
 	void __user *argp;
-	int ct, perm;
+	unsigned int ct;
+	int perm;
 
 	argp = (void __user *)arg;
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 071/173] mm: fix possible cause of a page_mapped BUG
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (70 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 070/173] [S390] keyboard: integer underflow bug Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 072/173] powerpc/kdump: CPUs assume the context of the oopsing CPU Willy Tarreau
                   ` (101 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Hugh Dickins, Linus Torvalds, Kerin Millar, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Hugh Dickins <hughd@google.com>

commit a3e8cc643d22d2c8ed36b9be7d9c9ca21efcf7f7 upstream.

Robert Swiecki reported a BUG_ON(page_mapped) from a fuzzer, punching
a hole with madvise(,, MADV_REMOVE).  That path is under mutex, and
cannot be explained by lack of serialization in unmap_mapping_range().

Reviewing the code, I found one place where vm_truncate_count handling
should have been updated, when I switched at the last minute from one
way of managing the restart_addr to another: mremap move changes the
virtual addresses, so it ought to adjust the restart_addr.

But rather than exporting the notion of restart_addr from memory.c, or
converting to restart_pgoff throughout, simply reset vm_truncate_count
to 0 to force a rescan if mremap move races with preempted truncation.

We have no confirmation that this fixes Robert's BUG,
but it is a fix that's worth making anyway.

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Kerin Millar <kerframil@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 mm/mremap.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--- a/mm/mremap.c
+++ b/mm/mremap.c
@@ -92,9 +92,7 @@ static void move_ptes(struct vm_area_str
 		 */
 		mapping = vma->vm_file->f_mapping;
 		spin_lock(&mapping->i_mmap_lock);
-		if (new_vma->vm_truncate_count &&
-		    new_vma->vm_truncate_count != vma->vm_truncate_count)
-			new_vma->vm_truncate_count = 0;
+		new_vma->vm_truncate_count = 0;
 	}
 
 	/*



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 072/173] powerpc/kdump: CPUs assume the context of the oopsing CPU
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (71 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 071/173] mm: fix possible cause of a page_mapped BUG Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 073/173] powerpc/kdump: Use chip->shutdown to disable IRQs Willy Tarreau
                   ` (100 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Anton Blanchard, Benjamin Herrenschmidt, Kamalesh babulal,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Anton Blanchard <anton@samba.org>

commit 0644079410065567e3bb31fcb8e6441f2b7685a9 upstream.

We wrap the crash_shutdown_handles[] calls with longjmp/setjmp, so if any
of them fault we can recover. The problem is we add a hook to the debugger
fault handler hook which calls longjmp unconditionally.

This first part of kdump is run before we marshall the other CPUs, so there
is a very good chance some CPU on the box is going to page fault. And when
it does it hits the longjmp code and assumes the context of the oopsing CPU.
The machine gets very confused when it has 10 CPUs all with the same stack,
all thinking they have the same CPU id. I get even more confused trying
to debug it.

The patch below adds crash_shutdown_cpu and uses it to specify which cpu is
in the protected region. Since it can only be -1 or the oopsing CPU, we don't
need to use memory barriers since it is only valid on the local CPU - no other
CPU will ever see a value that matches it's local CPU id.

Eventually we should switch the order and marshall all CPUs before doing the
crash_shutdown_handles[] calls, but that is a bigger fix.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kamalesh babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/crash.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -347,10 +347,12 @@ int crash_shutdown_unregister(crash_shut
 EXPORT_SYMBOL(crash_shutdown_unregister);
 
 static unsigned long crash_shutdown_buf[JMP_BUF_LEN];
+static int crash_shutdown_cpu = -1;
 
 static int handle_fault(struct pt_regs *regs)
 {
-	longjmp(crash_shutdown_buf, 1);
+	if (crash_shutdown_cpu == smp_processor_id())
+		longjmp(crash_shutdown_buf, 1);
 	return 0;
 }
 
@@ -388,6 +390,7 @@ void default_machine_crash_shutdown(stru
 	 */
 	old_handler = __debugger_fault_handler;
 	__debugger_fault_handler = handle_fault;
+	crash_shutdown_cpu = smp_processor_id();
 	for (i = 0; crash_shutdown_handles[i]; i++) {
 		if (setjmp(crash_shutdown_buf) == 0) {
 			/*
@@ -401,6 +404,7 @@ void default_machine_crash_shutdown(stru
 			asm volatile("sync; isync");
 		}
 	}
+	crash_shutdown_cpu = -1;
 	__debugger_fault_handler = old_handler;
 
 	/*



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 073/173] powerpc/kdump: Use chip->shutdown to disable IRQs
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (72 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 072/173] powerpc/kdump: CPUs assume the context of the oopsing CPU Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 074/173] powerpc: Use more accurate limit for first segment memory allocations Willy Tarreau
                   ` (99 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Anton Blanchard, Benjamin Herrenschmidt, Kamalesh babulal,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Anton Blanchard <anton@samba.org>

commit 5d7a87217de48b234b3c8ff8a73059947d822e07 upstream.

I saw this in a kdump kernel:

IOMMU table initialized, virtual merging enabled
Interrupt 155954 (real) is invalid, disabling it.
Interrupt 155953 (real) is invalid, disabling it.

ie we took some spurious interrupts. default_machine_crash_shutdown tries
to disable all interrupt sources but uses chip->disable which maps to
the default action of:

static void default_disable(unsigned int irq)
{
}

If we use chip->shutdown, then we actually mask the IRQ:

static void default_shutdown(unsigned int irq)
{
        struct irq_desc *desc = irq_to_desc(irq);

        desc->chip->mask(irq);
        desc->status |= IRQ_MASKED;
}

Not sure why we don't implement a ->disable action for xics.c, or why
default_disable doesn't mask the interrupt.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/crash.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -381,7 +381,7 @@ void default_machine_crash_shutdown(stru
 			desc->chip->eoi(i);
 
 		if (!(desc->status & IRQ_DISABLED))
-			desc->chip->disable(i);
+			desc->chip->shutdown(i);
 	}
 
 	/*



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 074/173] powerpc: Use more accurate limit for first segment memory allocations
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (73 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 073/173] powerpc/kdump: Use chip->shutdown to disable IRQs Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 075/173] powerpc/pseries: Add hcall to read 4 ptes at a time in real mode Willy Tarreau
                   ` (98 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Milton Miller, Anton Blanchard, Benjamin Herrenschmidt,
	Kamalesh Babulal, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Anton Blanchard <anton@samba.org>

commit 095c7965f4dc870ed2b65143b1e2610de653416c upstream.

Author: Milton Miller <miltonm@bga.com>

On large machines we are running out of room below 256MB. In some cases we
only need to ensure the allocation is in the first segment, which may be
256MB or 1TB.

Add slb0_limit and use it to specify the upper limit for the irqstack and
emergency stacks.

On a large ppc64 box, this fixes a panic at boot when the crashkernel=
option is specified (previously we would run out of memory below 256MB).

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/setup_64.c |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -432,9 +432,18 @@ void __init setup_system(void)
 	DBG(" <- setup_system()\n");
 }
 
+static u64 slb0_limit(void)
+{
+	if (cpu_has_feature(CPU_FTR_1T_SEGMENT)) {
+		return 1UL << SID_SHIFT_1T;
+	}
+	return 1UL << SID_SHIFT;
+}
+
 #ifdef CONFIG_IRQSTACKS
 static void __init irqstack_early_init(void)
 {
+	u64 limit = slb0_limit();
 	unsigned int i;
 
 	/*
@@ -444,10 +453,10 @@ static void __init irqstack_early_init(v
 	for_each_possible_cpu(i) {
 		softirq_ctx[i] = (struct thread_info *)
 			__va(lmb_alloc_base(THREAD_SIZE,
-					    THREAD_SIZE, 0x10000000));
+					    THREAD_SIZE, limit));
 		hardirq_ctx[i] = (struct thread_info *)
 			__va(lmb_alloc_base(THREAD_SIZE,
-					    THREAD_SIZE, 0x10000000));
+					    THREAD_SIZE, limit));
 	}
 }
 #else
@@ -478,7 +487,7 @@ static void __init exc_lvl_early_init(vo
  */
 static void __init emergency_stack_init(void)
 {
-	unsigned long limit;
+	u64 limit;
 	unsigned int i;
 
 	/*
@@ -490,7 +499,7 @@ static void __init emergency_stack_init(
 	 * bringup, we need to get at them in real mode. This means they
 	 * must also be within the RMO region.
 	 */
-	limit = min(0x10000000UL, lmb.rmo_size);
+	limit = min(slb0_limit(), lmb.rmo_size);
 
 	for_each_possible_cpu(i) {
 		unsigned long sp;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 075/173] powerpc/pseries: Add hcall to read 4 ptes at a time in real mode
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (74 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 074/173] powerpc: Use more accurate limit for first segment memory allocations Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 076/173] powerpc/kexec: Speedup kexec hash PTE tear down Willy Tarreau
                   ` (97 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Michael Neuling, Benjamin Herrenschmidt, Kamalesh babulal,
	Anton Blanchard, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Michael Neuling <mikey@neuling.org>

commit f90ece28c1f5b3ec13fe481406857fe92f4bc7d1 upstream.

This adds plpar_pte_read_4_raw() which can be used read 4 PTEs from
PHYP at a time, while in real mode.

It also creates a new hcall9 which can be used in real mode.  It's the
same as plpar_hcall9 but minus the tracing hcall statistics which may
require variables outside the RMO.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh babulal <kamalesh@linux.vnet.ibm.com>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/include/asm/hvcall.h               |    1 
 arch/powerpc/platforms/pseries/hvCall.S         |   38 ++++++++++++++++++++++++
 arch/powerpc/platforms/pseries/plpar_wrappers.h |   18 +++++++++++
 3 files changed, 57 insertions(+)

--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -268,6 +268,7 @@ long plpar_hcall_raw(unsigned long opcod
  */
 #define PLPAR_HCALL9_BUFSIZE 9
 long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...);
+long plpar_hcall9_raw(unsigned long opcode, unsigned long *retbuf, ...);
 
 /* For hcall instrumentation.  One structure per-hcall, per-CPU */
 struct hcall_stats {
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -202,3 +202,41 @@ _GLOBAL(plpar_hcall9)
 	mtcrf	0xff,r0
 
 	blr				/* return r3 = status */
+
+/* See plpar_hcall_raw to see why this is needed */
+_GLOBAL(plpar_hcall9_raw)
+	HMT_MEDIUM
+
+	mfcr	r0
+	stw	r0,8(r1)
+
+	std     r4,STK_PARM(r4)(r1)     /* Save ret buffer */
+
+	mr	r4,r5
+	mr	r5,r6
+	mr	r6,r7
+	mr	r7,r8
+	mr	r8,r9
+	mr	r9,r10
+	ld	r10,STK_PARM(r11)(r1)	 /* put arg7 in R10 */
+	ld	r11,STK_PARM(r12)(r1)	 /* put arg8 in R11 */
+	ld	r12,STK_PARM(r13)(r1)    /* put arg9 in R12 */
+
+	HVSC				/* invoke the hypervisor */
+
+	mr	r0,r12
+	ld	r12,STK_PARM(r4)(r1)
+	std	r4,  0(r12)
+	std	r5,  8(r12)
+	std	r6, 16(r12)
+	std	r7, 24(r12)
+	std	r8, 32(r12)
+	std	r9, 40(r12)
+	std	r10,48(r12)
+	std	r11,56(r12)
+	std	r0, 64(r12)
+
+	lwz	r0,8(r1)
+	mtcrf	0xff,r0
+
+	blr				/* return r3 = status */
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -169,6 +169,24 @@ static inline long plpar_pte_read_raw(un
 	return rc;
 }
 
+/*
+ * plpar_pte_read_4_raw can be called in real mode.
+ * ptes must be 8*sizeof(unsigned long)
+ */
+static inline long plpar_pte_read_4_raw(unsigned long flags, unsigned long ptex,
+					unsigned long *ptes)
+
+{
+	long rc;
+	unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
+
+	rc = plpar_hcall9_raw(H_READ, retbuf, flags | H_READ_4, ptex);
+
+	memcpy(ptes, retbuf, 8*sizeof(unsigned long));
+
+	return rc;
+}
+
 static inline long plpar_pte_protect(unsigned long flags, unsigned long ptex,
 		unsigned long avpn)
 {



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 076/173] powerpc/kexec: Speedup kexec hash PTE tear down
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (75 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 075/173] powerpc/pseries: Add hcall to read 4 ptes at a time in real mode Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 077/173] powerpc/crashdump: Do not fail on NULL pointer dereferencing Willy Tarreau
                   ` (96 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Michael Neuling, Benjamin Herrenschmidt, Kamalesh babulal,
	Anton Blanchard, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Michael Neuling <mikey@neuling.org>

commit d504bed676caad29a3dba3d3727298c560628f5c upstream.

Currently for kexec the PTE tear down on 1TB segment systems normally
requires 3 hcalls for each PTE removal. On a machine with 32GB of
memory it can take around a minute to remove all the PTEs.

This optimises the path so that we only remove PTEs that are valid.
It also uses the read 4 PTEs at once HCALL.  For the common case where
a PTEs is invalid in a 1TB segment, this turns the 3 HCALLs per PTE
down to 1 HCALL per 4 PTEs.

This gives an > 10x speedup in kexec times on PHYP, taking a 32GB
machine from around 1 minute down to a few seconds.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh babulal <kamalesh@linux.vnet.ibm.com>
cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/platforms/pseries/lpar.c |   33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -366,21 +366,28 @@ static void pSeries_lpar_hptab_clear(voi
 {
 	unsigned long size_bytes = 1UL << ppc64_pft_size;
 	unsigned long hpte_count = size_bytes >> 4;
-	unsigned long dummy1, dummy2, dword0;
+	struct {
+		unsigned long pteh;
+		unsigned long ptel;
+	} ptes[4];
 	long lpar_rc;
-	int i;
+	int i, j;
 
-	/* TODO: Use bulk call */
-	for (i = 0; i < hpte_count; i++) {
-		/* dont remove HPTEs with VRMA mappings */
-		lpar_rc = plpar_pte_remove_raw(H_ANDCOND, i, HPTE_V_1TB_SEG,
-						&dummy1, &dummy2);
-		if (lpar_rc == H_NOT_FOUND) {
-			lpar_rc = plpar_pte_read_raw(0, i, &dword0, &dummy1);
-			if (!lpar_rc && ((dword0 & HPTE_V_VRMA_MASK)
-				!= HPTE_V_VRMA_MASK))
-				/* Can be hpte for 1TB Seg. So remove it */
-				plpar_pte_remove_raw(0, i, 0, &dummy1, &dummy2);
+	/* Read in batches of 4,
+	 * invalidate only valid entries not in the VRMA
+	 * hpte_count will be a multiple of 4
+         */
+	for (i = 0; i < hpte_count; i += 4) {
+		lpar_rc = plpar_pte_read_4_raw(0, i, (void *)ptes);
+		if (lpar_rc != H_SUCCESS)
+			continue;
+		for (j = 0; j < 4; j++){
+			if ((ptes[j].pteh & HPTE_V_VRMA_MASK) ==
+				HPTE_V_VRMA_MASK)
+				continue;
+			if (ptes[j].pteh & HPTE_V_VALID)
+				plpar_pte_remove_raw(0, i + j, 0,
+					&(ptes[j].pteh), &(ptes[j].ptel));
 		}
 	}
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 077/173] powerpc/crashdump: Do not fail on NULL pointer dereferencing
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (76 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 076/173] powerpc/kexec: Speedup kexec hash PTE tear down Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 078/173] powerpc/kexec: Fix orphaned offline CPUs across kexec Willy Tarreau
                   ` (95 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Maxim Uvarov, Benjamin Herrenschmidt, Kamalesh babulal,
	Anton Blanchard, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Maxim Uvarov <muvarov@gmail.com>

commit 426b6cb478e60352a463a0d1ec75c1c9fab30b13 upstream.

Signed-off-by: Maxim Uvarov <muvarov@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh babulal <kamalesh@linux.vnet.ibm.com>
cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/crash.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -377,6 +377,9 @@ void default_machine_crash_shutdown(stru
 	for_each_irq(i) {
 		struct irq_desc *desc = irq_desc + i;
 
+		if (!desc || !desc->chip || !desc->chip->eoi)
+			continue;
+
 		if (desc->status & IRQ_INPROGRESS)
 			desc->chip->eoi(i);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 078/173] powerpc/kexec: Fix orphaned offline CPUs across kexec
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (77 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 077/173] powerpc/crashdump: Do not fail on NULL pointer dereferencing Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 079/173] hwmon/f71882fg: Set platform drvdata to NULL later Willy Tarreau
                   ` (94 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: greg, benh, anton, Matt Evans, Kamalesh babulal,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Matt Evans <matt@ozlabs.org>

Commit: e8e5c2155b0035b6e04f29be67f6444bc914005b upstream

When CPU hotplug is used, some CPUs may be offline at the time a kexec is
performed.  The subsequent kernel may expect these CPUs to be already running,
and will declare them stuck.  On pseries, there's also a soft-offline (cede)
state that CPUs may be in; this can also cause problems as the kexeced kernel
may ask RTAS if they're online -- and RTAS would say they are.  The CPU will
either appear stuck, or will cause a crash as we replace its cede loop beneath
it.

This patch kicks each present offline CPU awake before the kexec, so that
none are forever lost to these assumptions in the subsequent kernel.

Now, the behaviour is that all available CPUs that were offlined are now
online & usable after the kexec.  This mimics the behaviour of a full reboot
(on which all CPUs will be restarted).

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh babulal <kamalesh@linux.vnet.ibm.com>
cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/powerpc/kernel/machine_kexec_64.c |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -15,6 +15,7 @@
 #include <linux/thread_info.h>
 #include <linux/init_task.h>
 #include <linux/errno.h>
+#include <linux/cpu.h>
 
 #include <asm/page.h>
 #include <asm/current.h>
@@ -169,10 +170,34 @@ static void kexec_smp_down(void *arg)
 	/* NOTREACHED */
 }
 
+/*
+ * We need to make sure each present CPU is online.  The next kernel will scan
+ * the device tree and assume primary threads are online and query secondary
+ * threads via RTAS to online them if required.  If we don't online primary
+ * threads, they will be stuck.  However, we also online secondary threads as we
+ * may be using 'cede offline'.  In this case RTAS doesn't see the secondary
+ * threads as offline -- and again, these CPUs will be stuck.
+ *
+ * So, we online all CPUs that should be running, including secondary threads.
+ */
+static void wake_offline_cpus(void)
+{
+	int cpu = 0;
+
+	for_each_present_cpu(cpu) {
+		if (!cpu_online(cpu)) {
+			printk(KERN_INFO "kexec: Waking offline cpu %d.\n",
+					cpu);
+			cpu_up(cpu);
+		}
+	}
+}
+
 static void kexec_prepare_cpus(void)
 {
 	int my_cpu, i, notified=-1;
 
+	wake_offline_cpus();
 	smp_call_function(kexec_smp_down, NULL, /* wait */0);
 	my_cpu = get_cpu();
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 079/173] hwmon/f71882fg: Set platform drvdata to NULL later
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (78 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 078/173] powerpc/kexec: Fix orphaned offline CPUs across kexec Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 080/173] libata: no special completion processing for EH commands Willy Tarreau
                   ` (93 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Hans de Goede, Jean Delvare, Guenter Roeck, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Hans de Goede <hdegoede@redhat.com>

commit d9ebaa45472c92704f4814682eec21455edcfa1f upstream.

This avoids a possible race leading to trying to dereference NULL.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/hwmon/f71882fg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: longterm-2.6.27/drivers/hwmon/f71882fg.c
===================================================================
--- longterm-2.6.27.orig/drivers/hwmon/f71882fg.c	2011-01-23 10:52:16.000000000 +0100
+++ longterm-2.6.27/drivers/hwmon/f71882fg.c	2011-04-25 15:34:40.461278503 +0200
@@ -808,7 +808,6 @@
 	int i;
 	struct f71882fg_data *data = platform_get_drvdata(pdev);
 
-	platform_set_drvdata(pdev, NULL);
 	hwmon_device_unregister(data->hwmon_dev);
 
 	for (i = 0; i < ARRAY_SIZE(f71882fg_dev_attr); i++)
@@ -821,6 +820,7 @@
 	for (i = 0; i < ARRAY_SIZE(f71882fg_fan_attr); i++)
 		device_remove_file(&pdev->dev, &f71882fg_fan_attr[i].dev_attr);
 
+	platform_set_drvdata(pdev, NULL);
 	kfree(data);
 
 	return 0;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 080/173] libata: no special completion processing for EH commands
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (79 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 079/173] hwmon/f71882fg: Set platform drvdata to NULL later Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 081/173] x86: Fix panic when handling "mem={invalid}" param Willy Tarreau
                   ` (92 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Tejun Heo, Jeff Garzik, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Tejun Heo <tj@kernel.org>

commit f08dc1ac6b15c681f4643d8da1700e06c3855608 upstream.

ata_qc_complete() contains special handling for certain commands.  For
example, it schedules EH for device revalidation after certain
configurations are changed.  These shouldn't be applied to EH
commands but they were.

In most cases, it doesn't cause an actual problem because EH doesn't
issue any command which would trigger special handling; however, ACPI
can issue such commands via _GTF which can cause weird interactions.

Restructure ata_qc_complete() such that EH commands are always passed
on to __ata_qc_complete().

stable: Please apply to -stable only after 2.6.38 is released.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/ata/libata-core.c |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5016,9 +5016,6 @@ static void ata_verify_xfer(struct ata_q
 {
 	struct ata_device *dev = qc->dev;
 
-	if (ata_tag_internal(qc->tag))
-		return;
-
 	if (ata_is_nodata(qc->tf.protocol))
 		return;
 
@@ -5062,14 +5059,23 @@ void ata_qc_complete(struct ata_queued_c
 		if (unlikely(qc->err_mask))
 			qc->flags |= ATA_QCFLAG_FAILED;
 
-		if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {
-			/* always fill result TF for failed qc */
+		/*
+		 * Finish internal commands without any further processing
+		 * and always with the result TF filled.
+		 */
+		if (unlikely(ata_tag_internal(qc->tag))) {
 			fill_result_tf(qc);
+			__ata_qc_complete(qc);
+			return;
+		}
 
-			if (!ata_tag_internal(qc->tag))
-				ata_qc_schedule_eh(qc);
-			else
-				__ata_qc_complete(qc);
+		/*
+		 * Non-internal qc has failed.  Fill the result TF and
+		 * summon EH.
+		 */
+		if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {
+			fill_result_tf(qc);
+			ata_qc_schedule_eh(qc);
 			return;
 		}
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 081/173] x86: Fix panic when handling "mem={invalid}" param
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (80 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 080/173] libata: no special completion processing for EH commands Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 082/173] ahci: add device IDs for Ibex Peak ahci controllers Willy Tarreau
                   ` (91 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Kamal Mostafa, Yinghai Lu, Len Brown, Rafael J. Wysocki,
	Ingo Molnar, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kamal Mostafa <kamal@canonical.com>

commit 77eed821accf5dd962b1f13bed0680e217e49112 upstream.

Avoid removing all of memory and panicing when "mem={invalid}"
is specified, e.g. mem=blahblah, mem=0, or mem=nopentium (on
platforms other than x86_32).

Signed-off-by: Kamal Mostafa <kamal@canonical.com>
BugLink: http://bugs.launchpad.net/bugs/553464
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
LKML-Reference: <1296783486-23033-1-git-send-email-kamal@canonical.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/e820.c |    3 +++
 1 file changed, 3 insertions(+)

Index: longterm-2.6.27/arch/x86/kernel/e820.c
===================================================================
--- longterm-2.6.27.orig/arch/x86/kernel/e820.c	2011-01-23 10:52:13.265064331 +0100
+++ longterm-2.6.27/arch/x86/kernel/e820.c	2011-04-25 15:37:16.046278520 +0200
@@ -1189,6 +1189,9 @@
 
 	userdef = 1;
 	mem_size = memparse(p, &p);
+	/* don't remove all of memory when handling "mem={invalid}" param */
+	if (mem_size == 0)
+		return -EINVAL;
 	e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
 
 	return 0;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 082/173] ahci: add device IDs for Ibex Peak ahci controllers
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (81 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 081/173] x86: Fix panic when handling "mem={invalid}" param Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 083/173] ahci: AHCI and RAID mode SATA patch for Intel Cougar Point DeviceIDs Willy Tarreau
                   ` (90 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jaroslav Kysela, David Milburn, Jeff Garzik

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: David Milburn <dmilburn@redhat.com>

commit c1f57d9b9846e7366c328f916d1a82d03ba4312c upstream.

Add device IDS for Ibex Peak SATA AHCI Controllers

Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
Signed-off-by: David Milburn <dmilburn@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 336eb1e..958c1fa 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -515,10 +515,14 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */
 	{ PCI_VDEVICE(INTEL, 0x3a22), board_ahci }, /* ICH10 */
 	{ PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */
+	{ PCI_VDEVICE(INTEL, 0x3b22), board_ahci }, /* PCH AHCI */
+	{ PCI_VDEVICE(INTEL, 0x3b23), board_ahci }, /* PCH AHCI */
 	{ PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */
 	{ PCI_VDEVICE(INTEL, 0x3b25), board_ahci }, /* PCH RAID */
+	{ PCI_VDEVICE(INTEL, 0x3b29), board_ahci }, /* PCH AHCI */
 	{ PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */
 	{ PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH RAID */
+	{ PCI_VDEVICE(INTEL, 0x3b2f), board_ahci }, /* PCH AHCI */
 
 	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
 	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,



^ permalink raw reply related	[flat|nested] 192+ messages in thread

* [PATCH 083/173] ahci: AHCI and RAID mode SATA patch for Intel Cougar Point DeviceIDs
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (82 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 082/173] ahci: add device IDs for Ibex Peak ahci controllers Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 084/173] ahci: AHCI and RAID mode SATA patch for Intel Patsburg DeviceIDs Willy Tarreau
                   ` (89 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Seth Heasley, Jeff Garzik

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Seth Heasley <seth.heasley@intel.com>

commit 5623cab83ea61e0420f2064216d83eab067a24c6 upstream.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 705bd8b..89d66fa 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -589,6 +589,12 @@ static const struct pci_device_id ahci_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */
 	{ PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH RAID */
 	{ PCI_VDEVICE(INTEL, 0x3b2f), board_ahci }, /* PCH AHCI */
+	{ PCI_VDEVICE(INTEL, 0x1c02), board_ahci }, /* CPT AHCI */
+	{ PCI_VDEVICE(INTEL, 0x1c03), board_ahci }, /* CPT AHCI */
+	{ PCI_VDEVICE(INTEL, 0x1c04), board_ahci }, /* CPT RAID */
+	{ PCI_VDEVICE(INTEL, 0x1c05), board_ahci }, /* CPT RAID */
+	{ PCI_VDEVICE(INTEL, 0x1c06), board_ahci }, /* CPT RAID */
+	{ PCI_VDEVICE(INTEL, 0x1c07), board_ahci }, /* CPT RAID */
 
 	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
 	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,



^ permalink raw reply related	[flat|nested] 192+ messages in thread

* [PATCH 084/173] ahci: AHCI and RAID mode SATA patch for Intel Patsburg DeviceIDs
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (83 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 083/173] ahci: AHCI and RAID mode SATA patch for Intel Cougar Point DeviceIDs Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 085/173] ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs Willy Tarreau
                   ` (88 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Seth Heasley, Jeff Garzik, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Seth Heasley <seth.heasley@intel.com>

commit 992b3fb9b5391bc4de5b42bb810dc6dd583a6c4a upstream.

This patch adds the Intel Patsburg (PCH) SATA AHCI and RAID Controller
DeviceIDs.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/ata/ahci.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -576,6 +576,9 @@ static const struct pci_device_id ahci_p
 	{ PCI_VDEVICE(INTEL, 0x1c05), board_ahci }, /* CPT RAID */
 	{ PCI_VDEVICE(INTEL, 0x1c06), board_ahci }, /* CPT RAID */
 	{ PCI_VDEVICE(INTEL, 0x1c07), board_ahci }, /* CPT RAID */
+	{ PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
+	{ PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */
+	{ PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
 
 	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
 	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 085/173] ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (84 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 084/173] ahci: AHCI and RAID mode SATA patch for Intel Patsburg DeviceIDs Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 086/173] ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller Willy Tarreau
                   ` (87 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Seth Heasley, Jeff Garzik, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Seth Heasley <seth.heasley@intel.com>

commit a4a461a6df6c0481d5a3d61660ed97f5b539cf16 upstream.

This patch adds the AHCI-mode SATA DeviceID for the Intel DH89xxCC PCH.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/ata/ahci.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -579,6 +579,7 @@ static const struct pci_device_id ahci_p
 	{ PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
 	{ PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */
 	{ PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
+	{ PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */
 
 	/* JMicron 360/1/3/5/6, match class to avoid IDE function */
 	{ PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 086/173] ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (85 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 085/173] ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:03 ` [PATCH 087/173] RDMA/cma: Fix crash in request handlers Willy Tarreau
                   ` (86 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Seth Heasley, Jeff Garzik, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Seth Heasley <seth.heasley@intel.com>

commit 64a3903d0885879ba8706a8bcf71c5e3e7664db2 upstream.

This patch adds an updated SATA RAID DeviceID for the Intel Patsburg PCH.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/ata/ahci.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -579,6 +579,7 @@ static const struct pci_device_id ahci_p
 	{ PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */
 	{ PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */
 	{ PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */
+	{ PCI_VDEVICE(INTEL, 0x2826), board_ahci }, /* PBG RAID */
 	{ PCI_VDEVICE(INTEL, 0x2323), board_ahci }, /* DH89xxCC AHCI */
 
 	/* JMicron 360/1/3/5/6, match class to avoid IDE function */



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 087/173] RDMA/cma: Fix crash in request handlers
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (86 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 086/173] ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller Willy Tarreau
@ 2011-04-25 20:03 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 088/173] IB/cm: Bump reference count on cm_id before invoking callback Willy Tarreau
                   ` (85 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:03 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Sean Hefty, Doug Ledford, Roland Dreier, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Sean Hefty <sean.hefty@intel.com>

commit 25ae21a10112875763c18b385624df713a288a05 upstream.

Doug Ledford and Red Hat reported a crash when running the rdma_cm on
a real-time OS.  The crash has the following call trace:

    cm_process_work
       cma_req_handler
          cma_disable_callback
          rdma_create_id
             kzalloc
             init_completion
          cma_get_net_info
          cma_save_net_info
          cma_any_addr
             cma_zero_addr
          rdma_translate_ip
             rdma_copy_addr
          cma_acquire_dev
             rdma_addr_get_sgid
             ib_find_cached_gid
             cma_attach_to_dev
          ucma_event_handler
             kzalloc
             ib_copy_ah_attr_to_user
          cma_comp

[ preempted ]

    cma_write
        copy_from_user
        ucma_destroy_id
           copy_from_user
           _ucma_find_context
           ucma_put_ctx
           ucma_free_ctx
              rdma_destroy_id
                 cma_exch
                 cma_cancel_operation
                 rdma_node_get_transport

        rt_mutex_slowunlock
        bad_area_nosemaphore
        oops_enter

They were able to reproduce the crash multiple times with the
following details:

    Crash seems to always happen on the:
            mutex_unlock(&conn_id->handler_mutex);
    as conn_id looks to have been freed during this code path.

An examination of the code shows that a race exists in the request
handlers.  When a new connection request is received, the rdma_cm
allocates a new connection identifier.  This identifier has a single
reference count on it.  If a user calls rdma_destroy_id() from another
thread after receiving a callback, rdma_destroy_id will proceed to
destroy the id and free the associated memory.  However, the request
handlers may still be in the process of running.  When control returns
to the request handlers, they can attempt to access the newly created
identifiers.

Fix this by holding a reference on the newly created rdma_cm_id until
the request handler is through accessing it.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/infiniband/core/cma.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1138,6 +1138,11 @@ static int cma_req_handler(struct ib_cm_
 	cm_id->context = conn_id;
 	cm_id->cm_handler = cma_ib_handler;
 
+	/*
+	 * Protect against the user destroying conn_id from another thread
+	 * until we're done accessing it.
+	 */
+	atomic_inc(&conn_id->refcount);
 	ret = conn_id->id.event_handler(&conn_id->id, &event);
 	if (!ret) {
 		/*
@@ -1150,8 +1155,10 @@ static int cma_req_handler(struct ib_cm_
 			ib_send_cm_mra(cm_id, CMA_CM_MRA_SETTING, NULL, 0);
 		mutex_unlock(&lock);
 		mutex_unlock(&conn_id->handler_mutex);
+		cma_deref_id(conn_id);
 		goto out;
 	}
+	cma_deref_id(conn_id);
 
 	/* Destroy the CM ID by returning a non-zero value. */
 	conn_id->cm_id.ib = NULL;
@@ -1353,17 +1360,25 @@ static int iw_conn_req_handler(struct iw
 	event.param.conn.private_data_len = iw_event->private_data_len;
 	event.param.conn.initiator_depth = attr.max_qp_init_rd_atom;
 	event.param.conn.responder_resources = attr.max_qp_rd_atom;
+
+	/*
+	 * Protect against the user destroying conn_id from another thread
+	 * until we're done accessing it.
+	 */
+	atomic_inc(&conn_id->refcount);
 	ret = conn_id->id.event_handler(&conn_id->id, &event);
 	if (ret) {
 		/* User wants to destroy the CM ID */
 		conn_id->cm_id.iw = NULL;
 		cma_exch(conn_id, CMA_DESTROYING);
 		mutex_unlock(&conn_id->handler_mutex);
+		cma_deref_id(conn_id);
 		rdma_destroy_id(&conn_id->id);
 		goto out;
 	}
 
 	mutex_unlock(&conn_id->handler_mutex);
+	cma_deref_id(conn_id);
 
 out:
 	if (dev)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 088/173] IB/cm: Bump reference count on cm_id before invoking callback
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (87 preceding siblings ...)
  2011-04-25 20:03 ` [PATCH 087/173] RDMA/cma: Fix crash in request handlers Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 089/173] x86, quirk: Fix SB600 revision check Willy Tarreau
                   ` (84 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Sean Hefty, Doug Ledford, Roland Dreier, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Sean Hefty <sean.hefty@intel.com>

commit 29963437a48475036353b95ab142bf199adb909e upstream.

When processing a SIDR REQ, the ib_cm allocates a new cm_id.  The
refcount of the cm_id is initialized to 1.  However, cm_process_work
will decrement the refcount after invoking all callbacks.  The result
is that the cm_id will end up with refcount set to 0 by the end of the
sidr req handler.

If a user tries to destroy the cm_id, the destruction will proceed,
under the incorrect assumption that no other threads are referencing
the cm_id.  This can lead to a crash when the cm callback thread tries
to access the cm_id.

This problem was noticed as part of a larger investigation with kernel
crashes in the rdma_cm when running on a real time OS.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/infiniband/core/cm.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -2986,6 +2986,7 @@ static int cm_sidr_req_handler(struct cm
 		goto out; /* No match. */
 	}
 	atomic_inc(&cur_cm_id_priv->refcount);
+	atomic_inc(&cm_id_priv->refcount);
 	spin_unlock_irq(&cm.lock);
 
 	cm_id_priv->id.cm_handler = cur_cm_id_priv->id.cm_handler;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 089/173] x86, quirk: Fix SB600 revision check
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (88 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 088/173] IB/cm: Bump reference count on cm_id before invoking callback Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference Willy Tarreau
                   ` (83 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Andreas Herrmann, Andrew Morton, Ingo Molnar, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Andreas Herrmann <andreas.herrmann3@amd.com>

commit 1d3e09a304e6c4e004ca06356578b171e8735d3c upstream.

Commit 7f74f8f28a2bd9db9404f7d364e2097a0c42cc12
(x86 quirk: Fix polarity for IRQ0 pin2 override on SB800
systems) introduced a regression. It removed some SB600 specific
code to determine the revision ID without adapting a
corresponding revision ID check for SB600.

See this mail thread:

  http://marc.info/?l=linux-kernel&m=129980296006380&w=2

This patch adapts the corresponding check to cover all SB600
revisions.

Tested-by: Wang Lei <f3d27b@gmail.com>
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <20110315143137.GD29499@alberich.amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/early-quirks.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: longterm-2.6.27/arch/x86/kernel/early-quirks.c
===================================================================
--- longterm-2.6.27.orig/arch/x86/kernel/early-quirks.c	2011-01-23 10:52:13.000000000 +0100
+++ longterm-2.6.27/arch/x86/kernel/early-quirks.c	2011-04-25 15:45:17.351278162 +0200
@@ -163,7 +163,12 @@
 		return;
 
 	rev = ati_sbx00_rev(num, slot, func);
-	if (rev > 0x13)
+	/*
+	 * SB600: revisions 0x11, 0x12, 0x13, 0x14, ...
+	 * SB700: revisions 0x39, 0x3a, ...
+	 * SB800: revisions 0x40, 0x41, ...
+	 */
+	if (rev >= 0x39)
 		return;
 
 	/* check for IRQ0 interrupt swap */



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (89 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 089/173] x86, quirk: Fix SB600 revision check Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-26 10:07   ` Jiri Slaby
  2011-04-25 20:04 ` [PATCH 091/173] USB: serial: ch341: add new id Willy Tarreau
                   ` (82 subsequent siblings)
  173 siblings, 1 reply; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jiri Slaby, Alan Cox, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jiri Slaby <jslaby@suse.cz>

commit 6960f40a954619857e7095a6179eef896f297077 upstream.

Make sure that we check the return value of tty_port_tty_get.
Sometimes it may return NULL and we later dereference that.

The only place here is in kobil_read_int_callback, so fix it.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/kobil_sct.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -372,7 +372,7 @@ static void kobil_read_int_callback(stru
 	}
 
 	tty = port->port.tty;
-	if (urb->actual_length) {
+	if (tty && urb->actual_length) {
 
 		/* BEGIN DEBUG */
 		/*



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 091/173] USB: serial: ch341: add new id
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (90 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 092/173] PCI: add more checking to ICH region quirks Willy Tarreau
                   ` (81 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: wangyanqing <udknight@gmail.com>

commit d0781383038e983a63843a9a6a067ed781db89c1 upstream.

I picked up a new DAK-780EX(professional digitl reverb/mix system),
which use CH341T chipset to communication with computer on 3/2011
and the CH341T's vendor code is 1a86

Looking up the CH341T's vendor and product id's I see:

1a86  QinHeng Electronics
  5523  CH341 in serial mode, usb to serial port converter

CH341T,CH341 are the products of the same company, maybe
have some common hardware, and I test the ch341.c works
well with CH341T

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/serial/ch341.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -73,6 +73,7 @@ static int debug;
 static struct usb_device_id id_table [] = {
 	{ USB_DEVICE(0x4348, 0x5523) },
 	{ USB_DEVICE(0x1a86, 0x7523) },
+	{ USB_DEVICE(0x1a86, 0x5523) },
 	{ },
 };
 MODULE_DEVICE_TABLE(usb, id_table);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 092/173] PCI: add more checking to ICH region quirks
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (91 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 091/173] USB: serial: ch341: add new id Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 093/173] PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH Willy Tarreau
                   ` (80 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jiri Slaby, Bjorn Helgaas, David S. Miller, Thomas Renninger,
	Jesse Barnes, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jiri Slaby <jslaby@suse.cz>

commit cdb9755849fbaf2bb9c0a009ba5baa817a0f152d upstream.

Per ICH4 and ICH6 specs, ACPI and GPIO regions are valid iff ACPI_EN
and GPIO_EN bits are set to 1. Add checks for these bits into the
quirks prior to the region creation.

While at it, name the constants by macros.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/quirks.c |   49 +++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 39 insertions(+), 10 deletions(-)

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -506,6 +506,17 @@ static void __devinit quirk_piix4_acpi(s
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82371AB_3,	quirk_piix4_acpi);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82443MX_3,	quirk_piix4_acpi);
 
+#define ICH_PMBASE	0x40
+#define ICH_ACPI_CNTL	0x44
+#define  ICH4_ACPI_EN	0x10
+#define  ICH6_ACPI_EN	0x80
+#define ICH4_GPIOBASE	0x58
+#define ICH4_GPIO_CNTL	0x5c
+#define  ICH4_GPIO_EN	0x10
+#define ICH6_GPIOBASE	0x48
+#define ICH6_GPIO_CNTL	0x4c
+#define  ICH6_GPIO_EN	0x10
+
 /*
  * ICH4, ICH4-M, ICH5, ICH5-M ACPI: Three IO regions pointed to by longwords at
  *	0x40 (128 bytes of ACPI, GPIO & TCO registers)
@@ -514,12 +525,21 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
 static void __devinit quirk_ich4_lpc_acpi(struct pci_dev *dev)
 {
 	u32 region;
+	u8 enable;
 
-	pci_read_config_dword(dev, 0x40, &region);
-	quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH4 ACPI/GPIO/TCO");
-
-	pci_read_config_dword(dev, 0x58, &region);
-	quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH4 GPIO");
+	pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable);
+	if (enable & ICH4_ACPI_EN) {
+		pci_read_config_dword(dev, ICH_PMBASE, &region);
+		quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
+				"ICH4 ACPI/GPIO/TCO");
+	}
+
+	pci_read_config_byte(dev, ICH4_GPIO_CNTL, &enable);
+	if (enable & ICH4_GPIO_EN) {
+		pci_read_config_dword(dev, ICH4_GPIOBASE, &region);
+		quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES + 1,
+				"ICH4 GPIO");
+	}
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801AA_0,		quirk_ich4_lpc_acpi);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801AB_0,		quirk_ich4_lpc_acpi);
@@ -535,12 +555,21 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
 static void __devinit ich6_lpc_acpi_gpio(struct pci_dev *dev)
 {
 	u32 region;
+	u8 enable;
 
-	pci_read_config_dword(dev, 0x40, &region);
-	quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES, "ICH6 ACPI/GPIO/TCO");
-
-	pci_read_config_dword(dev, 0x48, &region);
-	quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1, "ICH6 GPIO");
+	pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable);
+	if (enable & ICH6_ACPI_EN) {
+		pci_read_config_dword(dev, ICH_PMBASE, &region);
+		quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
+				"ICH6 ACPI/GPIO/TCO");
+	}
+
+	pci_read_config_byte(dev, ICH6_GPIO_CNTL, &enable);
+	if (enable & ICH4_GPIO_EN) {
+		pci_read_config_dword(dev, ICH6_GPIOBASE, &region);
+		quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES + 1,
+				"ICH6 GPIO");
+	}
 }
 
 static void __devinit ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, const char *name, int dynsize)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 093/173] PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (92 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 092/173] PCI: add more checking to ICH region quirks Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 094/173] SUNRPC: Ensure we always run the tk_callback before tk_action Willy Tarreau
                   ` (79 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jiri Slaby, Bjorn Helgaas, David S. Miller, Thomas Renninger,
	Jesse Barnes, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jiri Slaby <jslaby@suse.cz>

commit 87e3dc3855430bd254370afc79f2ed92250f5b7c upstream.

Some broken BIOSes on ICH4 chipset report an ACPI region which is in
conflict with legacy IDE ports when ACPI is disabled. Even though the
regions overlap, IDE ports are working correctly (we cannot find out
the decoding rules on chipsets).

So the only problem is the reported region itself, if we don't reserve
the region in the quirk everything works as expected.

This patch avoids reserving any quirk regions below PCIBIOS_MIN_IO
which is 0x1000. Some regions might be (and are by a fast google
query) below this border, but the only difference is that they won't
be reserved anymore. They should still work though the same as before.

The conflicts look like (1f.0 is bridge, 1f.1 is IDE ctrl):
pci 0000:00:1f.1: address space collision: [io 0x0170-0x0177] conflicts with 0000:00:1f.0 [io  0x0100-0x017f]

At 0x0100 a 128 bytes long ACPI region is reported in the quirk for
ICH4. ata_piix then fails to find disks because the IDE legacy ports
are zeroed:
ata_piix 0000:00:1f.1: device not available (can't reserve [io 0x0000-0x0007])

References: https://bugzilla.novell.com/show_bug.cgi?id=558740
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Renninger <trenn@suse.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/quirks.c |   32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -527,18 +527,30 @@ static void __devinit quirk_ich4_lpc_acp
 	u32 region;
 	u8 enable;
 
+	/*
+	 * The check for PCIBIOS_MIN_IO is to ensure we won't create a conflict
+	 * with low legacy (and fixed) ports. We don't know the decoding
+	 * priority and can't tell whether the legacy device or the one created
+	 * here is really at that address.  This happens on boards with broken
+	 * BIOSes.
+	*/
+
 	pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable);
 	if (enable & ICH4_ACPI_EN) {
 		pci_read_config_dword(dev, ICH_PMBASE, &region);
-		quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
-				"ICH4 ACPI/GPIO/TCO");
+		region &= PCI_BASE_ADDRESS_IO_MASK;
+		if (region >= PCIBIOS_MIN_IO)
+			quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
+					"ICH4 ACPI/GPIO/TCO");
 	}
 
 	pci_read_config_byte(dev, ICH4_GPIO_CNTL, &enable);
 	if (enable & ICH4_GPIO_EN) {
 		pci_read_config_dword(dev, ICH4_GPIOBASE, &region);
-		quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES + 1,
-				"ICH4 GPIO");
+		region &= PCI_BASE_ADDRESS_IO_MASK;
+		if (region >= PCIBIOS_MIN_IO)
+			quirk_io_region(dev, region, 64,
+					PCI_BRIDGE_RESOURCES + 1, "ICH4 GPIO");
 	}
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,    PCI_DEVICE_ID_INTEL_82801AA_0,		quirk_ich4_lpc_acpi);
@@ -560,15 +572,19 @@ static void __devinit ich6_lpc_acpi_gpio
 	pci_read_config_byte(dev, ICH_ACPI_CNTL, &enable);
 	if (enable & ICH6_ACPI_EN) {
 		pci_read_config_dword(dev, ICH_PMBASE, &region);
-		quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
-				"ICH6 ACPI/GPIO/TCO");
+		region &= PCI_BASE_ADDRESS_IO_MASK;
+		if (region >= PCIBIOS_MIN_IO)
+			quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES,
+					"ICH6 ACPI/GPIO/TCO");
 	}
 
 	pci_read_config_byte(dev, ICH6_GPIO_CNTL, &enable);
 	if (enable & ICH4_GPIO_EN) {
 		pci_read_config_dword(dev, ICH6_GPIOBASE, &region);
-		quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES + 1,
-				"ICH6 GPIO");
+		region &= PCI_BASE_ADDRESS_IO_MASK;
+		if (region >= PCIBIOS_MIN_IO)
+			quirk_io_region(dev, region, 64,
+					PCI_BRIDGE_RESOURCES + 1, "ICH6 GPIO");
 	}
 }
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 094/173] SUNRPC: Ensure we always run the tk_callback before tk_action
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (93 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 093/173] PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 095/173] ext3: Always set dx_nodes fake_dirent explicitly Willy Tarreau
                   ` (78 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Trond Myklebust, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Trond Myklebust <Trond.Myklebust@netapp.com>

commit e020c6800c9621a77223bf2c1ff68180e41e8ebf upstream.

This fixes a race in which the task->tk_callback() puts the rpc_task
to sleep, setting a new callback. Under certain circumstances, the current
code may end up executing the task->tk_action before it gets round to the
callback.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/sunrpc/sched.c |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -627,14 +627,12 @@ static void __rpc_execute(struct rpc_tas
 			save_callback = task->tk_callback;
 			task->tk_callback = NULL;
 			save_callback(task);
-		}
-
-		/*
-		 * Perform the next FSM step.
-		 * tk_action may be NULL when the task has been killed
-		 * by someone else.
-		 */
-		if (!RPC_IS_QUEUED(task)) {
+		} else {
+			/*
+			 * Perform the next FSM step.
+			 * tk_action may be NULL when the task has been killed
+			 * by someone else.
+			 */
 			if (task->tk_action == NULL)
 				break;
 			task->tk_action(task);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 095/173] ext3: Always set dx_nodes fake_dirent explicitly.
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (94 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 094/173] SUNRPC: Ensure we always run the tk_callback before tk_action Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 096/173] x86: Flush TLB if PGD entry is changed in i386 PAE mode Willy Tarreau
                   ` (77 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Eric Sandeen, Jan Kara, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Eric Sandeen <sandeen@redhat.com>

commit d7433142b63d727b5a217c37b1a1468b116a9771 upstream.

(crossport of 1f7bebb9e911d870fa8f997ddff838e82b5715ea
by Andreas Schlick <schlick@lavabit.com>)

When ext3_dx_add_entry() has to split an index node, it has to ensure that
name_len of dx_node's fake_dirent is also zero, because otherwise e2fsck
won't recognise it as an intermediate htree node and consider the htree to
be corrupted.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ext3/namei.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -1550,8 +1550,8 @@ static int ext3_dx_add_entry(handle_t *h
 			goto cleanup;
 		node2 = (struct dx_node *)(bh2->b_data);
 		entries2 = node2->entries;
+		memset(&node2->fake, 0, sizeof(struct fake_dirent));
 		node2->fake.rec_len = ext3_rec_len_to_disk(sb->s_blocksize);
-		node2->fake.inode = 0;
 		BUFFER_TRACE(frame->bh, "get_write_access");
 		err = ext3_journal_get_write_access(handle, frame->bh);
 		if (err)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 096/173] x86: Flush TLB if PGD entry is changed in i386 PAE mode
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (95 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 095/173] ext3: Always set dx_nodes fake_dirent explicitly Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 097/173] isdn: avoid calling tty_ldisc_flush() in atomic context Willy Tarreau
                   ` (76 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Shaohua Li, Mallick Asit K, Linus Torvalds, Andrew Morton,
	linux-mm, Ingo Molnar, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Shaohua Li <shaohua.li@intel.com>

commit 4981d01eada5354d81c8929d5b2836829ba3df7b upstream.

According to intel CPU manual, every time PGD entry is changed in i386 PAE
mode, we need do a full TLB flush. Current code follows this and there is
comment for this too in the code.

But current code misses the multi-threaded case. A changed page table
might be used by several CPUs, every such CPU should flush TLB. Usually
this isn't a problem, because we prepopulate all PGD entries at process
fork. But when the process does munmap and follows new mmap, this issue
will be triggered.

When it happens, some CPUs keep doing page faults:

  http://marc.info/?l=linux-kernel&m=129915020508238&w=2

Reported-by: Yasunori Goto<y-goto@jp.fujitsu.com>
Tested-by: Yasunori Goto<y-goto@jp.fujitsu.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Shaohua Li<shaohua.li@intel.com>
Cc: Mallick Asit K <asit.k.mallick@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm <linux-mm@kvack.org>
LKML-Reference: <1300246649.2337.95.camel@sli10-conroe>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/include/asm/pgtable-3level.h |   11 +++--------
 arch/x86/mm/pgtable.c                 |    3 +--
 2 files changed, 4 insertions(+), 10 deletions(-)

Index: longterm-2.6.27/include/asm-x86/pgtable-3level.h
===================================================================
--- longterm-2.6.27.orig/include/asm-x86/pgtable-3level.h	2011-01-23 10:52:33.916066510 +0100
+++ longterm-2.6.27/include/asm-x86/pgtable-3level.h	2011-04-25 15:55:12.384279160 +0200
@@ -101,8 +101,6 @@
 
 static inline void pud_clear(pud_t *pudp)
 {
-	unsigned long pgd;
-
 	set_pud(pudp, __pud(0));
 
 	/*
@@ -111,13 +109,10 @@
 	 * section 8.1: in PAE mode we explicitly have to flush the
 	 * TLB via cr3 if the top-level pgd is changed...
 	 *
-	 * Make sure the pud entry we're updating is within the
-	 * current pgd to avoid unnecessary TLB flushes.
+	 * Currently all places where pud_clear() is called either have
+	 * flush_tlb_mm() followed or don't need TLB flush (x86_64 code or
+	 * pud_clear_bad()), so we don't need TLB flush here.
 	 */
-	pgd = read_cr3();
-	if (__pa(pudp) >= pgd && __pa(pudp) <
-	    (pgd + sizeof(pgd_t)*PTRS_PER_PGD))
-		write_cr3(pgd);
 }
 
 #define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_PFN_MASK))
Index: longterm-2.6.27/arch/x86/mm/pgtable.c
===================================================================
--- longterm-2.6.27.orig/arch/x86/mm/pgtable.c	2011-01-23 10:52:13.760064270 +0100
+++ longterm-2.6.27/arch/x86/mm/pgtable.c	2011-04-25 15:55:12.391278523 +0200
@@ -138,8 +138,7 @@
 	 * section 8.1: in PAE mode we explicitly have to flush the
 	 * TLB via cr3 if the top-level pgd is changed...
 	 */
-	if (mm == current->active_mm)
-		write_cr3(read_cr3());
+	flush_tlb_mm(mm);
 }
 #else  /* !CONFIG_X86_PAE */
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 097/173] isdn: avoid calling tty_ldisc_flush() in atomic context
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (96 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 096/173] x86: Flush TLB if PGD entry is changed in i386 PAE mode Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 098/173] [PARISC] fix per-cpu flag problem in the cpu affinity checkers Willy Tarreau
                   ` (75 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Tilman Schmidt, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Tilman Schmidt <tilman@imap.cc>

commit bc10f96757bd6ab3721510df8defa8f21c32f974 upstream.

Remove the call to tty_ldisc_flush() from the RESULT_NO_CARRIER
branch of isdn_tty_modem_result(), as already proposed in commit
00409bb045887ec5e7b9e351bc080c38ab6bfd33.
This avoids a "sleeping function called from invalid context" BUG
when the hardware driver calls the statcallb() callback with
command==ISDN_STAT_DHUP in atomic context, which in turn calls
isdn_tty_modem_result(RESULT_NO_CARRIER, ~), and from there,
tty_ldisc_flush() which may sleep.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/isdn/i4l/isdn_tty.c |    6 ------
 1 file changed, 6 deletions(-)

--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -2635,12 +2635,6 @@ isdn_tty_modem_result(int code, modem_in
 		if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) {
 			return;
 		}
-#ifdef CONFIG_ISDN_AUDIO
-		if ( !info->vonline )
-			tty_ldisc_flush(info->tty);
-#else
-		tty_ldisc_flush(info->tty);
-#endif
 		if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
 		    (!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
 		       (info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 098/173] [PARISC] fix per-cpu flag problem in the cpu affinity checkers
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (97 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 097/173] isdn: avoid calling tty_ldisc_flush() in atomic context Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 099/173] powerpc/kdump: Fix race in kdump shutdown Willy Tarreau
                   ` (74 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Thomas Gleixner, James Bottomley, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit 9804c9eaeacfe78651052c5ddff31099f60ef78c upstream.

The CHECK_IRQ_PER_CPU is wrong, it should be checking
irq_to_desc(irq)->status not just irq.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/parisc/kernel/irq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -117,7 +117,7 @@ int cpu_check_affinity(unsigned int irq,
 	int cpu_dest;
 
 	/* timer and ipi have to always be received on all CPUs */
-	if (CHECK_IRQ_PER_CPU(irq)) {
+	if (CHECK_IRQ_PER_CPU(irq_to_desc(irq)->status)) {
 		/* Bad linux design decision.  The mask has already
 		 * been set; we must reset it */
 		cpumask_setall(irq_desc[irq].affinity);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 099/173] powerpc/kdump: Fix race in kdump shutdown
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (98 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 098/173] [PARISC] fix per-cpu flag problem in the cpu affinity checkers Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 100/173] powerpc: rtas_flash needs to use rtas_data_buf Willy Tarreau
                   ` (73 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Michael Neuling, Benjamin Herrenschmidt, Kamalesh Babulal,
	Anton Blanchard, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Michael Neuling <mikey@neuling.org>

commit 60adec6226bbcf061d4c2d10944fced209d1847d upstream.

When we are crashing, the crashing/primary CPU IPIs the secondaries to
turn off IRQs, go into real mode and wait in kexec_wait.  While this
is happening, the primary tears down all the MMU maps.  Unfortunately
the primary doesn't check to make sure the secondaries have entered
real mode before doing this.

On PHYP machines, the secondaries can take a long time shutting down
the IRQ controller as RTAS calls are need.  These RTAS calls need to
be serialised which resilts in the secondaries contending in
lock_rtas() and hence taking a long time to shut down.

We've hit this on large POWER7 machines, where some secondaries are
still waiting in lock_rtas(), when the primary tears down the HPTEs.

This patch makes sure all secondaries are in real mode before the
primary tears down the MMU.  It uses the new kexec_state entry in the
paca.  It times out if the secondaries don't reach real mode after
10sec.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/crash.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -162,6 +162,32 @@ static void crash_kexec_prepare_cpus(int
 	/* Leave the IPI callback set */
 }
 
+/* wait for all the CPUs to hit real mode but timeout if they don't come in */
+static void crash_kexec_wait_realmode(int cpu)
+{
+	unsigned int msecs;
+	int i;
+
+	msecs = 10000;
+	for (i=0; i < NR_CPUS && msecs > 0; i++) {
+		if (i == cpu)
+			continue;
+
+		while (paca[i].kexec_state < KEXEC_STATE_REAL_MODE) {
+			barrier();
+			if (!cpu_possible(i)) {
+				break;
+			}
+			if (!cpu_online(i)) {
+				break;
+			}
+			msecs--;
+			mdelay(1);
+		}
+	}
+	mb();
+}
+
 /*
  * This function will be called by secondary cpus or by kexec cpu
  * if soft-reset is activated to stop some CPUs.
@@ -419,6 +445,7 @@ void default_machine_crash_shutdown(stru
 	crash_kexec_prepare_cpus(crashing_cpu);
 	cpu_set(crashing_cpu, cpus_in_crash);
 	crash_kexec_stop_spus();
+	crash_kexec_wait_realmode(crashing_cpu);
 	if (ppc_md.kexec_cpu_down)
 		ppc_md.kexec_cpu_down(1, 0);
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 100/173] powerpc: rtas_flash needs to use rtas_data_buf
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (99 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 099/173] powerpc/kdump: Fix race in kdump shutdown Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 101/173] x86, binutils, xen: Fix another wrong size directive Willy Tarreau
                   ` (72 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Milton Miller, Benjamin Herrenschmidt, Kamalesh Babulal,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Milton Miller <miltonm@us.ibm.com>

commit bd2b64a12bf55bec0d1b949e3dca3f8863409646 upstream.

When trying to flash a machine via the update_flash command, Anton received the
following error:

    Restarting system.
    FLASH: kernel bug...flash list header addr above 4GB

The code in question has a comment that the flash list should be in
the kernel data and therefore under 4GB:

        /* NOTE: the "first" block list is a global var with no data
         * blocks in the kernel data segment.  We do this because
         * we want to ensure this block_list addr is under 4GB.
         */

Unfortunately the Kconfig option is marked tristate which means the variable
may not be in the kernel data and could be above 4GB.

Instead of relying on the data segment being below 4GB, use the static
data buffer allocated by the kernel for use by rtas.  Since we don't
use the header struct directly anymore, convert it to a simple pointer.

Reported-By: Anton Blanchard <anton@samba.org>
Signed-Off-By: Milton Miller <miltonm@bga.com>
Tested-By: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/rtas_flash.c |   39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -93,12 +93,8 @@ struct flash_block_list {
 	struct flash_block_list *next;
 	struct flash_block blocks[FLASH_BLOCKS_PER_NODE];
 };
-struct flash_block_list_header { /* just the header of flash_block_list */
-	unsigned long num_blocks;
-	struct flash_block_list *next;
-};
 
-static struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
+static struct flash_block_list *rtas_firmware_flash_list;
 
 /* Use slab cache to guarantee 4k alignment */
 static struct kmem_cache *flash_block_cache = NULL;
@@ -107,13 +103,14 @@ static struct kmem_cache *flash_block_ca
 
 /* Local copy of the flash block list.
  * We only allow one open of the flash proc file and create this
- * list as we go.  This list will be put in the
- * rtas_firmware_flash_list var once it is fully read.
+ * list as we go.  The rtas_firmware_flash_list varable will be
+ * set once the data is fully read.
  *
  * For convenience as we build the list we use virtual addrs,
  * we do not fill in the version number, and the length field
  * is treated as the number of entries currently in the block
- * (i.e. not a byte count).  This is all fixed on release.
+ * (i.e. not a byte count).  This is all fixed when calling
+ * the flash routine.
  */
 
 /* Status int must be first member of struct */
@@ -200,16 +197,16 @@ static int rtas_flash_release(struct ino
 	if (uf->flist) {    
 		/* File was opened in write mode for a new flash attempt */
 		/* Clear saved list */
-		if (rtas_firmware_flash_list.next) {
-			free_flash_list(rtas_firmware_flash_list.next);
-			rtas_firmware_flash_list.next = NULL;
+		if (rtas_firmware_flash_list) {
+			free_flash_list(rtas_firmware_flash_list);
+			rtas_firmware_flash_list = NULL;
 		}
 
 		if (uf->status != FLASH_AUTH)  
 			uf->status = flash_list_valid(uf->flist);
 
 		if (uf->status == FLASH_IMG_READY) 
-			rtas_firmware_flash_list.next = uf->flist;
+			rtas_firmware_flash_list = uf->flist;
 		else
 			free_flash_list(uf->flist);
 
@@ -592,7 +589,7 @@ static void rtas_flash_firmware(int rebo
 	unsigned long rtas_block_list;
 	int i, status, update_token;
 
-	if (rtas_firmware_flash_list.next == NULL)
+	if (rtas_firmware_flash_list == NULL)
 		return;		/* nothing to do */
 
 	if (reboot_type != SYS_RESTART) {
@@ -609,20 +606,25 @@ static void rtas_flash_firmware(int rebo
 		return;
 	}
 
-	/* NOTE: the "first" block list is a global var with no data
-	 * blocks in the kernel data segment.  We do this because
-	 * we want to ensure this block_list addr is under 4GB.
+	/*
+	 * NOTE: the "first" block must be under 4GB, so we create
+	 * an entry with no data blocks in the reserved buffer in
+	 * the kernel data segment.
 	 */
-	rtas_firmware_flash_list.num_blocks = 0;
-	flist = (struct flash_block_list *)&rtas_firmware_flash_list;
+	spin_lock(&rtas_data_buf_lock);
+	flist = (struct flash_block_list *)&rtas_data_buf[0];
+	flist->num_blocks = 0;
+	flist->next = rtas_firmware_flash_list;
 	rtas_block_list = virt_to_abs(flist);
 	if (rtas_block_list >= 4UL*1024*1024*1024) {
 		printk(KERN_ALERT "FLASH: kernel bug...flash list header addr above 4GB\n");
+		spin_unlock(&rtas_data_buf_lock);
 		return;
 	}
 
 	printk(KERN_ALERT "FLASH: preparing saved firmware image for flash\n");
 	/* Update the block_list in place. */
+	rtas_firmware_flash_list = NULL; /* too hard to backout on error */
 	image_size = 0;
 	for (f = flist; f; f = next) {
 		/* Translate data addrs to absolute */
@@ -663,6 +665,7 @@ static void rtas_flash_firmware(int rebo
 		printk(KERN_ALERT "FLASH: unknown flash return code %d\n", status);
 		break;
 	}
+	spin_unlock(&rtas_data_buf_lock);
 }
 
 static void remove_flash_pde(struct proc_dir_entry *dp)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 101/173] x86, binutils, xen: Fix another wrong size directive
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (100 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 100/173] powerpc: rtas_flash needs to use rtas_data_buf Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 102/173] aio: wake all waiters when destroying ctx Willy Tarreau
                   ` (71 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Alexander van Heukelum, Jeremy Fitzhardinge, Jan Beulich, H.J. Lu,
	Linus Torvalds, Andrew Morton, H. Peter Anvin, Kees Cook,
	Ingo Molnar, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alexander van Heukelum <heukelum@fastmail.fm>

commit 371c394af27ab7d1e58a66bc19d9f1f3ac1f67b4 upstream.

The latest binutils (2.21.0.20110302/Ubuntu) breaks the build
yet another time, under CONFIG_XEN=y due to a .size directive that
refers to a slightly differently named (hence, to the now very
strict and unforgiving assembler, non-existent) symbol.

[ mingo:

   This unnecessary build breakage caused by new binutils
   version 2.21 gets escallated back several kernel releases spanning
   several years of Linux history, affecting over 130,000 upstream
   kernel commits (!), on CONFIG_XEN=y 64-bit kernels (i.e. essentially
   affecting all major Linux distro kernel configs).

   Git annotate tells us that this slight debug symbol code mismatch
   bug has been introduced in 2008 in commit 3d75e1b8:

     3d75e1b8        (Jeremy Fitzhardinge    2008-07-08 15:06:49 -0700 1231) ENTRY(xen_do_hypervisor_callback)   # do_hypervisor_callback(struct *pt_regs)

   The 'bug' is just a slight assymetry in ENTRY()/END()
   debug-symbols sequences, with lots of assembly code between the
   ENTRY() and the END():

     ENTRY(xen_do_hypervisor_callback)   # do_hypervisor_callback(struct *pt_regs)
       ...
     END(do_hypervisor_callback)

   Human reviewers almost never catch such small mismatches, and binutils
   never even warned about it either.

   This new binutils version thus breaks the Xen build on all upstream kernels
   since v2.6.27, out of the blue.

   This makes a straightforward Git bisection of all 64-bit Xen-enabled kernels
   impossible on such binutils, for a bisection window of over hundred
   thousand historic commits. (!)

   This is a major fail on the side of binutils and binutils needs to turn
   this show-stopper build failure into a warning ASAP. ]

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Jan Beulich <jbeulich@novell.com>
Cc: H.J. Lu <hjl.tools@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Kees Cook <kees.cook@canonical.com>
LKML-Reference: <1299877178-26063-1-git-send-email-heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/entry_64.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1303,7 +1303,7 @@ ENTRY(xen_do_hypervisor_callback)   # do
 	decl PER_CPU_VAR(irq_count)
 	jmp  error_exit
 	CFI_ENDPROC
-END(do_hypervisor_callback)
+END(xen_do_hypervisor_callback)
 
 /*
  * Hypervisor uses this for application faults while it executes.



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 102/173] aio: wake all waiters when destroying ctx
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (101 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 101/173] x86, binutils, xen: Fix another wrong size directive Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 103/173] shmem: let shared anonymous be nonlinear again Willy Tarreau
                   ` (70 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Roland Dreier, Andrew Morton, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Roland Dreier <roland@purestorage.com>

commit e91f90bb0bb10be9cc8efd09a3cf4ecffcad0db1 upstream.

The test program below will hang because io_getevents() uses
add_wait_queue_exclusive(), which means the wake_up() in io_destroy() only
wakes up one of the threads.  Fix this by using wake_up_all() in the aio
code paths where we want to make sure no one gets stuck.

	// t.c -- compile with gcc -lpthread -laio t.c

	#include <libaio.h>
	#include <pthread.h>
	#include <stdio.h>
	#include <unistd.h>

	static const int nthr = 2;

	void *getev(void *ctx)
	{
		struct io_event ev;
		io_getevents(ctx, 1, 1, &ev, NULL);
		printf("io_getevents returned\n");
		return NULL;
	}

	int main(int argc, char *argv[])
	{
		io_context_t ctx = 0;
		pthread_t thread[nthr];
		int i;

		io_setup(1024, &ctx);

		for (i = 0; i < nthr; ++i)
			pthread_create(&thread[i], NULL, getev, ctx);

		sleep(1);

		io_destroy(ctx);

		for (i = 0; i < nthr; ++i)
			pthread_join(thread[i], NULL);

		return 0;
	}

Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/aio.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/aio.c
+++ b/fs/aio.c
@@ -497,7 +497,7 @@ static inline void really_put_req(struct
 	ctx->reqs_active--;
 
 	if (unlikely(!ctx->reqs_active && ctx->dead))
-		wake_up(&ctx->wait);
+		wake_up_all(&ctx->wait);
 }
 
 static void aio_fput_routine(struct work_struct *data)
@@ -1219,7 +1219,7 @@ static void io_destroy(struct kioctx *io
 	 * by other CPUs at this point.  Right now, we rely on the
 	 * locking done by the above calls to ensure this consistency.
 	 */
-	wake_up(&ioctx->wait);
+	wake_up_all(&ioctx->wait);
 	put_ioctx(ioctx);	/* once for the lookup */
 }
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 103/173] shmem: let shared anonymous be nonlinear again
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (102 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 102/173] aio: wake all waiters when destroying ctx Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 104/173] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code Willy Tarreau
                   ` (69 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Hugh Dickins, Andrew Morton, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Hugh Dickins <hughd@google.com>

commit bee4c36a5cf5c9f63ce1d7372aa62045fbd16d47 upstream.

Up to 2.6.22, you could use remap_file_pages(2) on a tmpfs file or a
shared mapping of /dev/zero or a shared anonymous mapping.  In 2.6.23 we
disabled it by default, but set VM_CAN_NONLINEAR to enable it on safe
mappings.  We made sure to set it in shmem_mmap() for tmpfs files, but
missed it in shmem_zero_setup() for the others.  Fix that at last.

Reported-by: Kenny Simpson <theonetruekenny@yahoo.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 mm/shmem.c |    1 +
 1 file changed, 1 insertion(+)

--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2691,5 +2691,6 @@ int shmem_zero_setup(struct vm_area_stru
 		fput(vma->vm_file);
 	vma->vm_file = file;
 	vma->vm_ops = &shmem_vm_ops;
+	vma->vm_flags |= VM_CAN_NONLINEAR;
 	return 0;
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 104/173] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (103 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 103/173] shmem: let shared anonymous be nonlinear again Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-26 13:03   ` Oleg Nesterov
  2011-04-25 20:04 ` [PATCH 105/173] ext3: skip orphan cleanup on rocompat fs Willy Tarreau
                   ` (68 subsequent siblings)
  173 siblings, 1 reply; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Julien Tinnes, Oleg Nesterov, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Julien Tinnes <jln@google.com>

commit da48524eb20662618854bb3df2db01fc65f3070c upstream.

Userland should be able to trust the pid and uid of the sender of a
signal if the si_code is SI_TKILL.

Unfortunately, the kernel has historically allowed sigqueueinfo() to
send any si_code at all (as long as it was negative - to distinguish it
from kernel-generated signals like SIGILL etc), so it could spoof a
SI_TKILL with incorrect siginfo values.

Happily, it looks like glibc has always set si_code to the appropriate
SI_QUEUE, so there are probably no actual user code that ever uses
anything but the appropriate SI_QUEUE flag.

So just tighten the check for si_code (we used to allow any negative
value), and add a (one-time) warning in case there are binaries out
there that might depend on using other si_code values.

Signed-off-by: Julien Tinnes <jln@google.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[wt: 2.6.27 does not have do_rt_tgsigqueueinfo()]

---
 kernel/signal.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Index: longterm-2.6.27/kernel/signal.c
===================================================================
--- longterm-2.6.27.orig/kernel/signal.c	2011-01-23 10:52:37.000000000 +0100
+++ longterm-2.6.27/kernel/signal.c	2011-04-25 16:06:27.491278774 +0200
@@ -2294,9 +2294,13 @@
 		return -EFAULT;
 
 	/* Not even root can pretend to send signals from the kernel.
-	   Nor can they impersonate a kill(), which adds source info.  */
-	if (info.si_code >= 0)
+	 * Nor can they impersonate a kill()/tgkill(), which adds source info.
+	 */
+	if (info.si_code != SI_QUEUE) {
+		/* We used to allow any < 0 si_code */
+		WARN_ON_ONCE(info.si_code < 0);
 		return -EPERM;
+	}
 	info.si_signo = sig;
 
 	/* POSIX.1b doesn't mention process groups.  */



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 105/173] ext3: skip orphan cleanup on rocompat fs
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (104 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 104/173] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 106/173] procfs: fix /proc/<pid>/maps heap check Willy Tarreau
                   ` (67 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Amir Goldstein, Jan Kara, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Amir Goldstein <amir73il@gmail.com>

commit ce654b37f87980d95f339080e4c3bdb2370bdf22 upstream.

Orphan cleanup is currently executed even if the file system has some
number of unknown ROCOMPAT features, which deletes inodes and frees
blocks, which could be very bad for some RO_COMPAT features.

This patch skips the orphan cleanup if it contains readonly compatible
features not known by this ext3 implementation, which would prevent
the fs from being mounted (or remounted) readwrite.

Signed-off-by: Amir Goldstein <amir73il@users.sf.net>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ext3/super.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -1404,6 +1404,13 @@ static void ext3_orphan_cleanup (struct
 		return;
 	}
 
+	/* Check if feature set allows readwrite operations */
+	if (EXT3_HAS_RO_COMPAT_FEATURE(sb, ~EXT3_FEATURE_RO_COMPAT_SUPP)) {
+		printk(KERN_INFO "EXT3-fs: %s: Skipping orphan cleanup due to "
+			 "unknown ROCOMPAT features\n", sb->s_id);
+		return;
+	}
+
 	if (EXT3_SB(sb)->s_mount_state & EXT3_ERROR_FS) {
 		if (es->s_last_orphan)
 			jbd_debug(1, "Errors on filesystem, "



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 106/173] procfs: fix /proc/<pid>/maps heap check
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (105 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 105/173] ext3: skip orphan cleanup on rocompat fs Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 107/173] proc: protect mm start_code/end_code in /proc/pid/stat Willy Tarreau
                   ` (66 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Aaro Koskinen, Andrew Morton, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Aaro Koskinen <aaro.koskinen@nokia.com>

commit 0db0c01b53a1a421513f91573241aabafb87802a upstream.

The current code fails to print the "[heap]" marking if the heap is split
into multiple mappings.

Fix the check so that the marking is displayed in all possible cases:
	1. vma matches exactly the heap
	2. the heap vma is merged e.g. with bss
	3. the heap vma is splitted e.g. due to locked pages

Test cases. In all cases, the process should have mapping(s) with
[heap] marking:

	(1) vma matches exactly the heap

	#include <stdio.h>
	#include <unistd.h>
	#include <sys/types.h>

	int main (void)
	{
		if (sbrk(4096) != (void *)-1) {
			printf("check /proc/%d/maps\n", (int)getpid());
			while (1)
				sleep(1);
		}
		return 0;
	}

	# ./test1
	check /proc/553/maps
	[1] + Stopped                    ./test1
	# cat /proc/553/maps | head -4
	00008000-00009000 r-xp 00000000 01:00 3113640    /test1
	00010000-00011000 rw-p 00000000 01:00 3113640    /test1
	00011000-00012000 rw-p 00000000 00:00 0          [heap]
	4006f000-40070000 rw-p 00000000 00:00 0

	(2) the heap vma is merged

	#include <stdio.h>
	#include <unistd.h>
	#include <sys/types.h>

	char foo[4096] = "foo";
	char bar[4096];

	int main (void)
	{
		if (sbrk(4096) != (void *)-1) {
			printf("check /proc/%d/maps\n", (int)getpid());
			while (1)
				sleep(1);
		}
		return 0;
	}

	# ./test2
	check /proc/556/maps
	[2] + Stopped                    ./test2
	# cat /proc/556/maps | head -4
	00008000-00009000 r-xp 00000000 01:00 3116312    /test2
	00010000-00012000 rw-p 00000000 01:00 3116312    /test2
	00012000-00014000 rw-p 00000000 00:00 0          [heap]
	4004a000-4004b000 rw-p 00000000 00:00 0

	(3) the heap vma is splitted (this fails without the patch)

	#include <stdio.h>
	#include <unistd.h>
	#include <sys/mman.h>
	#include <sys/types.h>

	int main (void)
	{
		if ((sbrk(4096) != (void *)-1) && !mlockall(MCL_FUTURE) &&
		    (sbrk(4096) != (void *)-1)) {
			printf("check /proc/%d/maps\n", (int)getpid());
			while (1)
				sleep(1);
		}
		return 0;
	}

	# ./test3
	check /proc/559/maps
	[1] + Stopped                    ./test3
	# cat /proc/559/maps|head -4
	00008000-00009000 r-xp 00000000 01:00 3119108    /test3
	00010000-00011000 rw-p 00000000 01:00 3119108    /test3
	00011000-00012000 rw-p 00000000 00:00 0          [heap]
	00012000-00013000 rw-p 00000000 00:00 0          [heap]

It looks like the bug has been there forever, and since it only results in
some information missing from a procfile, it does not fulfil the -stable
"critical issue" criteria.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/proc/task_mmu.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -244,8 +244,8 @@ static void show_map_vma(struct seq_file
 		const char *name = arch_vma_name(vma);
 		if (!name) {
 			if (mm) {
-				if (vma->vm_start <= mm->start_brk &&
-						vma->vm_end >= mm->brk) {
+				if (vma->vm_start <= mm->brk &&
+						vma->vm_end >= mm->start_brk) {
 					name = "[heap]";
 				} else if (vma->vm_start <= mm->start_stack &&
 					   vma->vm_end >= mm->start_stack) {



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 107/173] proc: protect mm start_code/end_code in /proc/pid/stat
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (106 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 106/173] procfs: fix /proc/<pid>/maps heap check Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 108/173] fbcon: Bugfix soft cursor detection in Tile Blitting Willy Tarreau
                   ` (65 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Kees Cook, Alexey Dobriyan, David Howells, Eugene Teo,
	Martin Schwidefsky, Brad Spengler, Andrew Morton, Linus Torvalds,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kees Cook <kees.cook@canonical.com>

commit 5883f57ca0008ffc93e09cbb9847a1928e50c6f3 upstream.

While mm->start_stack was protected from cross-uid viewing (commit
f83ce3e6b02d5 ("proc: avoid information leaks to non-privileged
processes")), the start_code and end_code values were not.  This would
allow the text location of a PIE binary to leak, defeating ASLR.

Note that the value "1" is used instead of "0" for a protected value since
"ps", "killall", and likely other readers of /proc/pid/stat, take
start_code of "0" to mean a kernel thread and will misbehave.  Thanks to
Brad Spengler for pointing this out.

Addresses CVE-2011-0726

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Eugene Teo <eugeneteo@kernel.sg>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Brad Spengler <spender@grsecurity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/proc/array.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -473,8 +473,8 @@ static int do_task_stat(struct seq_file
 		vsize,
 		mm ? get_mm_rss(mm) : 0,
 		rsslim,
-		mm ? mm->start_code : 0,
-		mm ? mm->end_code : 0,
+		mm ? (permitted ? mm->start_code : 1) : 0,
+		mm ? (permitted ? mm->end_code : 1) : 0,
 		(permitted && mm) ? mm->start_stack : 0,
 		esp,
 		eip,



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 108/173] fbcon: Bugfix soft cursor detection in Tile Blitting
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (107 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 107/173] proc: protect mm start_code/end_code in /proc/pid/stat Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 109/173] ehci-hcd: Bug fix: dont set a QHs Halt bit Willy Tarreau
                   ` (64 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Henry Nestler, Paul Mundt, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Henry Nestler <henry.nestler@gmail.com>

commit d6244bc0ed0c52a795e6f4dcab3886daf3e74fac upstream.

Use mask 0x10 for "soft cursor" detection on in function tile_cursor.
(Tile Blitting Operation in framebuffer console).

The old mask 0x01 for vc_cursor_type detects CUR_NONE, CUR_LOWER_THIRD
and every second mode value as "software cursor". This hides the cursor
for these modes (cursor.mode = 0). But, only CUR_NONE or "software cursor"
should hide the cursor.
See also 0x10 in functions add_softcursor, bit_cursor and cw_cursor.

Signed-off-by: Henry Nestler <henry.nestler@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/video/console/tileblit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/console/tileblit.c
+++ b/drivers/video/console/tileblit.c
@@ -83,7 +83,7 @@ static void tile_cursor(struct vc_data *
 			int softback_lines, int fg, int bg)
 {
 	struct fb_tilecursor cursor;
-	int use_sw = (vc->vc_cursor_type & 0x01);
+	int use_sw = (vc->vc_cursor_type & 0x10);
 
 	cursor.sx = vc->vc_x;
 	cursor.sy = vc->vc_y;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 109/173] ehci-hcd: Bug fix: dont set a QHs Halt bit
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (108 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 108/173] fbcon: Bugfix soft cursor detection in Tile Blitting Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 110/173] USB: uss720 fixup refcount position Willy Tarreau
                   ` (63 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Alan Stern, David Brownell, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit b5a3b3d985493c173925907adfebf3edab236fe7 upstream.

This patch (as1453) fixes a long-standing bug in the ehci-hcd driver.

There is no need to set the Halt bit in the overlay region for an
unlinked or blocked QH.  Contrary to what the comment says, setting
the Halt bit does not cause the QH to be patched later; that decision
(made in qh_refresh()) depends only on whether the QH is currently
pointing to a valid qTD.  Likewise, setting the Halt bit does not
prevent completions from activating the QH while it is "stopped"; they
are prevented by the fact that qh_completions() temporarily changes
qh->qh_state to QH_STATE_COMPLETING.

On the other hand, there are circumstances in which the QH will be
reactivated _without_ being patched; this happens after an URB beyond
the head of the queue is unlinked.  Setting the Halt bit will then
cause the hardware to see the QH with both the Active and Halt bits
set, an invalid combination that will prevent the queue from
advancing and may even crash some controllers.

Apparently the only reason this hasn't been reported before is that
unlinking URBs from the middle of a running queue is quite uncommon.
However Test 17, recently added to the usbtest driver, does exactly
this, and it confirms the presence of the bug.

In short, there is no reason to set the Halt bit for an unlinked or
blocked QH, and there is a very good reason not to set it.  Therefore
the code that sets it is removed.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Andiry Xu <andiry.xu@amd.com>
CC: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-q.c |   12 ------------
 1 file changed, 12 deletions(-)

Index: longterm-2.6.27/drivers/usb/host/ehci-q.c
===================================================================
--- longterm-2.6.27.orig/drivers/usb/host/ehci-q.c	2011-01-23 10:52:26.000000000 +0100
+++ longterm-2.6.27/drivers/usb/host/ehci-q.c	2011-04-25 16:25:29.076280256 +0200
@@ -285,7 +285,6 @@
 	int			stopped;
 	unsigned		count = 0;
 	u8			state;
-	__le32			halt = HALT_BIT(ehci);
 
 	if (unlikely (list_empty (&qh->qtd_list)))
 		return count;
@@ -381,7 +380,6 @@
 					&& !(qtd->hw_alt_next
 						& EHCI_LIST_END(ehci))) {
 				stopped = 1;
-				goto halt;
 			}
 
 		/* stop scanning when we reach qtds the hc is using */
@@ -408,16 +406,6 @@
 					&& cpu_to_hc32(ehci, qtd->qtd_dma)
 						== qh->hw_current)
 				token = hc32_to_cpu(ehci, qh->hw_token);
-
-			/* force halt for unlinked or blocked qh, so we'll
-			 * patch the qh later and so that completions can't
-			 * activate it while we "know" it's stopped.
-			 */
-			if ((halt & qh->hw_token) == 0) {
-halt:
-				qh->hw_token |= halt;
-				wmb ();
-			}
 		}
 
 		/* unless we already know the urb's status, collect qtd status



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 110/173] USB: uss720 fixup refcount position
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (109 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 109/173] ehci-hcd: Bug fix: dont set a QHs Halt bit Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 111/173] USB: cdc-acm: fix potential null-pointer dereference on disconnect Willy Tarreau
                   ` (62 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Peter Holik, Thomas Sailer, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Peter Holik <peter@holik.at>

commit adaa3c6342b249548ea830fe8e02aa5b45be8688 upstream.

My testprog do a lot of bitbang - after hours i got following warning and my machine lockups:
WARNING: at /build/buildd/linux-2.6.38/lib/kref.c:34
After debugging uss720 driver i discovered that the completion callback was called before
usb_submit_urb returns. The callback frees the request structure that is krefed on return by
usb_submit_urb.

Signed-off-by: Peter Holik <peter@holik.at>
Acked-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/misc/uss720.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/drivers/usb/misc/uss720.c
+++ b/drivers/usb/misc/uss720.c
@@ -176,12 +176,11 @@ static struct uss720_async_request *subm
 	spin_lock_irqsave(&priv->asynclock, flags);
 	list_add_tail(&rq->asynclist, &priv->asynclist);
 	spin_unlock_irqrestore(&priv->asynclock, flags);
+	kref_get(&rq->ref_count);
 	ret = usb_submit_urb(rq->urb, mem_flags);
-	if (!ret) {
-		kref_get(&rq->ref_count);
+	if (!ret)
 		return rq;
-	}
-	kref_put(&rq->ref_count, destroy_async);
+	destroy_async(&rq->ref_count);
 	err("submit_async_request submit_urb failed with %d", ret);
 	return NULL;
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 111/173] USB: cdc-acm: fix potential null-pointer dereference on disconnect
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (110 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 110/173] USB: uss720 fixup refcount position Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 112/173] Input: xen-kbdfront - advertise either absolute or relative coordinates Willy Tarreau
                   ` (61 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Johan Hovold, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Johan Hovold <jhovold@gmail.com>

commit 7e7797e7f6f7bfab73fca02c65e40eaa5bb9000c upstream.

Fix potential null-pointer exception on disconnect introduced by commit
11ea859d64b69a747d6b060b9ed1520eab1161fe (USB: additional power savings
for cdc-acm devices that support remote wakeup).

Only access acm->dev after making sure it is non-null in control urb
completion handler.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/class/cdc-acm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: longterm-2.6.27/drivers/usb/class/cdc-acm.c
===================================================================
--- longterm-2.6.27.orig/drivers/usb/class/cdc-acm.c	2011-01-23 10:52:26.000000000 +0100
+++ longterm-2.6.27/drivers/usb/class/cdc-acm.c	2011-04-25 16:30:06.372280691 +0200
@@ -285,6 +285,8 @@
 	if (!ACM_READY(acm))
 		goto exit;
 
+	usb_mark_last_busy(acm->dev);
+
 	data = (unsigned char *)(dr + 1);
 	switch (dr->bNotificationType) {
 
@@ -319,7 +321,6 @@
 			break;
 	}
 exit:
-	usb_mark_last_busy(acm->dev);
 	retval = usb_submit_urb (urb, GFP_ATOMIC);
 	if (retval)
 		err ("%s - usb_submit_urb failed with result %d",



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 112/173] Input: xen-kbdfront - advertise either absolute or relative coordinates
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (111 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 111/173] USB: cdc-acm: fix potential null-pointer dereference on disconnect Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:31   ` Olaf Hering
  2011-04-25 20:04 ` [PATCH 113/173] dcdbas: force SMI to happen when expected Willy Tarreau
                   ` (60 subsequent siblings)
  173 siblings, 1 reply; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Olaf Hering, Stefano Stabellini, Dmitry Torokhov,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Olaf Hering <olaf@aepfle.de>

commit 8c3c283e6bf463ab498d6e7823aff6c4762314b6 upstream.

A virtualized display device is usually viewed with the vncviewer
application, either by 'xm vnc domU' or with vncviewer localhost:port.
vncviewer and the RFB protocol provides absolute coordinates to the
virtual display. These coordinates are either passed through to a PV
guest or converted to relative coordinates for a HVM guest.

A PV guest receives these coordinates and passes them to the kernels
evdev driver. There it can be picked up by applications such as the
xorg-input drivers. Using absolute coordinates avoids issues such as
guest mouse pointer not tracking host mouse pointer due to wrong mouse
acceleration settings in the guests X display.

Advertise either absolute or relative coordinates to the input system
and the evdev driver, depending on what dom0 provides. The xorg-input
driver prefers relative coordinates even if a devices provides both.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/input/xen-kbdfront.c |   45 ++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)

Index: longterm-2.6.27/drivers/input/xen-kbdfront.c
===================================================================
--- longterm-2.6.27.orig/drivers/input/xen-kbdfront.c	2011-01-23 10:52:17.000000000 +0100
+++ longterm-2.6.27/drivers/input/xen-kbdfront.c	2011-04-25 16:32:54.339278957 +0200
@@ -105,7 +105,7 @@
 static int __devinit xenkbd_probe(struct xenbus_device *dev,
 				  const struct xenbus_device_id *id)
 {
-	int ret, i;
+	int ret, i, abs;
 	struct xenkbd_info *info;
 	struct input_dev *kbd, *ptr;
 
@@ -123,6 +123,11 @@
 	if (!info->page)
 		goto error_nomem;
 
+	if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0)
+		abs = 0;
+	if (abs)
+		xenbus_printf(XBT_NIL, dev->nodename, "request-abs-pointer", "1");
+
 	/* keyboard */
 	kbd = input_allocate_device();
 	if (!kbd)
@@ -132,11 +137,12 @@
 	kbd->id.bustype = BUS_PCI;
 	kbd->id.vendor = 0x5853;
 	kbd->id.product = 0xffff;
-	kbd->evbit[0] = BIT(EV_KEY);
+
+	__set_bit(EV_KEY, kbd->evbit);
 	for (i = KEY_ESC; i < KEY_UNKNOWN; i++)
-		set_bit(i, kbd->keybit);
+		__set_bit(i, kbd->keybit);
 	for (i = KEY_OK; i < KEY_MAX; i++)
-		set_bit(i, kbd->keybit);
+		__set_bit(i, kbd->keybit);
 
 	ret = input_register_device(kbd);
 	if (ret) {
@@ -155,12 +161,20 @@
 	ptr->id.bustype = BUS_PCI;
 	ptr->id.vendor = 0x5853;
 	ptr->id.product = 0xfffe;
-	ptr->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
+
+	if (abs) {
+		__set_bit(EV_ABS, ptr->evbit);
+		input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
+		input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
+	} else {
+		input_set_capability(ptr, EV_REL, REL_X);
+		input_set_capability(ptr, EV_REL, REL_Y);
+	}
+	input_set_capability(ptr, EV_REL, REL_WHEEL);
+
+	__set_bit(EV_KEY, ptr->evbit);
 	for (i = BTN_LEFT; i <= BTN_TASK; i++)
-		set_bit(i, ptr->keybit);
-	ptr->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL);
-	input_set_abs_params(ptr, ABS_X, 0, XENFB_WIDTH, 0, 0);
-	input_set_abs_params(ptr, ABS_Y, 0, XENFB_HEIGHT, 0, 0);
+		__set_bit(i, ptr->keybit);
 
 	ret = input_register_device(ptr);
 	if (ret) {
@@ -267,7 +281,7 @@
 				   enum xenbus_state backend_state)
 {
 	struct xenkbd_info *info = dev->dev.driver_data;
-	int ret, val;
+	int val;
 
 	switch (backend_state) {
 	case XenbusStateInitialising:
@@ -278,17 +292,6 @@
 
 	case XenbusStateInitWait:
 InitWait:
-		ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
-				   "feature-abs-pointer", "%d", &val);
-		if (ret < 0)
-			val = 0;
-		if (val) {
-			ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
-					    "request-abs-pointer", "1");
-			if (ret)
-				printk(KERN_WARNING
-				       "xenkbd: can't request abs-pointer");
-		}
 		xenbus_switch_state(dev, XenbusStateConnected);
 		break;
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 113/173] dcdbas: force SMI to happen when expected
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (112 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 112/173] Input: xen-kbdfront - advertise either absolute or relative coordinates Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 114/173] myri10ge: fix rmmod crash Willy Tarreau
                   ` (59 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Stuart Hayes, Doug Warzecha, Chuck Ebbert, Jiri Kosina,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Stuart Hayes <stuart_hayes@yahoo.com>

commit dd65c736d1b5312c80c88a64bf521db4959eded5 upstream.

The dcdbas driver can do an I/O write to cause a SMI to occur.  The SMI handler
looks at certain registers and memory locations, so the SMI needs to happen
immediately.  On some systems I/O writes are posted, though, causing the SMI to
happen well after the "outb" occurred, which causes random failures.  Following
the "outb" with an "inb" forces the write to go through even if it is posted.

Signed-off-by: Stuart Hayes <stuart_hayes@yahoo.com>
Acked-by: Doug Warzecha <douglas_warzecha@dell.com>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/firmware/dcdbas.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/firmware/dcdbas.c
+++ b/drivers/firmware/dcdbas.c
@@ -267,8 +267,10 @@ int dcdbas_smi_request(struct smi_cmd *s
 	}
 
 	/* generate SMI */
+	/* inb to force posted write through and make SMI happen now */
 	asm volatile (
-		"outb %b0,%w1"
+		"outb %b0,%w1\n"
+		"inb %w1"
 		: /* no output args */
 		: "a" (smi_cmd->command_code),
 		  "d" (smi_cmd->command_address),



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 114/173] myri10ge: fix rmmod crash
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (113 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 113/173] dcdbas: force SMI to happen when expected Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 115/173] cciss: fix lost command issue Willy Tarreau
                   ` (58 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Stanislaw Gruszka, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Stanislaw Gruszka <sgruszka@redhat.com>

commit cda6587c21a887254c8ed4b58da8fcc4040ab557 upstream.

Rmmod myri10ge crash at free_netdev() -> netif_napi_del(), because napi
structures are already deallocated. To fix call netif_napi_del() before
kfree() at myri10ge_free_slices().

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/myri10ge/myri10ge.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -3640,6 +3640,7 @@ static void myri10ge_free_slices(struct
 			dma_free_coherent(&pdev->dev, bytes,
 					  ss->fw_stats, ss->fw_stats_bus);
 			ss->fw_stats = NULL;
+			netif_napi_del(&ss->napi);
 		}
 	}
 	kfree(mgp->ss);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 115/173] cciss: fix lost command issue
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (114 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 114/173] myri10ge: fix rmmod crash Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 116/173] sound/oss/opl3: validate voice and channel indexes Willy Tarreau
                   ` (57 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Mike Miller, Jens Axboe, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Bud Brown <bud.brown@redhat.com>

commit 1ddd5049545e0aa1a0ed19bca4d9c9c3ce1ac8a2 upstream.

Under certain workloads a command may seem to get lost. IOW, the Smart Array
thinks all commands have been completed but we still have commands in our
completion queue. This may lead to system instability, filesystems going
read-only, or even panics depending on the affected filesystem. We add an
extra read to force the write to complete.

Testing shows this extra read avoids the problem.

Signed-off-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/block/cciss.h |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/block/cciss.h
+++ b/drivers/block/cciss.h
@@ -165,6 +165,7 @@ static void SA5_submit_command( ctlr_inf
 	 printk("Sending %x - down to controller\n", c->busaddr );
 #endif /* CCISS_DEBUG */ 
          writel(c->busaddr, h->vaddr + SA5_REQUEST_PORT_OFFSET);
+	readl(h->vaddr + SA5_REQUEST_PORT_OFFSET);
 	 h->commands_outstanding++;
 	 if ( h->commands_outstanding > h->max_outstanding)
 		h->max_outstanding = h->commands_outstanding;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 116/173] sound/oss/opl3: validate voice and channel indexes
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (115 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 115/173] cciss: fix lost command issue Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 117/173] mac80211: initialize sta->last_rx in sta_info_alloc Willy Tarreau
                   ` (56 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, Takashi Iwai, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit 4d00135a680727f6c3be78f8befaac009030e4df upstream.

User-controllable indexes for voice and channel values may cause reading
and writing beyond the bounds of their respective arrays, leading to
potentially exploitable memory corruption.  Validate these indexes.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/oss/opl3.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

--- a/sound/oss/opl3.c
+++ b/sound/oss/opl3.c
@@ -848,6 +848,10 @@ static int opl3_load_patch(int dev, int
 
 static void opl3_panning(int dev, int voice, int value)
 {
+
+	if (voice < 0 || voice >= devc->nr_voice)
+		return;
+
 	devc->voc[voice].panning = value;
 }
 
@@ -1065,8 +1069,15 @@ static int opl3_alloc_voice(int dev, int
 
 static void opl3_setup_voice(int dev, int voice, int chn)
 {
-	struct channel_info *info =
-	&synth_devs[dev]->chn_info[chn];
+	struct channel_info *info;
+
+	if (voice < 0 || voice >= devc->nr_voice)
+		return;
+
+	if (chn < 0 || chn > 15)
+		return;
+
+	info = &synth_devs[dev]->chn_info[chn];
 
 	opl3_set_instr(dev, voice, info->pgm_num);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 117/173] mac80211: initialize sta->last_rx in sta_info_alloc
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (116 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 116/173] sound/oss/opl3: validate voice and channel indexes Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 118/173] [SCSI] ses: show devices for enclosures with no page 7 Willy Tarreau
                   ` (55 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Felix Fietkau, John W. Linville, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Felix Fietkau <nbd@openwrt.org>

commit 8bc8aecdc5e26cfda12dbd6867af4aa67836da6a upstream.

This field is used to determine the inactivity time. When in AP mode,
hostapd uses it for kicking out inactive clients after a while. Without this
patch, hostapd immediately deauthenticates a new client if it checks the
inactivity time before the client sends its first data frame.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/mac80211/sta_info.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -276,6 +276,7 @@ struct sta_info *sta_info_alloc(struct i
 	memcpy(sta->sta.addr, addr, ETH_ALEN);
 	sta->local = local;
 	sta->sdata = sdata;
+	sta->last_rx = jiffies;
 
 	sta->rate_ctrl = rate_control_get(local->rate_ctrl);
 	sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl,



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 118/173] [SCSI] ses: show devices for enclosures with no page 7
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (117 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 117/173] mac80211: initialize sta->last_rx in sta_info_alloc Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 119/173] [SCSI] ses: Avoid kernel panic when lun 0 is not mapped Willy Tarreau
                   ` (54 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: James Bottomley, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: John Hughes <john@Calva.COM>

commit 877a55979c189c590e819a61cbbe2b7947875f17 upstream.

enclosure page 7 gives us the "pretty" names of the enclosure slots.
Without a page 7, we can still use the enclosure code as long as we
make up numeric names for the slots. Unfortunately, the current code
fails to add any devices because the check for page 10 is in the wrong
place if we have no page 7.  Fix it so that devices show up even if
the enclosure has no page 7.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/ses.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -389,9 +389,9 @@ static void ses_enclosure_data_process(s
 		len = (desc_ptr[2] << 8) + desc_ptr[3];
 		/* skip past overall descriptor */
 		desc_ptr += len + 4;
-		if (ses_dev->page10)
-			addl_desc_ptr = ses_dev->page10 + 8;
 	}
+	if (ses_dev->page10)
+		addl_desc_ptr = ses_dev->page10 + 8;
 	type_ptr = ses_dev->page1 + 12 + ses_dev->page1[11];
 	components = 0;
 	for (i = 0; i < types; i++, type_ptr += 4) {



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 119/173] [SCSI] ses: Avoid kernel panic when lun 0 is not mapped
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (118 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 118/173] [SCSI] ses: show devices for enclosures with no page 7 Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 120/173] eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix Willy Tarreau
                   ` (53 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Somasundaram Krishnasamy, Babu Moger, James Bottomley,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Krishnasamy, Somasundaram <Somasundaram.Krishnasamy@lsi.com>

commit d1e12de804f9d8ad114786ca7c2ce593cba79891 upstream.

During device discovery, scsi mid layer sends INQUIRY command to LUN
0. If the LUN 0 is not mapped to host, it creates a temporary
scsi_device with LUN id 0 and sends REPORT_LUNS command to it. After
the REPORT_LUNS succeeds, it walks through the LUN table and adds each
LUN found to sysfs. At the end of REPORT_LUNS lun table scan, it will
delete the temporary scsi_device of LUN 0.

When scsi devices are added to sysfs, it calls add_dev function of all
the registered class interfaces. If ses driver has been registered,
ses_intf_add() of ses module will be called. This function calls
scsi_device_enclosure() to check the inquiry data for EncServ
bit. Since inquiry was not allocated for temporary LUN 0 scsi_device,
it will cause NULL pointer exception.

To fix the problem, sdev->inquiry is checked for NULL before reading it.

Signed-off-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com>
Signed-off-by: Babu Moger <babu.moger@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/scsi/scsi_device.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -446,7 +446,7 @@ static inline int scsi_device_qas(struct
 }
 static inline int scsi_device_enclosure(struct scsi_device *sdev)
 {
-	return sdev->inquiry[6] & (1<<6);
+	return sdev->inquiry ? (sdev->inquiry[6] & (1<<6)) : 1;
 }
 
 static inline int scsi_device_protection(struct scsi_device *sdev)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 120/173] eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (119 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 119/173] [SCSI] ses: Avoid kernel panic when lun 0 is not mapped Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 121/173] Relax si_code check in rt_sigqueueinfo and rt_tgsigqueueinfo Willy Tarreau
                   ` (52 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Roberto Sassu, Tyler Hicks, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Roberto Sassu <roberto.sassu@polito.it>

commit 1821df040ac3cd6a57518739f345da6d50ea9d3f upstream.

The pointer '(*auth_tok_key)' is set to NULL in case request_key()
fails, in order to prevent its use by functions calling
ecryptfs_keyring_auth_tok_for_sig().

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ecryptfs/keystore.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/ecryptfs/keystore.c
+++ b/fs/ecryptfs/keystore.c
@@ -1542,6 +1542,7 @@ int ecryptfs_keyring_auth_tok_for_sig(st
 		printk(KERN_ERR "Could not find key with description: [%s]\n",
 		       sig);
 		rc = process_request_key_err(PTR_ERR(*auth_tok_key));
+		(*auth_tok_key) = NULL;
 		goto out;
 	}
 	(*auth_tok) = ecryptfs_get_key_payload_data(*auth_tok_key);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 121/173] Relax si_code check in rt_sigqueueinfo and rt_tgsigqueueinfo
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (120 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 120/173] eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 122/173] xfs: prevent leaking uninitialized stack memory in FSGEOMETRY_V1 Willy Tarreau
                   ` (51 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Julien Tinnes, Roland Dreier, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Roland Dreier <roland@purestorage.com>

commit 243b422af9ea9af4ead07a8ad54c90d4f9b6081a upstream.

Commit da48524eb206 ("Prevent rt_sigqueueinfo and rt_tgsigqueueinfo
from spoofing the signal code") made the check on si_code too strict.
There are several legitimate places where glibc wants to queue a
negative si_code different from SI_QUEUE:

 - This was first noticed with glibc's aio implementation, which wants
   to queue a signal with si_code SI_ASYNCIO; the current kernel
   causes glibc's tst-aio4 test to fail because rt_sigqueueinfo()
   fails with EPERM.

 - Further examination of the glibc source shows that getaddrinfo_a()
   wants to use SI_ASYNCNL (which the kernel does not even define).
   The timer_create() fallback code wants to queue signals with SI_TIMER.

As suggested by Oleg Nesterov <oleg@redhat.com>, loosen the check to
forbid only the problematic SI_TKILL case.

Reported-by: Klaus Dittrich <kladit@arcor.de>
Acked-by: Julien Tinnes <jln@google.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[wt: 2.6.27 has no rt_tgsigqueueinfo()]

---
 kernel/signal.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: longterm-2.6.27/kernel/signal.c
===================================================================
--- longterm-2.6.27.orig/kernel/signal.c	2011-04-25 16:06:27.000000000 +0200
+++ longterm-2.6.27/kernel/signal.c	2011-04-25 16:40:37.072279504 +0200
@@ -2296,7 +2296,7 @@
 	/* Not even root can pretend to send signals from the kernel.
 	 * Nor can they impersonate a kill()/tgkill(), which adds source info.
 	 */
-	if (info.si_code != SI_QUEUE) {
+	if (info.si_code >= 0 || info.si_code == SI_TKILL) {
 		/* We used to allow any < 0 si_code */
 		WARN_ON_ONCE(info.si_code < 0);
 		return -EPERM;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 122/173] xfs: prevent leaking uninitialized stack memory in FSGEOMETRY_V1
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (121 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 121/173] Relax si_code check in rt_sigqueueinfo and rt_tgsigqueueinfo Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 123/173] irda: validate peer name and attribute lengths Willy Tarreau
                   ` (50 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, Alex Elder, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit c4d0c3b097f7584772316ee4d64a09fe0e4ddfca upstream.

The FSGEOMETRY_V1 ioctl (and its compat equivalent) calls out to
xfs_fs_geometry() with a version number of 3.  This code path does not
fill in the logsunit member of the passed xfs_fsop_geom_t, leading to
the leaking of four bytes of uninitialized stack data to potentially
unprivileged callers.

v2 switches to memset() to avoid future issues if structure members
change, on suggestion of Dave Chinner.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Reviewed-by: Eugene Teo <eugeneteo@kernel.org>
Signed-off-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/xfs/xfs_fsops.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/fs/xfs/xfs_fsops.c
+++ b/fs/xfs/xfs_fsops.c
@@ -56,6 +56,9 @@ xfs_fs_geometry(
 	xfs_fsop_geom_t		*geo,
 	int			new_version)
 {
+
+	memset(geo, 0, sizeof(*geo));
+
 	geo->blocksize = mp->m_sb.sb_blocksize;
 	geo->rtextsize = mp->m_sb.sb_rextsize;
 	geo->agblocks = mp->m_sb.sb_agblocks;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 123/173] irda: validate peer name and attribute lengths
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (122 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 122/173] xfs: prevent leaking uninitialized stack memory in FSGEOMETRY_V1 Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 124/173] irda: prevent heap corruption on invalid nickname Willy Tarreau
                   ` (49 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit d370af0ef7951188daeb15bae75db7ba57c67846 upstream.

Length fields provided by a peer for names and attributes may be longer
than the destination array sizes.  Validate lengths to prevent stack
buffer overflows.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/irda/iriap.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -655,10 +655,16 @@ static void iriap_getvaluebyclass_indica
 	n = 1;
 
 	name_len = fp[n++];
+
+	IRDA_ASSERT(name_len < IAS_MAX_CLASSNAME + 1, return;);
+
 	memcpy(name, fp+n, name_len); n+=name_len;
 	name[name_len] = '\0';
 
 	attr_len = fp[n++];
+
+	IRDA_ASSERT(attr_len < IAS_MAX_ATTRIBNAME + 1, return;);
+
 	memcpy(attr, fp+n, attr_len); n+=attr_len;
 	attr[attr_len] = '\0';
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 124/173] irda: prevent heap corruption on invalid nickname
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (123 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 123/173] irda: validate peer name and attribute lengths Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 125/173] ASoC: Explicitly say registerless widgets have no register Willy Tarreau
                   ` (48 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit d50e7e3604778bfc2dc40f440e0742dbae399d54 upstream.

Invalid nicknames containing only spaces will result in an underflow in
a memcpy size calculation, subsequently destroying the heap and
panicking.

v2 also catches the case where the provided nickname is longer than the
buffer size, which can result in controllable heap corruption.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/irda/irnet/irnet_ppp.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/irda/irnet/irnet_ppp.c
+++ b/net/irda/irnet/irnet_ppp.c
@@ -106,6 +106,9 @@ irnet_ctrl_write(irnet_socket *	ap,
 	      while(isspace(start[length - 1]))
 		length--;
 
+	      DABORT(length < 5 || length > NICKNAME_MAX_LEN + 5,
+		     -EINVAL, CTRL_ERROR, "Invalid nickname.\n");
+
 	      /* Copy the name for later reuse */
 	      memcpy(ap->rname, start + 5, length - 5);
 	      ap->rname[length - 5] = '\0';



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 125/173] ASoC: Explicitly say registerless widgets have no register
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (124 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 124/173] irda: prevent heap corruption on invalid nickname Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 126/173] ALSA: ens1371: fix Creative Ectiva support Willy Tarreau
                   ` (47 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Mark Brown, Liam Girdwood, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Mark Brown <broonie@opensource.wolfsonmicro.com>

commit 0ca03cd7d0fa3bfbd56958136a10f19733c4ce12 upstream.

This stops code that handles widgets generically from attempting to access
registers for these widgets.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/sound/soc-dapm.h |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -46,25 +46,25 @@
 /* platform domain */
 #define SND_SOC_DAPM_INPUT(wname) \
 {	.id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \
-	.num_kcontrols = 0}
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM }
 #define SND_SOC_DAPM_OUTPUT(wname) \
 {	.id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \
-	.num_kcontrols = 0}
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM }
 #define SND_SOC_DAPM_MIC(wname, wevent) \
 {	.id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \
-	.num_kcontrols = 0, .event = wevent, \
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
 	.event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
 #define SND_SOC_DAPM_HP(wname, wevent) \
 {	.id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \
-	.num_kcontrols = 0, .event = wevent, \
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
 	.event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
 #define SND_SOC_DAPM_SPK(wname, wevent) \
 {	.id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \
-	.num_kcontrols = 0, .event = wevent, \
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
 	.event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
 #define SND_SOC_DAPM_LINE(wname, wevent) \
 {	.id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \
-	.num_kcontrols = 0, .event = wevent, \
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
 	.event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
 
 /* path domain */
@@ -129,11 +129,11 @@
 /* events that are pre and post DAPM */
 #define SND_SOC_DAPM_PRE(wname, wevent) \
 {	.id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \
-	.num_kcontrols = 0, .event = wevent, \
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
 	.event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD}
 #define SND_SOC_DAPM_POST(wname, wevent) \
 {	.id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \
-	.num_kcontrols = 0, .event = wevent, \
+	.num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
 	.event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD}
 
 /* stream domain */



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 126/173] ALSA: ens1371: fix Creative Ectiva support
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (125 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 125/173] ASoC: Explicitly say registerless widgets have no register Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 127/173] ROSE: prevent heap corruption with bad facilities Willy Tarreau
                   ` (46 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Clemens Ladisch, Takashi Iwai, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Clemens Ladisch <clemens@ladisch.de>

commit 6ebb8a4a43e34f999ab36f27f972f3cd751cda4f upstream.

To make the EV1938 chip work, add a magic bit and an extra delay.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Tested-by: Tino Schmidt <mailtinoshomepage@gmx.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/ens1370.c |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -229,6 +229,7 @@ MODULE_PARM_DESC(lineio, "Line In to Rea
 #define ES_REG_1371_CODEC 0x14	/* W/R: Codec Read/Write register address */
 #define   ES_1371_CODEC_RDY	   (1<<31)	/* codec ready */
 #define   ES_1371_CODEC_WIP	   (1<<30)	/* codec register access in progress */
+#define   EV_1938_CODEC_MAGIC	   (1<<26)
 #define   ES_1371_CODEC_PIRD	   (1<<23)	/* codec read/write select register */
 #define   ES_1371_CODEC_WRITE(a,d) ((((a)&0x7f)<<16)|(((d)&0xffff)<<0))
 #define   ES_1371_CODEC_READS(a)   ((((a)&0x7f)<<16)|ES_1371_CODEC_PIRD)
@@ -603,12 +604,18 @@ static void snd_es1370_codec_write(struc
 
 #ifdef CHIP1371
 
+static inline bool is_ev1938(struct ensoniq *ensoniq)
+{
+	return ensoniq->pci->device == 0x8938;
+}
+
 static void snd_es1371_codec_write(struct snd_ac97 *ac97,
 				   unsigned short reg, unsigned short val)
 {
 	struct ensoniq *ensoniq = ac97->private_data;
-	unsigned int t, x;
+	unsigned int t, x, flag;
 
+	flag = is_ev1938(ensoniq) ? EV_1938_CODEC_MAGIC : 0;
 	mutex_lock(&ensoniq->src_mutex);
 	for (t = 0; t < POLL_COUNT; t++) {
 		if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
@@ -630,7 +637,8 @@ static void snd_es1371_codec_write(struc
 				    0x00010000)
 					break;
 			}
-			outl(ES_1371_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1371_CODEC));
+			outl(ES_1371_CODEC_WRITE(reg, val) | flag,
+			     ES_REG(ensoniq, 1371_CODEC));
 			/* restore SRC reg */
 			snd_es1371_wait_src_ready(ensoniq);
 			outl(x, ES_REG(ensoniq, 1371_SMPRATE));
@@ -647,8 +655,9 @@ static unsigned short snd_es1371_codec_r
 					    unsigned short reg)
 {
 	struct ensoniq *ensoniq = ac97->private_data;
-	unsigned int t, x, fail = 0;
+	unsigned int t, x, flag, fail = 0;
 
+	flag = is_ev1938(ensoniq) ? EV_1938_CODEC_MAGIC : 0;
       __again:
 	mutex_lock(&ensoniq->src_mutex);
 	for (t = 0; t < POLL_COUNT; t++) {
@@ -671,7 +680,8 @@ static unsigned short snd_es1371_codec_r
 				    0x00010000)
 					break;
 			}
-			outl(ES_1371_CODEC_READS(reg), ES_REG(ensoniq, 1371_CODEC));
+			outl(ES_1371_CODEC_READS(reg) | flag,
+			     ES_REG(ensoniq, 1371_CODEC));
 			/* restore SRC reg */
 			snd_es1371_wait_src_ready(ensoniq);
 			outl(x, ES_REG(ensoniq, 1371_SMPRATE));
@@ -683,6 +693,11 @@ static unsigned short snd_es1371_codec_r
 			/* now wait for the stinkin' data (RDY) */
 			for (t = 0; t < POLL_COUNT; t++) {
 				if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) {
+					if (is_ev1938(ensoniq)) {
+						for (t = 0; t < 100; t++)
+							inl(ES_REG(ensoniq, CONTROL));
+						x = inl(ES_REG(ensoniq, 1371_CODEC));
+					}
 					mutex_unlock(&ensoniq->src_mutex);
 					return ES_1371_CODEC_READ(x);
 				}



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 127/173] ROSE: prevent heap corruption with bad facilities
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (126 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 126/173] ALSA: ens1371: fix Creative Ectiva support Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 128/173] UBIFS: do not read flash unnecessarily Willy Tarreau
                   ` (45 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit be20250c13f88375345ad99950190685eda51eb8 upstream.

When parsing the FAC_NATIONAL_DIGIS facilities field, it's possible for
a remote host to provide more digipeaters than expected, resulting in
heap corruption.  Check against ROSE_MAX_DIGIS to prevent overflows, and
abort facilities parsing on failure.

Additionally, when parsing the FAC_CCITT_DEST_NSAP and
FAC_CCITT_SRC_NSAP facilities fields, a remote host can provide a length
of less than 10, resulting in an underflow in a memcpy size, causing a
kernel panic due to massive heap corruption.  A length of greater than
20 results in a stack overflow of the callsign array.  Abort facilities
parsing on these invalid length values.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/rose/rose_subr.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

--- a/net/rose/rose_subr.c
+++ b/net/rose/rose_subr.c
@@ -289,10 +289,15 @@ static int rose_parse_national(unsigned
 				facilities->source_ndigis = 0;
 				facilities->dest_ndigis   = 0;
 				for (pt = p + 2, lg = 0 ; lg < l ; pt += AX25_ADDR_LEN, lg += AX25_ADDR_LEN) {
-					if (pt[6] & AX25_HBIT)
+					if (pt[6] & AX25_HBIT) {
+						if (facilities->dest_ndigis >= ROSE_MAX_DIGIS)
+							return -1;
 						memcpy(&facilities->dest_digis[facilities->dest_ndigis++], pt, AX25_ADDR_LEN);
-					else
+					} else {
+						if (facilities->source_ndigis >= ROSE_MAX_DIGIS)
+							return -1;
 						memcpy(&facilities->source_digis[facilities->source_ndigis++], pt, AX25_ADDR_LEN);
+					}
 				}
 			}
 			p   += l + 2;
@@ -332,6 +337,11 @@ static int rose_parse_ccitt(unsigned cha
 
 		case 0xC0:
 			l = p[1];
+
+			/* Prevent overflows*/
+			if (l < 10 || l > 20)
+				return -1;
+
 			if (*p == FAC_CCITT_DEST_NSAP) {
 				memcpy(&facilities->source_addr, p + 7, ROSE_ADDR_LEN);
 				memcpy(callsign, p + 12,   l - 10);
@@ -372,12 +382,16 @@ int rose_parse_facilities(unsigned char
 			switch (*p) {
 			case FAC_NATIONAL:		/* National */
 				len = rose_parse_national(p + 1, facilities, facilities_len - 1);
+				if (len < 0)
+					return 0;
 				facilities_len -= len + 1;
 				p += len + 1;
 				break;
 
 			case FAC_CCITT:		/* CCITT */
 				len = rose_parse_ccitt(p + 1, facilities, facilities_len - 1);
+				if (len < 0)
+					return 0;
 				facilities_len -= len + 1;
 				p += len + 1;
 				break;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 128/173] UBIFS: do not read flash unnecessarily
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (127 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 127/173] ROSE: prevent heap corruption with bad facilities Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 129/173] UBIFS: fix oops on error path in read_pnode Willy Tarreau
                   ` (44 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Artem Bityutskiy, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

commit 8b229c76765816796eec7ccd428f03bd8de8b525 upstream.

This fix makes the 'dbg_check_old_index()' function return
immediately if debugging is disabled, instead of executing
incorrect 'goto out' which causes UBIFS to:

1. Allocate memory
2. Read the flash

On every commit. OK, we do not commit that often, but it is
still silly to do unneeded I/O anyway.

Credits to coverity for spotting this silly issue.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ubifs/commit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/ubifs/commit.c
+++ b/fs/ubifs/commit.c
@@ -518,7 +518,7 @@ int dbg_check_old_index(struct ubifs_inf
 	size_t sz;
 
 	if (!(ubifs_chk_flags & UBIFS_CHK_OLD_IDX))
-		goto out;
+		return 0;
 
 	INIT_LIST_HEAD(&list);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 129/173] UBIFS: fix oops on error path in read_pnode
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (128 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 128/173] UBIFS: do not read flash unnecessarily Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 130/173] quota: Dont write quota info in dquot_commit() Willy Tarreau
                   ` (43 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Artem Bityutskiy, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

commit 54acbaaa523ca0bd284a18f67ad213c379679e86 upstream.

Thanks to coverity which spotted that UBIFS will oops if 'kmalloc()'
in 'read_pnode()' fails and we dereference a NULL 'pnode' pointer
when we 'goto out'.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ubifs/lpt.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/fs/ubifs/lpt.c
+++ b/fs/ubifs/lpt.c
@@ -1269,10 +1269,9 @@ static int read_pnode(struct ubifs_info
 	lnum = branch->lnum;
 	offs = branch->offs;
 	pnode = kzalloc(sizeof(struct ubifs_pnode), GFP_NOFS);
-	if (!pnode) {
-		err = -ENOMEM;
-		goto out;
-	}
+	if (!pnode)
+		return -ENOMEM;
+
 	if (lnum == 0) {
 		/*
 		 * This pnode was not written which just means that the LEB



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 130/173] quota: Dont write quota info in dquot_commit()
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (129 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 129/173] UBIFS: fix oops on error path in read_pnode Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 131/173] mm: avoid wrapping vm_pgoff in mremap() Willy Tarreau
                   ` (42 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Jan Kara, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jan Kara <jack@suse.cz>

commit b03f24567ce7caf2420b8be4c6eb74c191d59a91 upstream.

There's no reason to write quota info in dquot_commit(). The writing is a
relict from the old days when we didn't have dquot_acquire() and
dquot_release() and thus dquot_commit() could have created / removed quota
structures from the file. These days dquot_commit() only updates usage counters
/ limits in quota structure and thus there's no need to write quota info.

This also fixes an issue with journaling filesystem which didn't reserve
enough space in the transaction for write of quota info (it could have been
dirty at the time of dquot_commit() because of a race with other operation
changing it).

Reported-and-tested-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/quota/dquot.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Index: longterm-2.6.27/fs/dquot.c
===================================================================
--- longterm-2.6.27.orig/fs/dquot.c	2011-04-25 18:46:08.692278358 +0200
+++ longterm-2.6.27/fs/dquot.c	2011-04-25 19:00:34.756279725 +0200
@@ -365,7 +365,7 @@
  */
 int dquot_commit(struct dquot *dquot)
 {
-	int ret = 0, ret2 = 0;
+	int ret = 0;
 	struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
 	mutex_lock(&dqopt->dqio_mutex);
@@ -377,13 +377,10 @@
 	spin_unlock(&dq_list_lock);
 	/* Inactive dquot can be only if there was error during read/init
 	 * => we have better not writing it */
-	if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
+	if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags))
 		ret = dqopt->ops[dquot->dq_type]->commit_dqblk(dquot);
-		if (info_dirty(&dqopt->info[dquot->dq_type]))
-			ret2 = dqopt->ops[dquot->dq_type]->write_file_info(dquot->dq_sb, dquot->dq_type);
-		if (ret >= 0)
-			ret = ret2;
-	}
+	else
+		ret = -EIO;
 out_sem:
 	mutex_unlock(&dqopt->dqio_mutex);
 	return ret;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 131/173] mm: avoid wrapping vm_pgoff in mremap()
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (130 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 130/173] quota: Dont write quota info in dquot_commit() Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 132/173] Bluetooth: sco: fix information leak to userspace Willy Tarreau
                   ` (41 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Hugh Dickins, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Linus Torvalds <torvalds@linux-foundation.org>

commit 982134ba62618c2d69fbbbd166d0a11ee3b7e3d8 upstream.

The normal mmap paths all avoid creating a mapping where the pgoff
inside the mapping could wrap around due to overflow.  However, an
expanding mremap() can take such a non-wrapping mapping and make it
bigger and cause a wrapping condition.

Noticed by Robert Swiecki when running a system call fuzzer, where it
caused a BUG_ON() due to terminally confusing the vma_prio_tree code.  A
vma dumping patch by Hugh then pinpointed the crazy wrapped case.

Reported-and-tested-by: Robert Swiecki <robert@swiecki.net>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[wt: 2.6.27 has this code in do_mremap()]

---
 mm/mremap.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Index: longterm-2.6.27/mm/mremap.c
===================================================================
--- longterm-2.6.27.orig/mm/mremap.c	2011-04-25 15:24:54.000000000 +0200
+++ longterm-2.6.27/mm/mremap.c	2011-04-25 17:01:30.075279051 +0200
@@ -333,10 +333,21 @@
 	/* We can't remap across vm area boundaries */
 	if (old_len > vma->vm_end - addr)
 		goto out;
-	if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP)) {
-		if (new_len > old_len)
+
+	/* Need to be careful about a growing mapping */
+	if (new_len > old_len) {
+		unsigned long pgoff;
+
+		if (vma->vm_flags & (VM_DONTEXPAND | VM_PFNMAP))
+			goto out;
+		pgoff = (addr - vma->vm_start) >> PAGE_SHIFT;
+		pgoff += vma->vm_pgoff;
+		if (pgoff + (new_len >> PAGE_SHIFT) < pgoff) {
+			ret = -EINVAL;
 			goto out;
+		}
 	}
+
 	if (vma->vm_flags & VM_LOCKED) {
 		unsigned long locked, lock_limit;
 		locked = mm->locked_vm << PAGE_SHIFT;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 132/173] Bluetooth: sco: fix information leak to userspace
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (131 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 131/173] mm: avoid wrapping vm_pgoff in mremap() Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 133/173] bridge: netfilter: fix information leak Willy Tarreau
                   ` (40 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Gustavo F. Padovan, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit c4c896e1471aec3b004a693c689f60be3b17ac86 upstream.

struct sco_conninfo has one padding byte in the end.  Local variable
cinfo of type sco_conninfo is copied to userspace with this uninizialized
one byte, leading to old stack contents leak.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/bluetooth/sco.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -700,6 +700,7 @@ static int sco_sock_getsockopt_old(struc
 			break;
 		}
 
+		memset(&cinfo, 0, sizeof(cinfo));
 		cinfo.hci_handle = sco_pi(sk)->conn->hcon->handle;
 		memcpy(cinfo.dev_class, sco_pi(sk)->conn->hcon->dev_class, 3);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 133/173] bridge: netfilter: fix information leak
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (132 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 132/173] Bluetooth: sco: fix information leak to userspace Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 134/173] Bluetooth: bnep: fix buffer overflow Willy Tarreau
                   ` (39 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Patrick McHardy, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit d846f71195d57b0bbb143382647c2c6638b04c5a upstream.

Struct tmp is copied from userspace.  It is not checked whether the "name"
field is NULL terminated.  This may lead to buffer overflow and passing
contents of kernel stack as a module name to try_then_request_module() and,
consequently, to modprobe commandline.  It would be seen by all userspace
processes.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/bridge/netfilter/ebtables.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -979,6 +979,8 @@ static int do_replace(struct net *net, v
 	if (tmp.num_counters >= INT_MAX / sizeof(struct ebt_counter))
 		return -ENOMEM;
 
+	tmp.name[sizeof(tmp.name) - 1] = 0;
+
 	countersize = COUNTER_OFFSET(tmp.nentries) * nr_cpu_ids;
 	newinfo = vmalloc(sizeof(*newinfo) + countersize);
 	if (!newinfo)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 134/173] Bluetooth: bnep: fix buffer overflow
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (133 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 133/173] bridge: netfilter: fix information leak Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 135/173] Bluetooth: add support for Apple MacBook Pro 8,2 Willy Tarreau
                   ` (38 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Gustavo F. Padovan, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 43629f8f5ea32a998d06d1bb41eefa0e821ff573 upstream.

Struct ca is copied from userspace.  It is not checked whether the "device"
field is NULL terminated.  This potentially leads to BUG() inside of
alloc_netdev_mqs() and/or information leak by creating a device with a name
made of contents of kernel stack.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/bluetooth/bnep/sock.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -88,6 +88,7 @@ static int bnep_sock_ioctl(struct socket
 			sockfd_put(nsock);
 			return -EBADFD;
 		}
+		ca.device[sizeof(ca.device)-1] = 0;
 
 		err = bnep_add_connection(&ca, nsock);
 		if (!err) {



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 135/173] Bluetooth: add support for Apple MacBook Pro 8,2
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (134 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 134/173] Bluetooth: bnep: fix buffer overflow Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 136/173] Treat writes as new when holes span across page boundaries Willy Tarreau
                   ` (37 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Marc-Antoine Perennou, Gustavo F. Padovan, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>

commit 63a8588debd4dc72becb9e27add9343c76301c7d upstream.

Just adding the vendor details makes it work fine.

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/bluetooth/btusb.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -62,6 +62,9 @@ static struct usb_device_id btusb_table[
 	/* Apple iMac11,1 */
 	{ USB_DEVICE(0x05ac, 0x8215) },
 
+	/* Apple MacBookPro8,2 */
+	{ USB_DEVICE(0x05ac, 0x821a) },
+
 	/* AVM BlueFRITZ! USB v2.0 */
 	{ USB_DEVICE(0x057c, 0x3800) },
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 136/173] Treat writes as new when holes span across page boundaries
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (135 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 135/173] Bluetooth: add support for Apple MacBook Pro 8,2 Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 137/173] char/tpm: Fix unitialized usage of data buffer Willy Tarreau
                   ` (36 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Goldwyn Rodrigues, jlbec, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Goldwyn Rodrigues <rgoldwyn@gmail.com>

commit 272b62c1f0f6f742046e45b50b6fec98860208a0 upstream.

When a hole spans across page boundaries, the next write forces
a read of the block. This could end up reading existing garbage
data from the disk in ocfs2_map_page_blocks. This leads to
non-zero holes. In order to avoid this, mark the writes as new
when the holes span across page boundaries.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
Signed-off-by: jlbec <jlbec@evilplan.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ocfs2/aops.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -1091,6 +1091,12 @@ static int ocfs2_prepare_page_for_write(
 	ocfs2_figure_cluster_boundaries(OCFS2_SB(inode->i_sb), cpos,
 					&cluster_start, &cluster_end);
 
+	/* treat the write as new if the a hole/lseek spanned across
+	 * the page boundary.
+	 */
+	new = new | ((i_size_read(inode) <= page_offset(page)) &&
+			(page_offset(page) <= user_pos));
+
 	if (page == wc->w_target_page) {
 		map_from = user_pos & (PAGE_CACHE_SIZE - 1);
 		map_to = map_from + user_len;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 137/173] char/tpm: Fix unitialized usage of data buffer
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (136 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 136/173] Treat writes as new when holes span across page boundaries Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 138/173] netfilter: ip_tables: fix infoleak to userspace Willy Tarreau
                   ` (35 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Peter Huewe, Marcel Selhorst, Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Peter Huewe <huewe.external.infineon@googlemail.com>

commit 1309d7afbed112f0e8e90be9af975550caa0076b upstream.

This patch fixes information leakage to the userspace by initializing
the data buffer to zero.

Reported-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Peter Huewe <huewe.external@infineon.com>
Signed-off-by: Marcel Selhorst <m.selhorst@sirrix.com>
[ Also removed the silly "* sizeof(u8)".  If that isn't 1, we have way
  deeper problems than a simple multiplication can fix.   - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/char/tpm/tpm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -969,7 +969,7 @@ int tpm_open(struct inode *inode, struct
 		return -EBUSY;
 	}
 
-	chip->data_buffer = kmalloc(TPM_BUFSIZE * sizeof(u8), GFP_KERNEL);
+	chip->data_buffer = kzalloc(TPM_BUFSIZE, GFP_KERNEL);
 	if (chip->data_buffer == NULL) {
 		clear_bit(0, &chip->is_open);
 		put_device(chip->dev);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 138/173] netfilter: ip_tables: fix infoleak to userspace
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (137 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 137/173] char/tpm: Fix unitialized usage of data buffer Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 139/173] netfilter: arp_tables: " Willy Tarreau
                   ` (34 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Patrick McHardy, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 78b79876761b86653df89c48a7010b5cbd41a84a upstream.

Structures ipt_replace, compat_ipt_replace, and xt_get_revision are
copied from userspace.  Fields of these structs that are
zero-terminated strings are not checked.  When they are used as argument
to a format string containing "%s" in request_module(), some sensitive
information is leaked to userspace via argument of spawned modprobe
process.

The first and the third bugs were introduced before the git epoch; the
second was introduced in 2722971c (v2.6.17-rc1).  To trigger the bug
one should have CAP_NET_ADMIN.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/netfilter/ip_tables.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -1290,6 +1290,7 @@ do_replace(struct net *net, void __user
 	/* overflow check */
 	if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
 		return -ENOMEM;
+	tmp.name[sizeof(tmp.name)-1] = 0;
 
 	newinfo = xt_alloc_table_info(tmp.size);
 	if (!newinfo)
@@ -1820,6 +1821,7 @@ compat_do_replace(struct net *net, void
 		return -ENOMEM;
 	if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
 		return -ENOMEM;
+	tmp.name[sizeof(tmp.name)-1] = 0;
 
 	newinfo = xt_alloc_table_info(tmp.size);
 	if (!newinfo)
@@ -2044,6 +2046,7 @@ do_ipt_get_ctl(struct sock *sk, int cmd,
 			ret = -EFAULT;
 			break;
 		}
+		rev.name[sizeof(rev.name)-1] = 0;
 
 		if (cmd == IPT_SO_GET_REVISION_TARGET)
 			target = 1;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 139/173] netfilter: arp_tables: fix infoleak to userspace
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (138 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 138/173] netfilter: ip_tables: fix infoleak to userspace Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 140/173] netfilter: ipt_CLUSTERIP: fix buffer overflow Willy Tarreau
                   ` (33 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Patrick McHardy, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 42eab94fff18cb1091d3501cd284d6bd6cc9c143 upstream.

Structures ipt_replace, compat_ipt_replace, and xt_get_revision are
copied from userspace.  Fields of these structs that are
zero-terminated strings are not checked.  When they are used as argument
to a format string containing "%s" in request_module(), some sensitive
information is leaked to userspace via argument of spawned modprobe
process.

The first bug was introduced before the git epoch;  the second is
introduced by 6b7d31fc (v2.6.15-rc1);  the third is introduced by
6b7d31fc (v2.6.15-rc1).  To trigger the bug one should have
CAP_NET_ADMIN.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/netfilter/arp_tables.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -1086,6 +1086,7 @@ static int do_replace(struct net *net, v
 	/* overflow check */
 	if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
 		return -ENOMEM;
+	tmp.name[sizeof(tmp.name)-1] = 0;
 
 	newinfo = xt_alloc_table_info(tmp.size);
 	if (!newinfo)
@@ -1508,6 +1509,7 @@ static int compat_do_replace(struct net
 		return -ENOMEM;
 	if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
 		return -ENOMEM;
+	tmp.name[sizeof(tmp.name)-1] = 0;
 
 	newinfo = xt_alloc_table_info(tmp.size);
 	if (!newinfo)
@@ -1763,6 +1765,7 @@ static int do_arpt_get_ctl(struct sock *
 			ret = -EFAULT;
 			break;
 		}
+		rev.name[sizeof(rev.name)-1] = 0;
 
 		try_then_request_module(xt_find_revision(NFPROTO_ARP, rev.name,
 							 rev.revision, 1, &ret),



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 140/173] netfilter: ipt_CLUSTERIP: fix buffer overflow
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (139 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 139/173] netfilter: arp_tables: " Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 141/173] ipv6: netfilter: ip6_tables: fix infoleak to userspace Willy Tarreau
                   ` (32 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Changli Gao, Patrick McHardy, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 961ed183a9fd080cf306c659b8736007e44065a5 upstream.

'buffer' string is copied from userspace.  It is not checked whether it is
zero terminated.  This may lead to overflow inside of simple_strtoul().
Changli Gao suggested to copy not more than user supplied 'size' bytes.

It was introduced before the git epoch.  Files "ipt_CLUSTERIP/*" are
root writable only by default, however, on some setups permissions might be
relaxed to e.g. network admin user.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv4/netfilter/ipt_CLUSTERIP.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -666,8 +666,11 @@ static ssize_t clusterip_proc_write(stru
 	struct clusterip_config *c = pde->data;
 	unsigned long nodenum;
 
-	if (copy_from_user(buffer, input, PROC_WRITELEN))
+	if (size > PROC_WRITELEN)
+		return -EIO;
+	if (copy_from_user(buffer, input, size))
 		return -EFAULT;
+	buffer[size] = 0;
 
 	if (*buffer == '+') {
 		nodenum = simple_strtoul(buffer+1, NULL, 10);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 141/173] ipv6: netfilter: ip6_tables: fix infoleak to userspace
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (140 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 140/173] netfilter: ipt_CLUSTERIP: fix buffer overflow Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 142/173] drivers/rtc/rtc-ds1511.c: world-writable sysfs nvram file Willy Tarreau
                   ` (31 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Patrick McHardy, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 6a8ab060779779de8aea92ce3337ca348f973f54 upstream.

Structures ip6t_replace, compat_ip6t_replace, and xt_get_revision are
copied from userspace.  Fields of these structs that are
zero-terminated strings are not checked.  When they are used as argument
to a format string containing "%s" in request_module(), some sensitive
information is leaked to userspace via argument of spawned modprobe
process.

The first bug was introduced before the git epoch;  the second was
introduced in 3bc3fe5e (v2.6.25-rc1);  the third is introduced by
6b7d31fc (v2.6.15-rc1).  To trigger the bug one should have
CAP_NET_ADMIN.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ipv6/netfilter/ip6_tables.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -1323,6 +1323,7 @@ do_replace(struct net *net, void __user
 	/* overflow check */
 	if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
 		return -ENOMEM;
+	tmp.name[sizeof(tmp.name)-1] = 0;
 
 	newinfo = xt_alloc_table_info(tmp.size);
 	if (!newinfo)
@@ -1855,6 +1856,7 @@ compat_do_replace(struct net *net, void
 		return -ENOMEM;
 	if (tmp.num_counters >= INT_MAX / sizeof(struct xt_counters))
 		return -ENOMEM;
+	tmp.name[sizeof(tmp.name)-1] = 0;
 
 	newinfo = xt_alloc_table_info(tmp.size);
 	if (!newinfo)
@@ -2079,6 +2081,7 @@ do_ip6t_get_ctl(struct sock *sk, int cmd
 			ret = -EFAULT;
 			break;
 		}
+		rev.name[sizeof(rev.name)-1] = 0;
 
 		if (cmd == IP6T_SO_GET_REVISION_TARGET)
 			target = 1;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 142/173] drivers/rtc/rtc-ds1511.c: world-writable sysfs nvram file
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (141 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 141/173] ipv6: netfilter: ip6_tables: fix infoleak to userspace Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 143/173] econet: 4 byte infoleak to the network Willy Tarreau
                   ` (30 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Andy Sharp, Alessandro Zummo, Andrew Morton,
	Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 49d50fb1c28738ef6bad0c2b87d5355a1653fed5 upstream.

Don't allow everybogy to write to NVRAM.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Cc: Andy Sharp <andy.sharp@onstor.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/rtc/rtc-ds1511.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: longterm-2.6.27/drivers/rtc/rtc-ds1511.c
===================================================================
--- longterm-2.6.27.orig/drivers/rtc/rtc-ds1511.c	2011-01-23 10:52:24.000000000 +0100
+++ longterm-2.6.27/drivers/rtc/rtc-ds1511.c	2011-04-25 17:05:58.082277591 +0200
@@ -493,7 +493,7 @@
 static struct bin_attribute ds1511_nvram_attr = {
 	.attr = {
 		.name = "nvram",
-		.mode = S_IRUGO | S_IWUGO,
+		.mode = S_IRUGO | S_IWUSR,
 		.owner = THIS_MODULE,
 	},
 	.size = DS1511_RAM_MAX,



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 143/173] econet: 4 byte infoleak to the network
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (142 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 142/173] drivers/rtc/rtc-ds1511.c: world-writable sysfs nvram file Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 144/173] sound/oss: remove offset from load_patch callbacks Willy Tarreau
                   ` (29 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Phil Blundell, David S. Miller,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 67c5c6cb8129c595f21e88254a3fc6b3b841ae8e upstream.

struct aunhdr has 4 padding bytes between 'pad' and 'handle' fields on
x86_64.  These bytes are not initialized in the variable 'ah' before
sending 'ah' to the network.  This leads to 4 bytes kernel stack
infoleak.

This bug was introduced before the git epoch.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Phil Blundell <philb@gnu.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/econet/af_econet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -428,10 +428,10 @@ static int econet_sendmsg(struct kiocb *
 		udpdest.sin_addr.s_addr = htonl(network | addr.station);
 	}
 
+	memset(&ah, 0, sizeof(ah));
 	ah.port = port;
 	ah.cb = cb & 0x7f;
 	ah.code = 2;		/* magic */
-	ah.pad = 0;
 
 	/* tack our header on the front of the iovec */
 	size = sizeof(struct aunhdr);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 144/173] sound/oss: remove offset from load_patch callbacks
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (143 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 143/173] econet: 4 byte infoleak to the network Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 145/173] sound: oss: midi_synth: check get_user() return value Willy Tarreau
                   ` (28 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, Takashi Iwai, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit b769f49463711205d57286e64cf535ed4daf59e9 upstream.

Was: [PATCH] sound/oss/midi_synth: prevent underflow, use of
uninitialized value, and signedness issue

The offset passed to midi_synth_load_patch() can be essentially
arbitrary.  If it's greater than the header length, this will result in
a copy_from_user(dst, src, negative_val).  While this will just return
-EFAULT on x86, on other architectures this may cause memory corruption.
Additionally, the length field of the sysex_info structure may not be
initialized prior to its use.  Finally, a signed comparison may result
in an unintentionally large loop.

On suggestion by Takashi Iwai, version two removes the offset argument
from the load_patch callbacks entirely, which also resolves similar
issues in opl3.  Compile tested only.

v3 adjusts comments and hopefully gets copy offsets right.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/oss/dev_table.h  |    2 +-
 sound/oss/midi_synth.c |   30 +++++++++++++-----------------
 sound/oss/midi_synth.h |    2 +-
 sound/oss/opl3.c       |    8 ++------
 sound/oss/sequencer.c  |    2 +-
 5 files changed, 18 insertions(+), 26 deletions(-)

--- a/sound/oss/dev_table.h
+++ b/sound/oss/dev_table.h
@@ -271,7 +271,7 @@ struct synth_operations
 	void (*reset) (int dev);
 	void (*hw_control) (int dev, unsigned char *event);
 	int (*load_patch) (int dev, int format, const char __user *addr,
-	     int offs, int count, int pmgr_flag);
+	     int count, int pmgr_flag);
 	void (*aftertouch) (int dev, int voice, int pressure);
 	void (*controller) (int dev, int voice, int ctrl_num, int value);
 	void (*panning) (int dev, int voice, int value);
--- a/sound/oss/midi_synth.c
+++ b/sound/oss/midi_synth.c
@@ -476,7 +476,7 @@ EXPORT_SYMBOL(midi_synth_hw_control);
 
 int
 midi_synth_load_patch(int dev, int format, const char __user *addr,
-		      int offs, int count, int pmgr_flag)
+		      int count, int pmgr_flag)
 {
 	int             orig_dev = synth_devs[dev]->midi_dev;
 
@@ -491,33 +491,29 @@ midi_synth_load_patch(int dev, int forma
 	if (!prefix_cmd(orig_dev, 0xf0))
 		return 0;
 
+	/* Invalid patch format */
 	if (format != SYSEX_PATCH)
-	{
-/*		  printk("MIDI Error: Invalid patch format (key) 0x%x\n", format);*/
 		  return -EINVAL;
-	}
+
+	/* Patch header too short */
 	if (count < hdr_size)
-	{
-/*		printk("MIDI Error: Patch header too short\n");*/
 		return -EINVAL;
-	}
+
 	count -= hdr_size;
 
 	/*
-	 * Copy the header from user space but ignore the first bytes which have
-	 * been transferred already.
+	 * Copy the header from user space
 	 */
 
-	if(copy_from_user(&((char *) &sysex)[offs], &(addr)[offs], hdr_size - offs))
+	if (copy_from_user(&sysex, addr, hdr_size))
 		return -EFAULT;
- 
- 	if (count < sysex.len)
-	{
-/*		printk(KERN_WARNING "MIDI Warning: Sysex record too short (%d<%d)\n", count, (int) sysex.len);*/
+
+	/* Sysex record too short */
+	if ((unsigned)count < (unsigned)sysex.len)
 		sysex.len = count;
-	}
-  	left = sysex.len;
-  	src_offs = 0;
+
+	left = sysex.len;
+	src_offs = 0;
 
 	for (i = 0; i < left && !signal_pending(current); i++)
 	{
--- a/sound/oss/midi_synth.h
+++ b/sound/oss/midi_synth.h
@@ -8,7 +8,7 @@ int midi_synth_open (int dev, int mode);
 void midi_synth_close (int dev);
 void midi_synth_hw_control (int dev, unsigned char *event);
 int midi_synth_load_patch (int dev, int format, const char __user * addr,
-		 int offs, int count, int pmgr_flag);
+		 int count, int pmgr_flag);
 void midi_synth_panning (int dev, int channel, int pressure);
 void midi_synth_aftertouch (int dev, int channel, int pressure);
 void midi_synth_controller (int dev, int channel, int ctrl_num, int value);
--- a/sound/oss/opl3.c
+++ b/sound/oss/opl3.c
@@ -819,7 +819,7 @@ static void opl3_hw_control(int dev, uns
 }
 
 static int opl3_load_patch(int dev, int format, const char __user *addr,
-		int offs, int count, int pmgr_flag)
+		int count, int pmgr_flag)
 {
 	struct sbi_instrument ins;
 
@@ -829,11 +829,7 @@ static int opl3_load_patch(int dev, int
 		return -EINVAL;
 	}
 
-	/*
-	 * What the fuck is going on here?  We leave junk in the beginning
-	 * of ins and then check the field pretty close to that beginning?
-	 */
-	if(copy_from_user(&((char *) &ins)[offs], addr + offs, sizeof(ins) - offs))
+	if (copy_from_user(&ins, addr, sizeof(ins)))
 		return -EFAULT;
 
 	if (ins.channel < 0 || ins.channel >= SBFM_MAXINSTR)
--- a/sound/oss/sequencer.c
+++ b/sound/oss/sequencer.c
@@ -241,7 +241,7 @@ int sequencer_write(int dev, struct file
 				return -ENXIO;
 
 			fmt = (*(short *) &event_rec[0]) & 0xffff;
-			err = synth_devs[dev]->load_patch(dev, fmt, buf, p + 4, c, 0);
+			err = synth_devs[dev]->load_patch(dev, fmt, buf + p, c, 0);
 			if (err < 0)
 				return err;
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 145/173] sound: oss: midi_synth: check get_user() return value
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (144 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 144/173] sound/oss: remove offset from load_patch callbacks Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 146/173] repair gdbstub to match the gdbserial protocol specification Willy Tarreau
                   ` (27 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Kulikov Vasiliy, Takashi Iwai, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kulikov Vasiliy <segooon@gmail.com>

commit b3390ceab95601afc12213c3ec5551d3bc7b638f upstream.

get_user() may fail, if so return -EFAULT.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/oss/midi_synth.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/sound/oss/midi_synth.c
+++ b/sound/oss/midi_synth.c
@@ -519,7 +519,9 @@ midi_synth_load_patch(int dev, int forma
 	{
 		unsigned char   data;
 
-		get_user(*(unsigned char *) &data, (unsigned char __user *) &((addr)[hdr_size + i]));
+		if (get_user(data,
+		    (unsigned char __user *)(addr + hdr_size + i)))
+			return -EFAULT;
 
 		eox_seen = (i > 0 && data & 0x80);	/* End of sysex */
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 146/173] repair gdbstub to match the gdbserial protocol specification
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (145 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 145/173] sound: oss: midi_synth: check get_user() return value Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:04 ` [PATCH 147/173] powerpc/kexec: Add ifdef CONFIG_PPC_STD_MMU_64 to PPC64 code Willy Tarreau
                   ` (26 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jason Wessel, Dongdong Deng, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jason Wessel <jason.wessel@windriver.com>

commit fb82c0ff27b2c40c6f7a3d1a94cafb154591fa80 upstream.

The gdbserial protocol handler should return an empty packet instead
of an error string when ever it responds to a command it does not
implement.

The problem cases come from a debugger client sending
qTBuffer, qTStatus, qSearch, qSupported.

The incorrect response from the gdbstub leads the debugger clients to
not function correctly.  Recent versions of gdb will not detach correctly as a result of this behavior.

Backport-request-by: Frank Pan <frankpzh@gmail.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 kernel/kgdb.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -1001,10 +1001,8 @@ static void gdb_cmd_query(struct kgdb_st
 	switch (remcom_in_buffer[1]) {
 	case 's':
 	case 'f':
-		if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) {
-			error_packet(remcom_out_buffer, -EINVAL);
+		if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10))
 			break;
-		}
 
 		i = 0;
 		remcom_out_buffer[0] = 'm';
@@ -1045,10 +1043,9 @@ static void gdb_cmd_query(struct kgdb_st
 		pack_threadid(remcom_out_buffer + 2, thref);
 		break;
 	case 'T':
-		if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) {
-			error_packet(remcom_out_buffer, -EINVAL);
+		if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16))
 			break;
-		}
+
 		ks->threadid = 0;
 		ptr = remcom_in_buffer + 17;
 		kgdb_hex2long(&ptr, &ks->threadid);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 147/173] powerpc/kexec: Add ifdef CONFIG_PPC_STD_MMU_64 to PPC64 code
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (146 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 146/173] repair gdbstub to match the gdbserial protocol specification Willy Tarreau
@ 2011-04-25 20:04 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 148/173] powerpc: Fix default_machine_crash_shutdown #ifdef botch Willy Tarreau
                   ` (25 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:04 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review, Greg KH
  Cc: Ben Hutchings, Debian kernel maintainers, debian-release,
	Adam D. Barratt, paulmck, mikey, benh, anton, dann frazier, galak,
	Kamalesh Babulal, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>

powerpc/kexec: Add ifdef CONFIG_PPC_STD_MMU_64 to PPC64 code

This patch introduces PPC64 specific #ifdef bits from the upstream
commit: b3df895aebe091b1657a42a8c859bd49fc96646b.

Reported-and-tested-by: dann frazier <dannf@dannf.org>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/crash.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -163,6 +163,7 @@ static void crash_kexec_prepare_cpus(int
 }
 
 /* wait for all the CPUs to hit real mode but timeout if they don't come in */
+#ifdef CONFIG_PPC_STD_MMU_64
 static void crash_kexec_wait_realmode(int cpu)
 {
 	unsigned int msecs;
@@ -187,6 +188,7 @@ static void crash_kexec_wait_realmode(in
 	}
 	mb();
 }
+#endif
 
 /*
  * This function will be called by secondary cpus or by kexec cpu
@@ -445,7 +447,9 @@ void default_machine_crash_shutdown(stru
 	crash_kexec_prepare_cpus(crashing_cpu);
 	cpu_set(crashing_cpu, cpus_in_crash);
 	crash_kexec_stop_spus();
+#ifdef CONFIG_PPC_STD_MMU_64
 	crash_kexec_wait_realmode(crashing_cpu);
+#endif
 	if (ppc_md.kexec_cpu_down)
 		ppc_md.kexec_cpu_down(1, 0);
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 148/173] powerpc: Fix default_machine_crash_shutdown #ifdef botch
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (147 preceding siblings ...)
  2011-04-25 20:04 ` [PATCH 147/173] powerpc/kexec: Add ifdef CONFIG_PPC_STD_MMU_64 to PPC64 code Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 149/173] sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set Willy Tarreau
                   ` (24 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review, Greg KH
  Cc: Ben Hutchings, Debian kernel maintainers, debian-release,
	Adam D. Barratt, paulmck, mikey, benh, anton, dann frazier, galak,
	Kamalesh Babulal, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>

powerpc: Fix default_machine_crash_shutdown #ifdef botch

Commit: c2be05481f6125254c45b78f334d4dd09c701c82 upstream

crash_kexec_wait_realmode() is defined only if CONFIG_PPC_STD_MMU_64
and CONFIG_SMP, but is called if CONFIG_PPC_STD_MMU_64 even if !CONFIG_SMP.
Fix the conditional compilation around the invocation.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/crash.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -447,7 +447,7 @@ void default_machine_crash_shutdown(stru
 	crash_kexec_prepare_cpus(crashing_cpu);
 	cpu_set(crashing_cpu, cpus_in_crash);
 	crash_kexec_stop_spus();
-#ifdef CONFIG_PPC_STD_MMU_64
+#if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP)
 	crash_kexec_wait_realmode(crashing_cpu);
 #endif
 	if (ppc_md.kexec_cpu_down)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 149/173] sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (148 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 148/173] powerpc: Fix default_machine_crash_shutdown #ifdef botch Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 150/173] net: ax25: fix information leak to userland Willy Tarreau
                   ` (23 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Wei Yongjun, Vlad Yasevich, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Wei Yongjun <yjwei@cn.fujitsu.com>

commit a8170c35e738d62e9919ce5b109cf4ed66e95bde upstream.

When calculating the INIT/INIT-ACK chunk length, we should not
only account the length of parameters, but also the parameters
zero padding length, such as AUTH HMACS parameter and CHUNKS
parameter. Without the parameters zero padding length we may get
following oops.

skb_over_panic: text:ce2068d2 len:130 put:6 head:cac3fe00 data:cac3fe00 tail:0xcac3fe82 end:0xcac3fe80 dev:<NULL>
------------[ cut here ]------------
kernel BUG at net/core/skbuff.c:127!
invalid opcode: 0000 [#2] SMP
last sysfs file: /sys/module/aes_generic/initstate
Modules linked in: authenc ......

Pid: 4102, comm: sctp_darn Tainted: G      D    2.6.34-rc2 #6
EIP: 0060:[<c0607630>] EFLAGS: 00010282 CPU: 0
EIP is at skb_over_panic+0x37/0x3e
EAX: 00000078 EBX: c07c024b ECX: c07c02b9 EDX: cb607b78
ESI: 00000000 EDI: cac3fe7a EBP: 00000002 ESP: cb607b74
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process sctp_darn (pid: 4102, ti=cb607000 task=cabdc990 task.ti=cb607000)
Stack:
 c07c02b9 ce2068d2 00000082 00000006 cac3fe00 cac3fe00 cac3fe82 cac3fe80
<0> c07c024b cac3fe7c cac3fe7a c0608dec ca986e80 ce2068d2 00000006 0000007a
<0> cb8120ca ca986e80 cb812000 00000003 cb8120c4 ce208a25 cb8120ca cadd9400
Call Trace:
 [<ce2068d2>] ? sctp_addto_chunk+0x45/0x85 [sctp]
 [<c0608dec>] ? skb_put+0x2e/0x32
 [<ce2068d2>] ? sctp_addto_chunk+0x45/0x85 [sctp]
 [<ce208a25>] ? sctp_make_init+0x279/0x28c [sctp]
 [<c0686a92>] ? apic_timer_interrupt+0x2a/0x30
 [<ce1fdc0b>] ? sctp_sf_do_prm_asoc+0x2b/0x7b [sctp]
 [<ce202823>] ? sctp_do_sm+0xa0/0x14a [sctp]
 [<ce2133b9>] ? sctp_pname+0x0/0x14 [sctp]
 [<ce211d72>] ? sctp_primitive_ASSOCIATE+0x2b/0x31 [sctp]
 [<ce20f3cf>] ? sctp_sendmsg+0x7a0/0x9eb [sctp]
 [<c064eb1e>] ? inet_sendmsg+0x3b/0x43
 [<c04244b7>] ? task_tick_fair+0x2d/0xd9
 [<c06031e1>] ? sock_sendmsg+0xa7/0xc1
 [<c0416afe>] ? smp_apic_timer_interrupt+0x6b/0x75
 [<c0425123>] ? dequeue_task_fair+0x34/0x19b
 [<c0446abb>] ? sched_clock_local+0x17/0x11e
 [<c052ea87>] ? _copy_from_user+0x2b/0x10c
 [<c060ab3a>] ? verify_iovec+0x3c/0x6a
 [<c06035ca>] ? sys_sendmsg+0x186/0x1e2
 [<c042176b>] ? __wake_up_common+0x34/0x5b
 [<c04240c2>] ? __wake_up+0x2c/0x3b
 [<c057e35c>] ? tty_wakeup+0x43/0x47
 [<c04430f2>] ? remove_wait_queue+0x16/0x24
 [<c0580c94>] ? n_tty_read+0x5b8/0x65e
 [<c042be02>] ? default_wake_function+0x0/0x8
 [<c0604e0e>] ? sys_socketcall+0x17f/0x1cd
 [<c040264c>] ? sysenter_do_call+0x12/0x22
Code: 0f 45 de 53 ff b0 98 00 00 00 ff b0 94 ......
EIP: [<c0607630>] skb_over_panic+0x37/0x3e SS:ESP 0068:cb607b74

To reproduce:

# modprobe sctp
# echo 1 > /proc/sys/net/sctp/addip_enable
# echo 1 > /proc/sys/net/sctp/auth_enable
# sctp_test -H 3ffe:501:ffff:100:20c:29ff:fe4d:f37e -P 800 -l
# sctp_darn -H 3ffe:501:ffff:100:20c:29ff:fe4d:f37e -P 900 -h 192.168.0.21 -p 800 -I -s -t
sctp_darn ready to send...
3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> bindx-add=192.168.0.21
3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> bindx-add=192.168.1.21
3ffe:501:ffff:100:20c:29ff:fe4d:f37e:900-192.168.0.21:800 Interactive mode> snd=10

------------------------------------------------------------------
eth0 has addresses: 3ffe:501:ffff:100:20c:29ff:fe4d:f37e and 192.168.0.21
eth1 has addresses: 192.168.1.21
------------------------------------------------------------------

Reported-by: George Cheimonidis <gchimon@gmail.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/sctp/sm_make_chunk.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -230,7 +230,8 @@ struct sctp_chunk *sctp_make_init(const
 	sp = sctp_sk(asoc->base.sk);
 	num_types = sp->pf->supported_addrs(sp, types);
 
-	chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types);
+	chunksize = sizeof(init) + addrs_len;
+	chunksize += WORD_ROUND(SCTP_SAT_LEN(num_types));
 	chunksize += sizeof(ecap_param);
 
 	if (sctp_prsctp_enable)
@@ -260,14 +261,14 @@ struct sctp_chunk *sctp_make_init(const
 		/* Add HMACS parameter length if any were defined */
 		auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;
 		if (auth_hmacs->length)
-			chunksize += ntohs(auth_hmacs->length);
+			chunksize += WORD_ROUND(ntohs(auth_hmacs->length));
 		else
 			auth_hmacs = NULL;
 
 		/* Add CHUNKS parameter length */
 		auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;
 		if (auth_chunks->length)
-			chunksize += ntohs(auth_chunks->length);
+			chunksize += WORD_ROUND(ntohs(auth_chunks->length));
 		else
 			auth_chunks = NULL;
 
@@ -277,7 +278,8 @@ struct sctp_chunk *sctp_make_init(const
 
 	/* If we have any extensions to report, account for that */
 	if (num_ext)
-		chunksize += sizeof(sctp_supported_ext_param_t) + num_ext;
+		chunksize += WORD_ROUND(sizeof(sctp_supported_ext_param_t) +
+					num_ext);
 
 	/* RFC 2960 3.3.2 Initiation (INIT) (1)
 	 *
@@ -419,13 +421,13 @@ struct sctp_chunk *sctp_make_init_ack(co
 
 		auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;
 		if (auth_hmacs->length)
-			chunksize += ntohs(auth_hmacs->length);
+			chunksize += WORD_ROUND(ntohs(auth_hmacs->length));
 		else
 			auth_hmacs = NULL;
 
 		auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;
 		if (auth_chunks->length)
-			chunksize += ntohs(auth_chunks->length);
+			chunksize += WORD_ROUND(ntohs(auth_chunks->length));
 		else
 			auth_chunks = NULL;
 
@@ -434,7 +436,8 @@ struct sctp_chunk *sctp_make_init_ack(co
 	}
 
 	if (num_ext)
-		chunksize += sizeof(sctp_supported_ext_param_t) + num_ext;
+		chunksize += WORD_ROUND(sizeof(sctp_supported_ext_param_t) +
+					num_ext);
 
 	/* Now allocate and fill out the chunk.  */
 	retval = sctp_make_chunk(asoc, SCTP_CID_INIT_ACK, 0, chunksize);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 150/173] net: ax25: fix information leak to userland
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (149 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 149/173] sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 151/173] net: packet: " Willy Tarreau
                   ` (22 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, David S. Miller, Moritz Muehlenhoff,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segooon@gmail.com>

commit fe10ae53384e48c51996941b7720ee16995cbcb7 upstream.

Sometimes ax25_getname() doesn't initialize all members of fsa_digipeater
field of fsa struct, also the struct has padding bytes between
sax25_call and sax25_ndigis fields.  This structure is then copied to
userland.  It leads to leaking of contents of kernel stack memory.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ax25/af_ax25.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -1391,6 +1391,7 @@ static int ax25_getname(struct socket *s
 	ax25_cb *ax25;
 	int err = 0;
 
+	memset(fsa, 0, sizeof(fsa));
 	lock_sock(sk);
 	ax25 = ax25_sk(sk);
 
@@ -1402,7 +1403,6 @@ static int ax25_getname(struct socket *s
 
 		fsa->fsa_ax25.sax25_family = AF_AX25;
 		fsa->fsa_ax25.sax25_call   = ax25->dest_addr;
-		fsa->fsa_ax25.sax25_ndigis = 0;
 
 		if (ax25->digipeat != NULL) {
 			ndigi = ax25->digipeat->ndigi;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 151/173] net: packet: fix information leak to userland
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (150 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 150/173] net: ax25: fix information leak to userland Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 152/173] ext4: fix credits computing for indirect mapped files Willy Tarreau
                   ` (21 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, David S. Miller, Moritz Muehlenhoff,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segooon@gmail.com>

commit 67286640f638f5ad41a946b9a3dc75327950248f upstream.

packet_getname_spkt() doesn't initialize all members of sa_data field of
sockaddr struct if strlen(dev->name) < 13.  This structure is then copied
to userland.  It leads to leaking of contents of kernel stack memory.
We have to fully fill sa_data with strncpy() instead of strlcpy().

The same with packet_getname(): it doesn't initialize sll_pkttype field of
sockaddr_ll.  Set it to zero.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
[jmm: Backported to 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/packet/af_packet.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1526,7 +1526,7 @@ static int packet_getname_spkt(struct so
 	uaddr->sa_family = AF_PACKET;
 	dev = dev_get_by_index(sock_net(sk), pkt_sk(sk)->ifindex);
 	if (dev) {
-		strlcpy(uaddr->sa_data, dev->name, 15);
+		strncpy(uaddr->sa_data, dev->name, 14);
 		dev_put(dev);
 	} else
 		memset(uaddr->sa_data, 0, 14);
@@ -1549,6 +1549,7 @@ static int packet_getname(struct socket
 	sll->sll_family = AF_PACKET;
 	sll->sll_ifindex = po->ifindex;
 	sll->sll_protocol = po->num;
+	sll->sll_pkttype = 0;
 	dev = dev_get_by_index(sock_net(sk), po->ifindex);
 	if (dev) {
 		sll->sll_hatype = dev->type;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 152/173] ext4: fix credits computing for indirect mapped files
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (151 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 151/173] net: packet: " Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 153/173] nfsd: fix auth_domain reference leak on nlm operations Willy Tarreau
                   ` (20 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Yongqiang Yang, Theodore Tso, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Yongqiang Yang <xiaoqiangnk@gmail.com>

commit 5b41395fcc0265fc9f193aef9df39ce49d64677c upstream.

When writing a contiguous set of blocks, two indirect blocks could be
needed depending on how the blocks are aligned, so we need to increase
the number of credits needed by one.

[ Also fixed a another bug which could further underestimate the
  number of journal credits needed by 1; the code was using integer
  division instead of DIV_ROUND_UP() -- tytso]

Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ext4/inode.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -5458,13 +5458,12 @@ static int ext4_indirect_trans_blocks(st
 	/* if nrblocks are contiguous */
 	if (chunk) {
 		/*
-		 * With N contiguous data blocks, it need at most
-		 * N/EXT4_ADDR_PER_BLOCK(inode->i_sb) indirect blocks
-		 * 2 dindirect blocks
-		 * 1 tindirect block
+		 * With N contiguous data blocks, we need at most
+		 * N/EXT4_ADDR_PER_BLOCK(inode->i_sb) + 1 indirect blocks,
+		 * 2 dindirect blocks, and 1 tindirect block
 		 */
-		indirects = nrblocks / EXT4_ADDR_PER_BLOCK(inode->i_sb);
-		return indirects + 3;
+		return DIV_ROUND_UP(nrblocks,
+				    EXT4_ADDR_PER_BLOCK(inode->i_sb)) + 4;
 	}
 	/*
 	 * if nrblocks are not contiguous, worse case, each block touch



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 153/173] nfsd: fix auth_domain reference leak on nlm operations
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (152 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 152/173] ext4: fix credits computing for indirect mapped files Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 154/173] net: tipc: fix information leak to userland Willy Tarreau
                   ` (19 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Neil Brown, J. Bruce Fields, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: J. Bruce Fields <bfields@redhat.com>

commit 954032d2527f2fce7355ba70709b5e143d6b686f upstream.

This was noticed by users who performed more than 2^32 lock operations
and hence made this counter overflow (eventually leading to
use-after-free's).  Setting rq_client to NULL here means that it won't
later get auth_domain_put() when it should be.

Appears to have been introduced in 2.5.42 by "[PATCH] kNFSd: Move auth
domain lookup into svcauth" which moved most of the rq_client handling
to common svcauth code, but left behind this one line.

Cc: Neil Brown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/nfsd/lockd.c |    1 -
 1 file changed, 1 deletion(-)

--- a/fs/nfsd/lockd.c
+++ b/fs/nfsd/lockd.c
@@ -44,7 +44,6 @@ nlm_fopen(struct svc_rqst *rqstp, struct
 	exp_readlock();
 	nfserr = nfsd_open(rqstp, &fh, S_IFREG, NFSD_MAY_LOCK, filp);
 	fh_put(&fh);
-	rqstp->rq_client = NULL;
 	exp_readunlock();
  	/* We return nlm error codes as nlm doesn't know
 	 * about nfsd, but nfsd does know about nlm..



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 154/173] net: tipc: fix information leak to userland
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (153 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 153/173] nfsd: fix auth_domain reference leak on nlm operations Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 155/173] inet_diag: Make sure we actually run the same bytecode we audited Willy Tarreau
                   ` (18 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, David S. Miller, Moritz Muehlenhoff,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kulikov Vasiliy <segooon@gmail.com>

commit 88f8a5e3e7defccd3925cabb1ee4d3994e5cdb52 upstream.

Structure sockaddr_tipc is copied to userland with padding bytes after
"id" field in union field "name" unitialized.  It leads to leaking of
contents of kernel stack memory.  We have to initialize them to zero.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/tipc/socket.c |    1 +
 1 file changed, 1 insertion(+)

--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -393,6 +393,7 @@ static int get_name(struct socket *sock,
 	struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;
 	struct tipc_sock *tsock = tipc_sk(sock->sk);
 
+	memset(addr, 0, sizeof(*addr));
 	if (peer) {
 		if ((sock->state != SS_CONNECTED) &&
 			((peer != 2) || (sock->state != SS_DISCONNECTING)))



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 155/173] inet_diag: Make sure we actually run the same bytecode we audited.
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (154 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 154/173] net: tipc: fix information leak to userland Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 156/173] econet: Fix crash in aun_incoming() Willy Tarreau
                   ` (17 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Nelson Elhage, Thomas Graf, David S. Miller, Moritz Muehlenhoff,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Nelson Elhage <nelhage@ksplice.com>

commit 22e76c849d505d87c5ecf3d3e6742a65f0ff4860 upstream.

We were using nlmsg_find_attr() to look up the bytecode by attribute when
auditing, but then just using the first attribute when actually running
bytecode. So, if we received a message with two attribute elements, where only
the second had type INET_DIAG_REQ_BYTECODE, we would validate and run different
bytecode strings.

Fix this by consistently using nlmsg_find_attr everywhere.

Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: Thomas Graf <tgraf@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[jmm: Slightly adapted to apply against 2.6.32]
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 net/ipv4/inet_diag.c |   27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -489,9 +489,11 @@ static int inet_csk_diag_dump(struct soc
 {
 	struct inet_diag_req *r = NLMSG_DATA(cb->nlh);
 
-	if (cb->nlh->nlmsg_len > 4 + NLMSG_SPACE(sizeof(*r))) {
+	if (nlmsg_attrlen(cb->nlh, sizeof(*r))) {
 		struct inet_diag_entry entry;
-		struct rtattr *bc = (struct rtattr *)(r + 1);
+		const struct nlattr *bc = nlmsg_find_attr(cb->nlh,
+							  sizeof(*r),
+							  INET_DIAG_REQ_BYTECODE);
 		struct inet_sock *inet = inet_sk(sk);
 
 		entry.family = sk->sk_family;
@@ -511,7 +513,7 @@ static int inet_csk_diag_dump(struct soc
 		entry.dport = ntohs(inet->dport);
 		entry.userlocks = sk->sk_userlocks;
 
-		if (!inet_diag_bc_run(RTA_DATA(bc), RTA_PAYLOAD(bc), &entry))
+		if (!inet_diag_bc_run(nla_data(bc), nla_len(bc), &entry))
 			return 0;
 	}
 
@@ -526,9 +528,11 @@ static int inet_twsk_diag_dump(struct in
 {
 	struct inet_diag_req *r = NLMSG_DATA(cb->nlh);
 
-	if (cb->nlh->nlmsg_len > 4 + NLMSG_SPACE(sizeof(*r))) {
+	if (nlmsg_attrlen(cb->nlh, sizeof(*r))) {
 		struct inet_diag_entry entry;
-		struct rtattr *bc = (struct rtattr *)(r + 1);
+		const struct nlattr *bc = nlmsg_find_attr(cb->nlh,
+							  sizeof(*r),
+							  INET_DIAG_REQ_BYTECODE);
 
 		entry.family = tw->tw_family;
 #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
@@ -547,7 +551,7 @@ static int inet_twsk_diag_dump(struct in
 		entry.dport = ntohs(tw->tw_dport);
 		entry.userlocks = 0;
 
-		if (!inet_diag_bc_run(RTA_DATA(bc), RTA_PAYLOAD(bc), &entry))
+		if (!inet_diag_bc_run(nla_data(bc), nla_len(bc), &entry))
 			return 0;
 	}
 
@@ -617,7 +621,7 @@ static int inet_diag_dump_reqs(struct sk
 	struct inet_diag_req *r = NLMSG_DATA(cb->nlh);
 	struct inet_connection_sock *icsk = inet_csk(sk);
 	struct listen_sock *lopt;
-	struct rtattr *bc = NULL;
+	const struct nlattr *bc = NULL;
 	struct inet_sock *inet = inet_sk(sk);
 	int j, s_j;
 	int reqnum, s_reqnum;
@@ -637,8 +641,9 @@ static int inet_diag_dump_reqs(struct sk
 	if (!lopt || !lopt->qlen)
 		goto out;
 
-	if (cb->nlh->nlmsg_len > 4 + NLMSG_SPACE(sizeof(*r))) {
-		bc = (struct rtattr *)(r + 1);
+	if (nlmsg_attrlen(cb->nlh, sizeof(*r))) {
+		bc = nlmsg_find_attr(cb->nlh, sizeof(*r),
+				     INET_DIAG_REQ_BYTECODE);
 		entry.sport = inet->num;
 		entry.userlocks = sk->sk_userlocks;
 	}
@@ -671,8 +676,8 @@ static int inet_diag_dump_reqs(struct sk
 					&ireq->rmt_addr;
 				entry.dport = ntohs(ireq->rmt_port);
 
-				if (!inet_diag_bc_run(RTA_DATA(bc),
-						    RTA_PAYLOAD(bc), &entry))
+				if (!inet_diag_bc_run(nla_data(bc),
+						      nla_len(bc), &entry))
 					continue;
 			}
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 156/173] econet: Fix crash in aun_incoming().
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (155 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 155/173] inet_diag: Make sure we actually run the same bytecode we audited Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 157/173] irda: prevent integer underflow in IRLMP_ENUMDEVICES Willy Tarreau
                   ` (16 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: David S. Miller, Moritz Muehlenhoff, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: David S. Miller <davem@davemloft.net>

commit 4e085e76cbe558b79b54cbab772f61185879bc64 upstream.

Unconditional use of skb->dev won't work here,
try to fetch the econet device via skb_dst()->dev
instead.

Suggested by Eric Dumazet.

Reported-by: Nelson Elhage <nelhage@ksplice.com>
Tested-by: Nelson Elhage <nelhage@ksplice.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
[jmm: Slightly adapted for 2.6.32]
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/econet/af_econet.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: longterm-2.6.27/net/econet/af_econet.c
===================================================================
--- longterm-2.6.27.orig/net/econet/af_econet.c	2011-04-25 18:51:48.591279239 +0200
+++ longterm-2.6.27/net/econet/af_econet.c	2011-04-25 18:59:35.943279187 +0200
@@ -845,9 +845,13 @@
 {
 	struct iphdr *ip = ip_hdr(skb);
 	unsigned char stn = ntohl(ip->saddr) & 0xff;
+	struct dst_entry *dst = skb->dst;
+	struct ec_device *edev = NULL;
 	struct sock *sk;
 	struct sk_buff *newskb;
-	struct ec_device *edev = skb->dev->ec_ptr;
+
+	if (dst)
+		edev = dst->dev->ec_ptr;
 
 	if (! edev)
 		goto bad;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 157/173] irda: prevent integer underflow in IRLMP_ENUMDEVICES
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (156 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 156/173] econet: Fix crash in aun_incoming() Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 158/173] CAN: Use inode instead of kernel address for /proc file Willy Tarreau
                   ` (15 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, David S. Miller, Moritz Muehlenhoff,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit fdac1e0697356ac212259f2147aa60c72e334861 upstream.

If the user-provided len is less than the expected offset, the
IRLMP_ENUMDEVICES getsockopt will do a copy_to_user() with a very large
size value.  While this isn't be a security issue on x86 because it will
get caught by the access_ok() check, it may leak large amounts of kernel
heap on other architectures.  In any event, this patch fixes it.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


---
 net/irda/af_irda.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -2164,6 +2164,14 @@ static int irda_getsockopt(struct socket
 
 	switch (optname) {
 	case IRLMP_ENUMDEVICES:
+
+		/* Offset to first device entry */
+		offset = sizeof(struct irda_device_list) -
+			sizeof(struct irda_device_info);
+
+		if (len < offset)
+			return -EINVAL;
+
 		/* Ask lmp for the current discovery log */
 		discoveries = irlmp_get_discoveries(&list.len, self->mask.word,
 						    self->nslots);
@@ -2173,15 +2181,9 @@ static int irda_getsockopt(struct socket
 		err = 0;
 
 		/* Write total list length back to client */
-		if (copy_to_user(optval, &list,
-				 sizeof(struct irda_device_list) -
-				 sizeof(struct irda_device_info)))
+		if (copy_to_user(optval, &list, offset))
 			err = -EFAULT;
 
-		/* Offset to first device entry */
-		offset = sizeof(struct irda_device_list) -
-			sizeof(struct irda_device_info);
-
 		/* Copy the list itself - watch for overflow */
 		if(list.len > 2048)
 		{



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 158/173] CAN: Use inode instead of kernel address for /proc file
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (157 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 157/173] irda: prevent integer underflow in IRLMP_ENUMDEVICES Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 159/173] exec: make argv/envp memory visible to oom-killer Willy Tarreau
                   ` (14 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Dan Rosenberg, Oliver Hartkopp, David S. Miller,
	Moritz Muehlenhoff, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Dan Rosenberg <drosenberg@vsecurity.com>

commit 9f260e0efa4766e56d0ac14f1aeea6ee5eb8fe83 upstream.

Since the socket address is just being used as a unique identifier, its
inode number is an alternative that does not leak potentially sensitive
information.

CC-ing stable because MITRE has assigned CVE-2010-4565 to the issue.

Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/can/bcm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: longterm-2.6.27/net/can/bcm.c
===================================================================
--- longterm-2.6.27.orig/net/can/bcm.c	2011-01-29 11:22:46.000000000 +0100
+++ longterm-2.6.27/net/can/bcm.c	2011-04-25 17:20:40.456278152 +0200
@@ -121,7 +121,7 @@
 	struct list_head tx_ops;
 	unsigned long dropped_usr_msgs;
 	struct proc_dir_entry *bcm_proc_read;
-	char procname [20]; /* pointer printed in ASCII with \0 */
+	char procname [32]; /* inode number in decimal with \0 */
 };
 
 static inline struct bcm_sock *bcm_sk(const struct sock *sk)
@@ -1479,7 +1479,7 @@
 
 	if (proc_dir) {
 		/* unique socket address as filename */
-		sprintf(bo->procname, "%p", sock);
+		sprintf(bo->procname, "%lu", sock_i_ino(sk));
 		bo->bcm_proc_read = create_proc_read_entry(bo->procname, 0644,
 							   proc_dir,
 							   bcm_read_proc, sk);



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 159/173] exec: make argv/envp memory visible to oom-killer
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (158 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 158/173] CAN: Use inode instead of kernel address for /proc file Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 160/173] exec: copy-and-paste the fixes into compat_do_execve() paths Willy Tarreau
                   ` (13 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Oleg Nesterov, Linus Torvalds, Moritz Muehlenhoff,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Oleg Nesterov <oleg@redhat.com>

commit 3c77f845722158206a7209c45ccddc264d19319c upstream.

Brad Spengler published a local memory-allocation DoS that
evades the OOM-killer (though not the virtual memory RLIMIT):
http://www.grsecurity.net/~spender/64bit_dos.c

execve()->copy_strings() can allocate a lot of memory, but
this is not visible to oom-killer, nobody can see the nascent
bprm->mm and take it into account.

With this patch get_arg_page() increments current's MM_ANONPAGES
counter every time we allocate the new page for argv/envp. When
do_execve() succeds or fails, we change this counter back.

Technically this is not 100% correct, we can't know if the new
page is swapped out and turn MM_ANONPAGES into MM_SWAPENTS, but
I don't think this really matters and everything becomes correct
once exec changes ->mm or fails.

Reported-by: Brad Spengler <spender@grsecurity.net>
Reviewed-and-discussed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/exec.c               |   28 ++++++++++++++++++++++++++--
 include/linux/binfmts.h |    1 +
 2 files changed, 27 insertions(+), 2 deletions(-)

Index: longterm-2.6.27/fs/exec.c
===================================================================
--- longterm-2.6.27.orig/fs/exec.c	2011-02-09 22:45:33.000000000 +0100
+++ longterm-2.6.27/fs/exec.c	2011-04-25 17:22:50.655279537 +0200
@@ -168,6 +168,21 @@
 
 #ifdef CONFIG_MMU
 
+static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
+{
+	struct mm_struct *mm = current->mm;
+	long diff = (long)(pages - bprm->vma_pages);
+
+	if (!mm || !diff)
+		return;
+
+	bprm->vma_pages = pages;
+
+	down_write(&mm->mmap_sem);
+	mm->total_vm += diff;
+	up_write(&mm->mmap_sem);
+}
+
 static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
 		int write)
 {
@@ -190,6 +205,8 @@
 		unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start;
 		struct rlimit *rlim;
 
+		acct_arg_size(bprm, size / PAGE_SIZE);
+
 		/*
 		 * We've historically supported up to 32 pages (ARG_MAX)
 		 * of argument strings even with small stacks
@@ -291,6 +308,10 @@
 
 #else
 
+static inline void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
+{
+}
+
 static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
 		int write)
 {
@@ -995,6 +1016,7 @@
 	/*
 	 * Release all of the old mmap stuff
 	 */
+	acct_arg_size(bprm, 0);
 	retval = exec_mmap(bprm->mm);
 	if (retval)
 		goto out;
@@ -1378,8 +1400,10 @@
 		security_bprm_free(bprm);
 
 out_mm:
-	if (bprm->mm)
+	if (bprm->mm) {
+		acct_arg_size(bprm, 0);
 		mmput (bprm->mm);
+	}
 
 out_file:
 	if (bprm->file) {
Index: longterm-2.6.27/include/linux/binfmts.h
===================================================================
--- longterm-2.6.27.orig/include/linux/binfmts.h	2011-01-23 10:52:34.000000000 +0100
+++ longterm-2.6.27/include/linux/binfmts.h	2011-04-25 17:22:24.856278432 +0200
@@ -28,6 +28,7 @@
 	char buf[BINPRM_BUF_SIZE];
 #ifdef CONFIG_MMU
 	struct vm_area_struct *vma;
+	unsigned long vma_pages;
 #else
 # define MAX_ARG_PAGES	32
 	struct page *page[MAX_ARG_PAGES];



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 160/173] exec: copy-and-paste the fixes into compat_do_execve() paths
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (159 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 159/173] exec: make argv/envp memory visible to oom-killer Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 161/173] xfs: zero proper structure size for geometry calls Willy Tarreau
                   ` (12 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Oleg Nesterov, KOSAKI Motohiro, Linus Torvalds, Andi Kleen,
	Moritz Muehlenhoff, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Oleg Nesterov <oleg@redhat.com>

commit 114279be2120a916e8a04feeb2ac976a10016f2f upstream.

Note: this patch targets 2.6.37 and tries to be as simple as possible.
That is why it adds more copy-and-paste horror into fs/compat.c and
uglifies fs/exec.c, this will be cleanuped later.

compat_copy_strings() plays with bprm->vma/mm directly and thus has
two problems: it lacks the RLIMIT_STACK check and argv/envp memory
is not visible to oom killer.

Export acct_arg_size() and get_arg_page(), change compat_copy_strings()
to use get_arg_page(), change compat_do_execve() to do acct_arg_size(0)
as do_execve() does.

Add the fatal_signal_pending/cond_resched checks into compat_count() and
compat_copy_strings(), this matches the code in fs/exec.c and certainly
makes sense.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/compat.c             |   28 +++++++++++++++-------------
 fs/exec.c               |    8 ++++----
 include/linux/binfmts.h |    4 ++++
 3 files changed, 23 insertions(+), 17 deletions(-)

Index: longterm-2.6.27/fs/compat.c
===================================================================
--- longterm-2.6.27.orig/fs/compat.c	2011-01-23 10:52:28.000000000 +0100
+++ longterm-2.6.27/fs/compat.c	2011-04-25 17:24:25.210282944 +0200
@@ -1241,6 +1241,10 @@
 			argv++;
 			if(++i > max)
 				return -E2BIG;
+
+			if (fatal_signal_pending(current))
+				return -ERESTARTNOHAND;
+			cond_resched();
 		}
 	}
 	return i;
@@ -1282,6 +1286,12 @@
 		while (len > 0) {
 			int offset, bytes_to_copy;
 
+			if (fatal_signal_pending(current)) {
+				ret = -ERESTARTNOHAND;
+				goto out;
+			}
+			cond_resched();
+
 			offset = pos % PAGE_SIZE;
 			if (offset == 0)
 				offset = PAGE_SIZE;
@@ -1298,18 +1308,8 @@
 			if (!kmapped_page || kpos != (pos & PAGE_MASK)) {
 				struct page *page;
 
-#ifdef CONFIG_STACK_GROWSUP
-				ret = expand_stack_downwards(bprm->vma, pos);
-				if (ret < 0) {
-					/* We've exceed the stack rlimit. */
-					ret = -E2BIG;
-					goto out;
-				}
-#endif
-				ret = get_user_pages(current, bprm->mm, pos,
-						     1, 1, 1, &page, NULL);
-				if (ret <= 0) {
-					/* We've exceed the stack rlimit. */
+				page = get_arg_page(bprm, pos, 1);
+				if (!page) {
 					ret = -E2BIG;
 					goto out;
 				}
@@ -1425,8 +1425,10 @@
 		security_bprm_free(bprm);
 
 out_mm:
-	if (bprm->mm)
+	if (bprm->mm) {
+		acct_arg_size(bprm, 0);
 		mmput(bprm->mm);
+	}
 
 out_file:
 	if (bprm->file) {
Index: longterm-2.6.27/fs/exec.c
===================================================================
--- longterm-2.6.27.orig/fs/exec.c	2011-04-25 17:22:50.000000000 +0200
+++ longterm-2.6.27/fs/exec.c	2011-04-25 17:23:56.746278475 +0200
@@ -168,7 +168,7 @@
 
 #ifdef CONFIG_MMU
 
-static void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
+void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
 {
 	struct mm_struct *mm = current->mm;
 	long diff = (long)(pages - bprm->vma_pages);
@@ -183,7 +183,7 @@
 	up_write(&mm->mmap_sem);
 }
 
-static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
+struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
 		int write)
 {
 	struct page *page;
@@ -308,11 +308,11 @@
 
 #else
 
-static inline void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
+void acct_arg_size(struct linux_binprm *bprm, unsigned long pages)
 {
 }
 
-static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
+struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
 		int write)
 {
 	struct page *page;
Index: longterm-2.6.27/include/linux/binfmts.h
===================================================================
--- longterm-2.6.27.orig/include/linux/binfmts.h	2011-04-25 17:22:24.000000000 +0200
+++ longterm-2.6.27/include/linux/binfmts.h	2011-04-25 17:23:56.751278452 +0200
@@ -53,6 +53,10 @@
 	unsigned long loader, exec;
 };
 
+extern void acct_arg_size(struct linux_binprm *bprm, unsigned long pages);
+extern struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,
+					int write);
+
 #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0
 #define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT)
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 161/173] xfs: zero proper structure size for geometry calls
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (160 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 160/173] exec: copy-and-paste the fixes into compat_do_execve() paths Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 162/173] [media] video: sn9c102: world-wirtable sysfs files Willy Tarreau
                   ` (11 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Alex Elder, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alex Elder <aelder@sgi.com>

commit af24ee9ea8d532e16883251a6684dfa1be8eec29 upstream.

Commit 493f3358cb289ccf716c5a14fa5bb52ab75943e5 added this call to
xfs_fs_geometry() in order to avoid passing kernel stack data back
to user space:

+       memset(geo, 0, sizeof(*geo));

Unfortunately, one of the callers of that function passes the
address of a smaller data type, cast to fit the type that
xfs_fs_geometry() requires.  As a result, this can happen:

Kernel panic - not syncing: stack-protector: Kernel stack is corrupted
in: f87aca93

Pid: 262, comm: xfs_fsr Not tainted 2.6.38-rc6-493f3358cb2+ #1
Call Trace:

[<c12991ac>] ? panic+0x50/0x150
[<c102ed71>] ? __stack_chk_fail+0x10/0x18
[<f87aca93>] ? xfs_ioc_fsgeometry_v1+0x56/0x5d [xfs]

Fix this by fixing that one caller to pass the right type and then
copy out the subset it is interested in.

Note: This patch is an alternative to one originally proposed by
Eric Sandeen.

Reported-by: Jeffrey Hundstad <jeffrey.hundstad@mnsu.edu>
Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Tested-by: Jeffrey Hundstad <jeffrey.hundstad@mnsu.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/xfs/linux-2.6/xfs_ioctl.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -697,14 +697,19 @@ xfs_ioc_fsgeometry_v1(
 	xfs_mount_t		*mp,
 	void			__user *arg)
 {
-	xfs_fsop_geom_v1_t	fsgeo;
+	xfs_fsop_geom_t         fsgeo;
 	int			error;
 
-	error = xfs_fs_geometry(mp, (xfs_fsop_geom_t *)&fsgeo, 3);
+	error = xfs_fs_geometry(mp, &fsgeo, 3);
 	if (error)
 		return -error;
 
-	if (copy_to_user(arg, &fsgeo, sizeof(fsgeo)))
+	/*
+	 * Caller should have passed an argument of type
+	 * xfs_fsop_geom_v1_t.  This is a proper subset of the
+	 * xfs_fsop_geom_t that xfs_fs_geometry() fills in.
+	 */
+	if (copy_to_user(arg, &fsgeo, sizeof(xfs_fsop_geom_v1_t)))
 		return -XFS_ERROR(EFAULT);
 	return 0;
 }



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 162/173] [media] video: sn9c102: world-wirtable sysfs files
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (161 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 161/173] xfs: zero proper structure size for geometry calls Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 163/173] x86: Fix a bogus unwind annotation in lib/semaphore_32.S Willy Tarreau
                   ` (10 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Vasiliy Kulikov, Mauro Carvalho Chehab, Luca Risolia,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Vasiliy Kulikov <segoon@openwall.com>

commit 14ddc3188d50855ae2a419a6aced995e2834e5d4 upstream.

Don't allow everybody to change video settings.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/media/video/sn9c102/sn9c102_core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -1430,9 +1430,9 @@ static DEVICE_ATTR(i2c_reg, S_IRUGO | S_
 		   sn9c102_show_i2c_reg, sn9c102_store_i2c_reg);
 static DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR,
 		   sn9c102_show_i2c_val, sn9c102_store_i2c_val);
-static DEVICE_ATTR(green, S_IWUGO, NULL, sn9c102_store_green);
-static DEVICE_ATTR(blue, S_IWUGO, NULL, sn9c102_store_blue);
-static DEVICE_ATTR(red, S_IWUGO, NULL, sn9c102_store_red);
+static DEVICE_ATTR(green, S_IWUSR, NULL, sn9c102_store_green);
+static DEVICE_ATTR(blue, S_IWUSR, NULL, sn9c102_store_blue);
+static DEVICE_ATTR(red, S_IWUSR, NULL, sn9c102_store_red);
 static DEVICE_ATTR(frame_header, S_IRUGO, sn9c102_show_frame_header, NULL);
 
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 163/173] x86: Fix a bogus unwind annotation in lib/semaphore_32.S
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (162 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 162/173] [media] video: sn9c102: world-wirtable sysfs files Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 164/173] [IA64] tioca: Fix assignment from incompatible pointer warnings Willy Tarreau
                   ` (9 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jan Beulich, Ingo Molnar, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jan Beulich <JBeulich@novell.com>

commit e938c287ea8d977e079f07464ac69923412663ce upstream.

'simple' would have required specifying current frame address
and return address location manually, but that's obviously not
the case (and not necessary) here.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
LKML-Reference: <4D6D1082020000780003454C@vpn.id2.novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/lib/semaphore_32.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/lib/semaphore_32.S
+++ b/arch/x86/lib/semaphore_32.S
@@ -36,7 +36,7 @@
  */
 #ifdef CONFIG_SMP
 ENTRY(__write_lock_failed)
-	CFI_STARTPROC simple
+	CFI_STARTPROC
 	FRAME
 2: 	LOCK_PREFIX
 	addl	$ RW_LOCK_BIAS,(%eax)



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 164/173] [IA64] tioca: Fix assignment from incompatible pointer warnings
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (163 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 163/173] x86: Fix a bogus unwind annotation in lib/semaphore_32.S Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 165/173] ramfs: fix memleak on no-mmu arch Willy Tarreau
                   ` (8 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Jeff Mahoney, Tony Luck, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Jeff Mahoney <jeffm@suse.com>

commit b4a6b3436531f6c5256e6d60d388c3c28ff1a0e9 upstream.

The prototype for sn_pci_provider->{dma_map,dma_map_consistent} expects
an unsigned long instead of a u64.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/ia64/sn/pci/tioca_provider.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -517,7 +517,7 @@ tioca_dma_unmap(struct pci_dev *pdev, dm
  * use the GART mapped mode.
  */
 static u64
-tioca_dma_map(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags)
+tioca_dma_map(struct pci_dev *pdev, unsigned long paddr, size_t byte_count, int dma_flags)
 {
 	u64 mapaddr;
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 165/173] ramfs: fix memleak on no-mmu arch
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (164 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 164/173] [IA64] tioca: Fix assignment from incompatible pointer warnings Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-26  0:37   ` Hugh Dickins
  2011-04-25 20:05 ` [PATCH 166/173] MAINTAINERS: update STABLE BRANCH info Willy Tarreau
                   ` (7 subsequent siblings)
  173 siblings, 1 reply; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Bob Liu, Hugh Dickins, David Howells, Andrew Morton,
	Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Bob Liu <lliubbo@gmail.com>

commit b836aec53e2bce71de1d5415313380688c851477 upstream.

On no-mmu arch, there is a memleak during shmem test.  The cause of this
memleak is ramfs_nommu_expand_for_mapping() added page refcount to 2
which makes iput() can't free that pages.

The simple test file is like this:

  int main(void)
  {
	int i;
	key_t k = ftok("/etc", 42);

	for ( i=0; i<100; ++i) {
		int id = shmget(k, 10000, 0644|IPC_CREAT);
		if (id == -1) {
			printf("shmget error\n");
		}
		if(shmctl(id, IPC_RMID, NULL ) == -1) {
			printf("shm  rm error\n");
			return -1;
		}
	}
	printf("run ok...\n");
	return 0;
  }

And the result:

  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        17912        42408            0            0
  -/+ buffers:              17912        42408
  root:/> shmem
  run ok...
  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        19096        41224            0            0
  -/+ buffers:              19096        41224
  root:/> shmem
  run ok...
  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        20296        40024            0            0
  -/+ buffers:              20296        40024
  ...

After this patch the test result is:(no memleak anymore)

  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        16668        43652            0            0
  -/+ buffers:              16668        43652
  root:/> shmem
  run ok...
  root:/> free
               total         used         free       shared      buffers
  Mem:         60320        16668        43652            0            0
  -/+ buffers:              16668        43652

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ramfs/file-nommu.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -111,6 +111,7 @@ int ramfs_nommu_expand_for_mapping(struc
 		SetPageDirty(page);
 
 		unlock_page(page);
+		put_page(page);
 	}
 
 	return 0;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 166/173] MAINTAINERS: update STABLE BRANCH info
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (165 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 165/173] ramfs: fix memleak on no-mmu arch Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 167/173] UBIFS: fix oops when R/O file-system is fsynced Willy Tarreau
                   ` (6 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Randy Dunlap, Chris Wright, Andrew Morton, Linus Torvalds,
	Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Randy Dunlap <randy.dunlap@oracle.com>

commit d00ebeac5f24f290636f7a895dafc124b2930a08 upstream.

Drop Chris Wright from STABLE maintainers.  He hasn't done STABLE release
work for quite some time.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 MAINTAINERS |    1 -
 1 file changed, 1 deletion(-)

Index: longterm-2.6.27/MAINTAINERS
===================================================================
--- longterm-2.6.27.orig/MAINTAINERS	2011-01-23 10:51:58.000000000 +0100
+++ longterm-2.6.27/MAINTAINERS	2011-04-25 17:29:31.216280205 +0200
@@ -3857,8 +3857,6 @@
 STABLE BRANCH:
 P:	Greg Kroah-Hartman
 M:	greg@kroah.com
-P:	Chris Wright
-M:	chrisw@sous-sol.org
 L:	stable@kernel.org
 S:	Maintained
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 167/173] UBIFS: fix oops when R/O file-system is fsynced
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (166 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 166/173] MAINTAINERS: update STABLE BRANCH info Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 168/173] next_pidmap: fix overflow condition Willy Tarreau
                   ` (5 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Artem Bityutskiy, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

commit 78530bf7f2559b317c04991b52217c1608d5a58d upstream.

This patch fixes severe UBIFS bug: UBIFS oopses when we 'fsync()' an
file on R/O-mounter file-system. We (the UBIFS authors) incorrectly
thought that VFS would not propagate 'fsync()' down to the file-system
if it is read-only, but this is not the case.

It is easy to exploit this bug using the following simple perl script:

use strict;
use File::Sync qw(fsync sync);

die "File path is not specified" if not defined $ARGV[0];
my $path = $ARGV[0];

open FILE, "<", "$path" or die "Cannot open $path: $!";
fsync(\*FILE) or die "cannot fsync $path: $!";
close FILE or die "Cannot close $path: $!";

Thanks to Reuben Dowle <Reuben.Dowle@navico.com> for reporting about this
issue.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reported-by: Reuben Dowle <Reuben.Dowle@navico.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ubifs/file.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1311,6 +1311,9 @@ int ubifs_fsync(struct file *file, struc
 
 	dbg_gen("syncing inode %lu", inode->i_ino);
 
+	if (inode->i_sb->s_flags & MS_RDONLY)
+		return 0;
+
 	/*
 	 * VFS has already synchronized dirty pages for this inode. Synchronize
 	 * the inode unless this is a 'datasync()' call.



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 168/173] next_pidmap: fix overflow condition
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (167 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 167/173] UBIFS: fix oops when R/O file-system is fsynced Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 169/173] proc: do proper range check on readdir offset Willy Tarreau
                   ` (4 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Eric W. Biederman, Pavel Emelyanov, Linus Torvalds,
	Greg Kroah-Hartman

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2292 bytes --]

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Linus Torvalds <torvalds@linux-foundation.org>

commit c78193e9c7bcbf25b8237ad0dec82f805c4ea69b upstream.

next_pidmap() just quietly accepted whatever 'last' pid that was passed
in, which is not all that safe when one of the users is /proc.

Admittedly the proc code should do some sanity checking on the range
(and that will be the next commit), but that doesn't mean that the
helper functions should just do that pidmap pointer arithmetic without
checking the range of its arguments.

So clamp 'last' to PID_MAX_LIMIT.  The fact that we then do "last+1"
doesn't really matter, the for-loop does check against the end of the
pidmap array properly (it's only the actual pointer arithmetic overflow
case we need to worry about, and going one bit beyond isn't going to
overflow).

[ Use PID_MAX_LIMIT rather than pid_max as per Eric Biederman ]

Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com>
Analyzed-by: Robert Święcki <robert@swiecki.net>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 include/linux/pid.h |    2 +-
 kernel/pid.c        |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -117,7 +117,7 @@ extern struct pid *find_vpid(int nr);
  */
 extern struct pid *find_get_pid(int nr);
 extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
-int next_pidmap(struct pid_namespace *pid_ns, int last);
+int next_pidmap(struct pid_namespace *pid_ns, unsigned int last);
 
 extern struct pid *alloc_pid(struct pid_namespace *ns);
 extern void free_pid(struct pid *pid);
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -182,11 +182,14 @@ static int alloc_pidmap(struct pid_names
 	return -1;
 }
 
-int next_pidmap(struct pid_namespace *pid_ns, int last)
+int next_pidmap(struct pid_namespace *pid_ns, unsigned int last)
 {
 	int offset;
 	struct pidmap *map, *end;
 
+	if (last >= PID_MAX_LIMIT)
+		return -1;
+
 	offset = (last + 1) & BITS_PER_PAGE_MASK;
 	map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE];
 	end = &pid_ns->pidmap[PIDMAP_ENTRIES];



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 169/173] proc: do proper range check on readdir offset
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (168 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 168/173] next_pidmap: fix overflow condition Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 170/173] USB: EHCI: unlink unused QHs when the controller is stopped Willy Tarreau
                   ` (3 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Linus Torvalds, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Linus Torvalds <torvalds@linux-foundation.org>

commit d8bdc59f215e62098bc5b4256fd9928bf27053a1 upstream.

Rather than pass in some random truncated offset to the pid-related
functions, check that the offset is in range up-front.

This is just cleanup, the previous commit fixed the real problem.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/proc/base.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2806,11 +2806,16 @@ static int proc_pid_fill_cache(struct fi
 /* for the /proc/ directory itself, after non-process stuff has been done */
 int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
 {
-	unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY;
-	struct task_struct *reaper = get_proc_task(filp->f_path.dentry->d_inode);
+	unsigned int nr;
+	struct task_struct *reaper;
 	struct tgid_iter iter;
 	struct pid_namespace *ns;
 
+	if (filp->f_pos >= PID_MAX_LIMIT + TGID_OFFSET)
+		goto out_no_task;
+	nr = filp->f_pos - FIRST_PROCESS_ENTRY;
+
+	reaper = get_proc_task(filp->f_path.dentry->d_inode);
 	if (!reaper)
 		goto out_no_task;
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 170/173] USB: EHCI: unlink unused QHs when the controller is stopped
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (169 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 169/173] proc: do proper range check on readdir offset Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 171/173] net: ax25: fix information leak to userland harder Willy Tarreau
                   ` (2 subsequent siblings)
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Alan Stern, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit 94ae4976e253757e9b03a44d27d41b20f1829d80 upstream.

This patch (as1458) fixes a problem affecting ultra-reliable systems:
When hardware failover of an EHCI controller occurs, the data
structures do not get released correctly.  This is because the routine
responsible for removing unused QHs from the async schedule assumes
the controller is running properly (the frame counter is used in
determining how long the QH has been idle) -- but when a failover
causes the controller to be electronically disconnected from the PCI
bus, obviously it stops running.

The solution is simple: Allow scan_async() to remove a QH from the
async schedule if it has been idle for long enough _or_ if the
controller is stopped.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-Tested-by: Dan Duval <dan.duval@stratus.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/usb/host/ehci-q.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1224,24 +1224,27 @@ static void start_unlink_async (struct e
 
 static void scan_async (struct ehci_hcd *ehci)
 {
+	bool			stopped;
 	struct ehci_qh		*qh;
 	enum ehci_timer_action	action = TIMER_IO_WATCHDOG;
 
 	ehci->stamp = ehci_readl(ehci, &ehci->regs->frame_index);
 	timer_action_done (ehci, TIMER_ASYNC_SHRINK);
 rescan:
+	stopped = !HC_IS_RUNNING(ehci_to_hcd(ehci)->state);
 	qh = ehci->async->qh_next.qh;
 	if (likely (qh != NULL)) {
 		do {
 			/* clean any finished work for this qh */
-			if (!list_empty (&qh->qtd_list)
-					&& qh->stamp != ehci->stamp) {
+			if (!list_empty(&qh->qtd_list) && (stopped ||
+					qh->stamp != ehci->stamp)) {
 				int temp;
 
 				/* unlinks could happen here; completion
 				 * reporting drops the lock.  rescan using
 				 * the latest schedule, but don't rescan
-				 * qhs we already finished (no looping).
+				 * qhs we already finished (no looping)
+				 * unless the controller is stopped.
 				 */
 				qh = qh_get (qh);
 				qh->stamp = ehci->stamp;
@@ -1262,9 +1265,9 @@ rescan:
 			 */
 			if (list_empty(&qh->qtd_list)
 					&& qh->qh_state == QH_STATE_LINKED) {
-				if (!ehci->reclaim
-					&& ((ehci->stamp - qh->stamp) & 0x1fff)
-						>= (EHCI_SHRINK_FRAMES * 8))
+				if (!ehci->reclaim && (stopped ||
+					((ehci->stamp - qh->stamp) & 0x1fff)
+						>= EHCI_SHRINK_FRAMES * 8))
 					start_unlink_async(ehci, qh);
 				else
 					action = TIMER_ASYNC_SHRINK;



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 171/173] net: ax25: fix information leak to userland harder
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (170 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 170/173] USB: EHCI: unlink unused QHs when the controller is stopped Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 172/173] net: Fix oops from tcp_collapse() when using splice() Willy Tarreau
  2011-04-25 20:05 ` [PATCH 173/173] [SCSI] mptsas: fix hangs caused by ATA pass-through Willy Tarreau
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review
  Cc: Kees Cook, David S. Miller, Greg Kroah-Hartman

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Kees Cook <kees.cook@canonical.com>

commit 5b919f833d9d60588d026ad82d17f17e8872c7a9 upstream.

Commit fe10ae53384e48c51996941b7720ee16995cbcb7 adds a memset() to clear
the structure being sent back to userspace, but accidentally used the
wrong size.

Reported-by: Brad Spengler <spender@grsecurity.net>
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 net/ax25/af_ax25.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -1391,7 +1391,7 @@ static int ax25_getname(struct socket *s
 	ax25_cb *ax25;
 	int err = 0;
 
-	memset(fsa, 0, sizeof(fsa));
+	memset(fsa, 0, sizeof(*fsa));
 	lock_sock(sk);
 	ax25 = ax25_sk(sk);
 



^ permalink raw reply	[flat|nested] 192+ messages in thread

* [PATCH 172/173] net: Fix oops from tcp_collapse() when using splice()
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (171 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 171/173] net: ax25: fix information leak to userland harder Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  2011-04-25 20:05 ` [PATCH 173/173] [SCSI] mptsas: fix hangs caused by ATA pass-through Willy Tarreau
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Steven J. Magnani, David S. Miller

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Steven J. Magnani <steve@digidescorp.com>

commit baff42ab1494528907bf4d5870359e31711746ae upstream.

tcp_read_sock() can have a eat skbs without immediately advancing copied_seq.
This can cause a panic in tcp_collapse() if it is called as a result
of the recv_actor dropping the socket lock.

A userspace program that splices data from a socket to either another
socket or to a file can trigger this bug.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 6afb6d8..2c75f89 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1368,6 +1368,7 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
 		sk_eat_skb(sk, skb, 0);
 		if (!desc->count)
 			break;
+		tp->copied_seq = seq;
 	}
 	tp->copied_seq = seq;
 



^ permalink raw reply related	[flat|nested] 192+ messages in thread

* [PATCH 173/173] [SCSI] mptsas: fix hangs caused by ATA pass-through
       [not found] <46075c3a3ef08be6d70339617d6afc98@local>
                   ` (172 preceding siblings ...)
  2011-04-25 20:05 ` [PATCH 172/173] net: Fix oops from tcp_collapse() when using splice() Willy Tarreau
@ 2011-04-25 20:05 ` Willy Tarreau
  173 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:05 UTC (permalink / raw)
  To: linux-kernel, stable, stable-review; +Cc: Desai Kashyap, James Bottomley

2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Ryan Kuester <rkuester@kspace.net>

commit 2a1b7e575b80ceb19ea50bfa86ce0053ea57181d upstream.

I may have an explanation for the LSI 1068 HBA hangs provoked by ATA
pass-through commands, in particular by smartctl.

First, my version of the symptoms.  On an LSI SAS1068E B3 HBA running
01.29.00.00 firmware, with SATA disks, and with smartd running, I'm seeing
occasional task, bus, and host resets, some of which lead to hard faults of
the HBA requiring a reboot.  Abusively looping the smartctl command,

    # while true; do smartctl -a /dev/sdb > /dev/null; done

dramatically increases the frequency of these failures to nearly one per
minute.  A high IO load through the HBA while looping smartctl seems to
improve the chance of a full scsi host reset or a non-recoverable hang.

I reduced what smartctl was doing down to a simple test case which
causes the hang with a single IO when pointed at the sd interface.  See
the code at the bottom of this e-mail.  It uses an SG_IO ioctl to issue
a single pass-through ATA identify device command.  If the buffer
userspace gives for the read data has certain alignments, the task is
issued to the HBA but the HBA fails to respond.  If run against the sg
interface, neither the test code nor smartctl causes a hang.

sd and sg handle the SG_IO ioctl slightly differently.  Unless you
specifically set a flag to do direct IO, sg passes a buffer of its own,
which is page-aligned, to the block layer and later copies the result
into the userspace buffer regardless of its alignment.  sd, on the other
hand, always does direct IO unless the userspace buffer fails an
alignment test at block/blk-map.c line 57, in which case a page-aligned
buffer is created and used for the transfer.

The alignment test currently checks for word-alignment, the default
setup by scsi_lib.c; therefore, userspace buffers of almost any
alignment are given directly to the HBA as DMA targets.  The LSI 1068
hardware doesn't seem to like at least a couple of the alignments which
cross a page boundary (see the test code below).  Curiously, many
page-boundary-crossing alignments do work just fine.

So, either the hardware has an bug handling certain alignments or the
hardware has a stricter alignment requirement than the driver is
advertising.  If stricter alignment is required, then in no case should
misaligned buffers from userspace be allowed through without being
bounced or at least causing an error to be returned.

It seems the mptsas driver could use blk_queue_dma_alignment() to advertise
a stricter alignment requirement.  If it does, sd does the right thing and
bounces misaligned buffers (see block/blk-map.c line 57).  The following
patch to 2.6.34-rc5 makes my symptoms go away.  I'm sure this is the wrong
place for this code, but it gets my idea across.

Acked-by: "Desai Kashyap" <Kashyap.Desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 5c53624..407cb84 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -2459,6 +2459,8 @@ mptscsih_slave_configure(struct scsi_device *sdev)
 		ioc->name,sdev->tagged_supported, sdev->simple_tags,
 		sdev->ordered_tags));
 
+	blk_queue_dma_alignment (sdev->request_queue, 512 - 1);
+
 	return 0;
 }
 



^ permalink raw reply related	[flat|nested] 192+ messages in thread

* Re: [PATCH 112/173] Input: xen-kbdfront - advertise either absolute or relative coordinates
  2011-04-25 20:04 ` [PATCH 112/173] Input: xen-kbdfront - advertise either absolute or relative coordinates Willy Tarreau
@ 2011-04-25 20:31   ` Olaf Hering
  2011-04-25 20:42     ` Willy Tarreau
  2011-04-26  3:07     ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 192+ messages in thread
From: Olaf Hering @ 2011-04-25 20:31 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: linux-kernel, stable, stable-review, Stefano Stabellini,
	Dmitry Torokhov, Greg Kroah-Hartman

On Mon, Apr 25, Willy Tarreau wrote:

> 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

These two hunks have to be removed from the patch.
If the guest is suspended/resumed the guest has to renegotiate with the
new qemu-dm process and set the request-abs-pointer property again.

Olaf

> @@ -267,7 +281,7 @@
>  				   enum xenbus_state backend_state)
>  {
>  	struct xenkbd_info *info = dev->dev.driver_data;
> -	int ret, val;
> +	int val;
>  
>  	switch (backend_state) {
>  	case XenbusStateInitialising:
> @@ -278,17 +292,6 @@
>  
>  	case XenbusStateInitWait:
>  InitWait:
> -		ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
> -				   "feature-abs-pointer", "%d", &val);
> -		if (ret < 0)
> -			val = 0;
> -		if (val) {
> -			ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
> -					    "request-abs-pointer", "1");
> -			if (ret)
> -				printk(KERN_WARNING
> -				       "xenkbd: can't request abs-pointer");
> -		}
>  		xenbus_switch_state(dev, XenbusStateConnected);
>  		break;
>  
> 
> 

^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 112/173] Input: xen-kbdfront - advertise either absolute or relative coordinates
  2011-04-25 20:31   ` Olaf Hering
@ 2011-04-25 20:42     ` Willy Tarreau
  2011-04-26  3:07     ` Konrad Rzeszutek Wilk
  1 sibling, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 20:42 UTC (permalink / raw)
  To: Olaf Hering
  Cc: linux-kernel, stable, stable-review, Stefano Stabellini,
	Dmitry Torokhov, Greg Kroah-Hartman

On Mon, Apr 25, 2011 at 10:31:58PM +0200, Olaf Hering wrote:
> On Mon, Apr 25, Willy Tarreau wrote:
> 
> > 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.
> 
> These two hunks have to be removed from the patch.
> If the guest is suspended/resumed the guest has to renegotiate with the
> new qemu-dm process and set the request-abs-pointer property again.

Done, thank you Olaf for the explanation.

Willy


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 039/173] OHCI: work around for nVidia shutdown problem
  2011-04-25 20:03 ` [PATCH 039/173] OHCI: work around for nVidia shutdown problem Willy Tarreau
@ 2011-04-25 21:24   ` Alan Stern
  2011-04-25 21:29     ` Willy Tarreau
  0 siblings, 1 reply; 192+ messages in thread
From: Alan Stern @ 2011-04-25 21:24 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: Kernel development list, stable, stable-review,
	Greg Kroah-Hartman

On Mon, 25 Apr 2011, Willy Tarreau wrote:

> 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.
> 
> ------------------
> 
> From: Alan Stern <stern@rowland.harvard.edu>
> 
> commit 3df7169e73fc1d71a39cffeacc969f6840cdf52b upstream.
> 
> This patch (as1417) fixes a problem affecting some (or all) nVidia
> chipsets.  When the computer is shut down, the OHCI controllers
> continue to power the USB buses and evidently they drive a Reset
> signal out all their ports.  This prevents attached devices from going
> to low power.  Mouse LEDs stay on, for example, which is disconcerting
> for users and a drain on laptop batteries.
> 
> The fix involves leaving each OHCI controller in the OPERATIONAL state
> during system shutdown rather than putting it in the RESET state.
> Although this nominally means the controller is running, in fact it's
> not doing very much since all the schedules are all disabled.  However
> there is ongoing DMA to the Host Controller Communications Area, so
> the patch also disables the bus-master capability of all PCI USB
> controllers after the shutdown routine runs.
> 
> The fix is applied only to nVidia-based PCI OHCI controllers, so it
> shouldn't cause problems on systems using other hardware.  As an added
> safety measure, in case the kernel encounters one of these running
> controllers during boot, the patch changes quirk_usb_handoff_ohci()
> (which runs early on during PCI discovery) to reset the controller
> before anything bad can happen.
> 
> Reported-by: Pali Rohár <pali.rohar@gmail.com>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> CC: David Brownell <david-b@pacbell.net>
> Tested-by: Pali Rohár <pali.rohar@gmail.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Some people have reported that more recent Nvidia systems work
correctly without this patch and have problems when the patch is
applied.  For now, I suggest omitting this patch.

Alan Stern


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 039/173] OHCI: work around for nVidia shutdown problem
  2011-04-25 21:24   ` Alan Stern
@ 2011-04-25 21:29     ` Willy Tarreau
  0 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 21:29 UTC (permalink / raw)
  To: Alan Stern
  Cc: Kernel development list, stable, stable-review,
	Greg Kroah-Hartman

On Mon, Apr 25, 2011 at 05:24:34PM -0400, Alan Stern wrote:
(...)
> Some people have reported that more recent Nvidia systems work
> correctly without this patch and have problems when the patch is
> applied.  For now, I suggest omitting this patch.

Done, thank you Alan !

Willy


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 054/173] acer-wmi: Fix capitalisation of GUID
  2011-04-25 20:03 ` [PATCH 054/173] acer-wmi: Fix capitalisation of GUID Willy Tarreau
@ 2011-04-25 22:00   ` Carlos Corbacho
  2011-04-25 22:44     ` [stable] " Willy Tarreau
  0 siblings, 1 reply; 192+ messages in thread
From: Carlos Corbacho @ 2011-04-25 22:00 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: linux-kernel, stable, stable-review, Matthew Garrett,
	Greg Kroah-Hartman

On Monday 25 Apr 2011 21:03:26 Willy Tarreau wrote:
> 2.6.27.59-stable review patch.  If anyone has any objections, please let us
> know.

Nack - this caused https://bugzilla.kernel.org/show_bug.cgi?id=32862

Either don't apply this patch, or you'll need to also apply the subsequent fix 
up at the same time (I don't know if that's gone upstream yet?).

-Carlos

> 
> ------------------
> 
> From: Matthew Garrett <mjg@redhat.com>
> 
> commit bbb706079abe955a9e3f208f541de97d99449236 upstream.
> 
> 6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3 needs to be
> 6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3 to match the hardware alias.
> 
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> Acked-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> ---
>  drivers/platform/x86/acer-wmi.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/misc/acer-wmi.c
> +++ b/drivers/misc/acer-wmi.c
> @@ -90,7 +90,7 @@ struct acer_quirks {
>   */
>  #define AMW0_GUID1		"67C3371D-95A3-4C37-BB61-DD47B491DAAB"
>  #define AMW0_GUID2		"431F16ED-0C2B-444C-B267-27DEB140CF9C"
> -#define WMID_GUID1		"6AF4F258-B401-42fd-BE91-3D4AC2D7C0D3"
> +#define WMID_GUID1		"6AF4F258-B401-42FD-BE91-3D4AC2D7C0D3"
>  #define WMID_GUID2		"95764E09-FB56-4e83-B31A-37761F60994A"
> 
>  MODULE_ALIAS("wmi:67C3371D-95A3-4C37-BB61-DD47B491DAAB");

^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [stable] [PATCH 054/173] acer-wmi: Fix capitalisation of GUID
  2011-04-25 22:00   ` Carlos Corbacho
@ 2011-04-25 22:44     ` Willy Tarreau
  0 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-25 22:44 UTC (permalink / raw)
  To: Carlos Corbacho
  Cc: Greg Kroah-Hartman, stable-review, Matthew Garrett, linux-kernel,
	stable

On Mon, Apr 25, 2011 at 11:00:13PM +0100, Carlos Corbacho wrote:
> On Monday 25 Apr 2011 21:03:26 Willy Tarreau wrote:
> > 2.6.27.59-stable review patch.  If anyone has any objections, please let us
> > know.
> 
> Nack - this caused https://bugzilla.kernel.org/show_bug.cgi?id=32862
> 
> Either don't apply this patch, or you'll need to also apply the subsequent fix 
> up at the same time (I don't know if that's gone upstream yet?).

Fine, I've removed it.

Thank you Carlos!
Willy


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 165/173] ramfs: fix memleak on no-mmu arch
  2011-04-25 20:05 ` [PATCH 165/173] ramfs: fix memleak on no-mmu arch Willy Tarreau
@ 2011-04-26  0:37   ` Hugh Dickins
  2011-04-26  5:01     ` Willy Tarreau
  0 siblings, 1 reply; 192+ messages in thread
From: Hugh Dickins @ 2011-04-26  0:37 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: linux-kernel, stable, stable-review, Bob Liu, David Howells,
	Andrew Morton, Linus Torvalds, Greg Kroah-Hartman,
	Johannes Weiner, Enrik Berkhan

On Mon, 25 Apr 2011, Willy Tarreau wrote:

> 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.
> 
> ------------------
> 
> From: Bob Liu <lliubbo@gmail.com>
> 
> commit b836aec53e2bce71de1d5415313380688c851477 upstream.
> 
> On no-mmu arch, there is a memleak during shmem test.  The cause of this
> memleak is ramfs_nommu_expand_for_mapping() added page refcount to 2
> which makes iput() can't free that pages.
> 
...
> 
> Signed-off-by: Bob Liu <lliubbo@gmail.com>
> Acked-by: Hugh Dickins <hughd@google.com>
> Signed-off-by: David Howells <dhowells@redhat.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> 
> ---
>  fs/ramfs/file-nommu.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> --- a/fs/ramfs/file-nommu.c
> +++ b/fs/ramfs/file-nommu.c
> @@ -111,6 +111,7 @@ int ramfs_nommu_expand_for_mapping(struc
>  		SetPageDirty(page);
>  
>  		unlock_page(page);
> +		put_page(page);
>  	}
>  
>  	return 0;


I'm not absolutely certain, but I rather think this patch should NOT
be included: I never looked to see when the bug it fixes crept in,
but now I'm thinking it may have been 2678958e1225 "ramfs-nommu:
use generic lru cache", which did not go in until 2.6.30 -
__lru_cache_add adding the unbalanced page_cache_get.

Whereas the "SetPageDirty" you can see above is not in 2.6.27.59-rc1:
I think you'd do well to include the patch below which introduced it.
(It may give you a reject because __pagevec_lru_add was enhanced to
__pagevec_lru_add_file by the time that patch went in.)

Yes, the pages Enrik reports as being wrongly discarded, would not
have been discarded if their reference counts were too high:
I do believe you need Enrik's patch instead of Bob's patch.

Hugh

commit 020fe22ff14320927f394de222cbb11708bcc7a8
Author: Enrik Berkhan <Enrik.Berkhan@ge.com>
Date:   Fri Mar 13 13:51:56 2009 -0700

    nommu: ramfs: pages allocated to an inode's pagecache may get wrongly discarded
    
    The pages attached to a ramfs inode's pagecache by truncation from nothing
    - as done by SYSV SHM for example - may get discarded under memory
    pressure.
    
    The problem is that the pages are not marked dirty.  Anything that creates
    data in an MMU-based ramfs will cause the pages holding that data will
    cause the set_page_dirty() aop to be called.
    
    For the NOMMU-based mmap, set_page_dirty() may be called by write(), but
    it won't be called by page-writing faults on writable mmaps, and it isn't
    called by ramfs_nommu_expand_for_mapping() when a file is being truncated
    from nothing to allocate a contiguous run.
    
    The solution is to mark the pages dirty at the point of allocation by the
    truncation code.
    
    Signed-off-by: Enrik Berkhan <Enrik.Berkhan@ge.com>
    Signed-off-by: David Howells <dhowells@redhat.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Nick Piggin <nickpiggin@yahoo.com.au>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index b9b567a..90d72be 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -114,6 +114,9 @@ int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize)
 		if (!pagevec_add(&lru_pvec, page))
 			__pagevec_lru_add_file(&lru_pvec);
 
+		/* prevent the page from being discarded on memory pressure */
+		SetPageDirty(page);
+
 		unlock_page(page);
 	}
 

^ permalink raw reply related	[flat|nested] 192+ messages in thread

* Re: [PATCH 112/173] Input: xen-kbdfront - advertise either absolute or relative coordinates
  2011-04-25 20:31   ` Olaf Hering
  2011-04-25 20:42     ` Willy Tarreau
@ 2011-04-26  3:07     ` Konrad Rzeszutek Wilk
  1 sibling, 0 replies; 192+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-04-26  3:07 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Willy Tarreau, linux-kernel, stable, stable-review,
	Stefano Stabellini, Dmitry Torokhov, Greg Kroah-Hartman

On Mon, Apr 25, 2011 at 10:31:58PM +0200, Olaf Hering wrote:
> On Mon, Apr 25, Willy Tarreau wrote:
> 
> > 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.
> 
> These two hunks have to be removed from the patch.
> If the guest is suspended/resumed the guest has to renegotiate with the
> new qemu-dm process and set the request-abs-pointer property again.
> 

Willy,

Olaf is refering to c36b58e8a9112017c2bcc322cc98e71241814303 which is 
in the upstream kernel.

> Olaf
> 
> > @@ -267,7 +281,7 @@
> >  				   enum xenbus_state backend_state)
> >  {
> >  	struct xenkbd_info *info = dev->dev.driver_data;
> > -	int ret, val;
> > +	int val;
> >  
> >  	switch (backend_state) {
> >  	case XenbusStateInitialising:
> > @@ -278,17 +292,6 @@
> >  
> >  	case XenbusStateInitWait:
> >  InitWait:
> > -		ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
> > -				   "feature-abs-pointer", "%d", &val);
> > -		if (ret < 0)
> > -			val = 0;
> > -		if (val) {
> > -			ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
> > -					    "request-abs-pointer", "1");
> > -			if (ret)
> > -				printk(KERN_WARNING
> > -				       "xenkbd: can't request abs-pointer");
> > -		}
> >  		xenbus_switch_state(dev, XenbusStateConnected);
> >  		break;
> >  
> > 
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 165/173] ramfs: fix memleak on no-mmu arch
  2011-04-26  0:37   ` Hugh Dickins
@ 2011-04-26  5:01     ` Willy Tarreau
  0 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-26  5:01 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: linux-kernel, stable, stable-review, Bob Liu, David Howells,
	Andrew Morton, Linus Torvalds, Greg Kroah-Hartman,
	Johannes Weiner, Enrik Berkhan

On Mon, Apr 25, 2011 at 05:37:19PM -0700, Hugh Dickins wrote:
(...)
> >  fs/ramfs/file-nommu.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > --- a/fs/ramfs/file-nommu.c
> > +++ b/fs/ramfs/file-nommu.c
> > @@ -111,6 +111,7 @@ int ramfs_nommu_expand_for_mapping(struc
> >  		SetPageDirty(page);
> >  
> >  		unlock_page(page);
> > +		put_page(page);
> >  	}
> >  
> >  	return 0;
> 
> 
> I'm not absolutely certain, but I rather think this patch should NOT
> be included: I never looked to see when the bug it fixes crept in,
> but now I'm thinking it may have been 2678958e1225 "ramfs-nommu:
> use generic lru cache", which did not go in until 2.6.30 -
> __lru_cache_add adding the unbalanced page_cache_get.

OK.

> Whereas the "SetPageDirty" you can see above is not in 2.6.27.59-rc1:

Ah indeed you're right !

> I think you'd do well to include the patch below which introduced it.
> (It may give you a reject because __pagevec_lru_add was enhanced to
> __pagevec_lru_add_file by the time that patch went in.)
> 
> Yes, the pages Enrik reports as being wrongly discarded, would not
> have been discarded if their reference counts were too high:
> I do believe you need Enrik's patch instead of Bob's patch.

Fine, I will do that then.
Thank you Hugh for the detailed explanation !

Willy


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference
  2011-04-25 20:04 ` [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference Willy Tarreau
@ 2011-04-26 10:07   ` Jiri Slaby
  2011-04-26 19:53     ` Willy Tarreau
  0 siblings, 1 reply; 192+ messages in thread
From: Jiri Slaby @ 2011-04-26 10:07 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: linux-kernel, stable, stable-review, Alan Cox, Greg Kroah-Hartman

On 04/25/2011 10:04 PM, Willy Tarreau wrote:
> 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.
>
> ------------------
>
> From: Jiri Slaby<jslaby@suse.cz>
>
> commit 6960f40a954619857e7095a6179eef896f297077 upstream.
>
> Make sure that we check the return value of tty_port_tty_get.
> Sometimes it may return NULL and we later dereference that.
>
> The only place here is in kobil_read_int_callback, so fix it.
>
> Signed-off-by: Jiri Slaby<jslaby@suse.cz>
> Cc: Alan Cox<alan@linux.intel.com>
> Signed-off-by: Greg Kroah-Hartman<gregkh@suse.de>
>
> ---
>   drivers/usb/serial/kobil_sct.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/usb/serial/kobil_sct.c
> +++ b/drivers/usb/serial/kobil_sct.c
> @@ -372,7 +372,7 @@ static void kobil_read_int_callback(stru
>   	}
>
>   	tty = port->port.tty;
> -	if (urb->actual_length) {
> +	if (tty&&  urb->actual_length) {

Ok, but this doesn't fix the bug (the URB should be killed or something 
similar in that kernel), it only makes the window smaller.

regards,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 029/173] pata_mpc52xx: inherit from ata_bmdma_port_ops
  2011-04-25 20:03 ` [PATCH 029/173] pata_mpc52xx: inherit from ata_bmdma_port_ops Willy Tarreau
@ 2011-04-26 10:44   ` Sergei Shtylyov
  2011-04-26 19:56     ` [stable] " Willy Tarreau
  0 siblings, 1 reply; 192+ messages in thread
From: Sergei Shtylyov @ 2011-04-26 10:44 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: linux-kernel, stable, stable-review, Tejun Heo, Jeff Garzik,
	Greg Kroah-Hartman

Hello.

On 26-04-2011 0:03, Willy Tarreau wrote:

> 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.

    DMA support was added to this driver only in 2.6.29, hence this patch is 
not needed in 2.6.27.y...

> ------------------

> From: Tejun Heo<tj@kernel.org>

> commit 77c5fd19075d299fe820bb59bb21b0b113676e20 upstream.

> pata_mpc52xx supports BMDMA but inherits ata_sff_port_ops which
> triggers BUG_ON() when a DMA command is issued.  Fix it.

> Signed-off-by: Tejun Heo<tj@kernel.org>
> Reported-by: Roman Fietze<roman.fietze@telemotive.de>
> Cc: Sergei Shtylyov<sshtylyov@mvista.com>
> Signed-off-by: Jeff Garzik<jgarzik@redhat.com>
> Signed-off-by: Greg Kroah-Hartman<gregkh@suse.de>

> ---
>   drivers/ata/pata_mpc52xx.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

> --- a/drivers/ata/pata_mpc52xx.c
> +++ b/drivers/ata/pata_mpc52xx.c
> @@ -610,7 +610,7 @@ static struct scsi_host_template mpc52xx
>   };
>
>   static struct ata_port_operations mpc52xx_ata_port_ops = {
> -	.inherits		=&ata_sff_port_ops,
> +	.inherits		=&ata_bmdma_port_ops,
>   	.sff_dev_select		= mpc52xx_ata_dev_select,
>   	.set_piomode		= mpc52xx_ata_set_piomode,
>   	.set_dmamode		= mpc52xx_ata_set_dmamode,

WBR, Sergei

^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 104/173] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code
  2011-04-25 20:04 ` [PATCH 104/173] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code Willy Tarreau
@ 2011-04-26 13:03   ` Oleg Nesterov
  2011-04-26 20:00     ` Willy Tarreau
  0 siblings, 1 reply; 192+ messages in thread
From: Oleg Nesterov @ 2011-04-26 13:03 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: linux-kernel, stable, stable-review, Julien Tinnes,
	Linus Torvalds, Greg Kroah-Hartman

On 04/25, Willy Tarreau wrote:
>
> 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.
>
> ------------------
>
> From: Julien Tinnes <jln@google.com>
>
> commit da48524eb20662618854bb3df2db01fc65f3070c upstream.

This also needs 243b422af9ea9af4ead07a8ad54c90d4f9b6081a

> Userland should be able to trust the pid and uid of the sender of a
> signal if the si_code is SI_TKILL.
>
> Unfortunately, the kernel has historically allowed sigqueueinfo() to
> send any si_code at all (as long as it was negative - to distinguish it
> from kernel-generated signals like SIGILL etc), so it could spoof a
> SI_TKILL with incorrect siginfo values.
>
> Happily, it looks like glibc has always set si_code to the appropriate
> SI_QUEUE, so there are probably no actual user code that ever uses
> anything but the appropriate SI_QUEUE flag.
>
> So just tighten the check for si_code (we used to allow any negative
> value), and add a (one-time) warning in case there are binaries out
> there that might depend on using other si_code values.
>
> Signed-off-by: Julien Tinnes <jln@google.com>
> Acked-by: Oleg Nesterov <oleg@redhat.com>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> [wt: 2.6.27 does not have do_rt_tgsigqueueinfo()]
>
> ---
>  kernel/signal.c |   16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> Index: longterm-2.6.27/kernel/signal.c
> ===================================================================
> --- longterm-2.6.27.orig/kernel/signal.c	2011-01-23 10:52:37.000000000 +0100
> +++ longterm-2.6.27/kernel/signal.c	2011-04-25 16:06:27.491278774 +0200
> @@ -2294,9 +2294,13 @@
>  		return -EFAULT;
>
>  	/* Not even root can pretend to send signals from the kernel.
> -	   Nor can they impersonate a kill(), which adds source info.  */
> -	if (info.si_code >= 0)
> +	 * Nor can they impersonate a kill()/tgkill(), which adds source info.
> +	 */
> +	if (info.si_code != SI_QUEUE) {
> +		/* We used to allow any < 0 si_code */
> +		WARN_ON_ONCE(info.si_code < 0);
>  		return -EPERM;
> +	}
>  	info.si_signo = sig;
>
>  	/* POSIX.1b doesn't mention process groups.  */
>
>


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference
  2011-04-26 10:07   ` Jiri Slaby
@ 2011-04-26 19:53     ` Willy Tarreau
  2011-04-26 22:01       ` Jiri Slaby
  0 siblings, 1 reply; 192+ messages in thread
From: Willy Tarreau @ 2011-04-26 19:53 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: linux-kernel, stable, stable-review, Alan Cox, Greg Kroah-Hartman

On Tue, Apr 26, 2011 at 12:07:07PM +0200, Jiri Slaby wrote:
> On 04/25/2011 10:04 PM, Willy Tarreau wrote:
> >2.6.27.59-stable review patch.  If anyone has any objections, please let 
> >us know.
> >
> >------------------
> >
> >From: Jiri Slaby<jslaby@suse.cz>
> >
> >commit 6960f40a954619857e7095a6179eef896f297077 upstream.
> >
> >Make sure that we check the return value of tty_port_tty_get.
> >Sometimes it may return NULL and we later dereference that.
> >
> >The only place here is in kobil_read_int_callback, so fix it.
> >
> >Signed-off-by: Jiri Slaby<jslaby@suse.cz>
> >Cc: Alan Cox<alan@linux.intel.com>
> >Signed-off-by: Greg Kroah-Hartman<gregkh@suse.de>
> >
> >---
> >  drivers/usb/serial/kobil_sct.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >--- a/drivers/usb/serial/kobil_sct.c
> >+++ b/drivers/usb/serial/kobil_sct.c
> >@@ -372,7 +372,7 @@ static void kobil_read_int_callback(stru
> >  	}
> >
> >  	tty = port->port.tty;
> >-	if (urb->actual_length) {
> >+	if (tty&&  urb->actual_length) {
> 
> Ok, but this doesn't fix the bug (the URB should be killed or something 
> similar in that kernel), it only makes the window smaller.

OK I get it now, it requires patch 4a90f09b which is quite not some
suitable material for -longterm.

Do you think it's better to completely remove this patch than making
one think the risk of bug is gone while it is not ? Unless we find
something more reliable, I'd rather drop the patch.

Thanks,
Willy


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [stable] [PATCH 029/173] pata_mpc52xx: inherit from ata_bmdma_port_ops
  2011-04-26 10:44   ` Sergei Shtylyov
@ 2011-04-26 19:56     ` Willy Tarreau
  0 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-26 19:56 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: stable, Greg Kroah-Hartman, linux-kernel, Jeff Garzik, Tejun Heo,
	stable-review

Hello Sergei,

On Tue, Apr 26, 2011 at 02:44:38PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 26-04-2011 0:03, Willy Tarreau wrote:
> 
> >2.6.27.59-stable review patch.  If anyone has any objections, please let 
> >us know.
> 
>    DMA support was added to this driver only in 2.6.29, hence this patch is 
> not needed in 2.6.27.y...

Perfect, patch dropped.

Thanks Sergei,
Willy


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 104/173] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code
  2011-04-26 13:03   ` Oleg Nesterov
@ 2011-04-26 20:00     ` Willy Tarreau
  0 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-26 20:00 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: linux-kernel, stable, stable-review, Julien Tinnes,
	Linus Torvalds, Greg Kroah-Hartman

Hi Oleg,

On Tue, Apr 26, 2011 at 03:03:50PM +0200, Oleg Nesterov wrote:
> On 04/25, Willy Tarreau wrote:
> >
> > 2.6.27.59-stable review patch.  If anyone has any objections, please let us know.
> >
> > ------------------
> >
> > From: Julien Tinnes <jln@google.com>
> >
> > commit da48524eb20662618854bb3df2db01fc65f3070c upstream.
> 
> This also needs 243b422af9ea9af4ead07a8ad54c90d4f9b6081a

Thanks for checking. In fact we already have it in patch 121 so we're fine.

Best regards,
Willy


^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference
  2011-04-26 19:53     ` Willy Tarreau
@ 2011-04-26 22:01       ` Jiri Slaby
  2011-04-27  9:29         ` Alan Cox
  0 siblings, 1 reply; 192+ messages in thread
From: Jiri Slaby @ 2011-04-26 22:01 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: linux-kernel, stable, stable-review, Alan Cox, Greg Kroah-Hartman

On 04/26/2011 09:53 PM, Willy Tarreau wrote:
> On Tue, Apr 26, 2011 at 12:07:07PM +0200, Jiri Slaby wrote:
>> On 04/25/2011 10:04 PM, Willy Tarreau wrote:
>>> 2.6.27.59-stable review patch.  If anyone has any objections, please let
>>> us know.
>>>
>>> ------------------
>>>
>>> From: Jiri Slaby<jslaby@suse.cz>
>>>
>>> commit 6960f40a954619857e7095a6179eef896f297077 upstream.
>>>
>>> Make sure that we check the return value of tty_port_tty_get.
>>> Sometimes it may return NULL and we later dereference that.
>>>
>>> The only place here is in kobil_read_int_callback, so fix it.
>>>
>>> Signed-off-by: Jiri Slaby<jslaby@suse.cz>
>>> Cc: Alan Cox<alan@linux.intel.com>
>>> Signed-off-by: Greg Kroah-Hartman<gregkh@suse.de>
>>>
>>> ---
>>>   drivers/usb/serial/kobil_sct.c |    2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> --- a/drivers/usb/serial/kobil_sct.c
>>> +++ b/drivers/usb/serial/kobil_sct.c
>>> @@ -372,7 +372,7 @@ static void kobil_read_int_callback(stru
>>>   	}
>>>
>>>   	tty = port->port.tty;
>>> -	if (urb->actual_length) {
>>> +	if (tty&&   urb->actual_length) {
>>
>> Ok, but this doesn't fix the bug (the URB should be killed or something
>> similar in that kernel), it only makes the window smaller.
>
> OK I get it now, it requires patch 4a90f09b which is quite not some
> suitable material for -longterm.

Yeah and perhaps some other changes (like adding hangup support).

> Do you think it's better to completely remove this patch than making
> one think the risk of bug is gone while it is not ? Unless we find
> something more reliable, I'd rather drop the patch.

To be honest I don't know what's better :). Maybe I would incline to the 
drop-it side, but leaving up to you.

thanks,
-- 
js
suse labs

^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference
  2011-04-26 22:01       ` Jiri Slaby
@ 2011-04-27  9:29         ` Alan Cox
  2011-04-27 19:52           ` Willy Tarreau
  0 siblings, 1 reply; 192+ messages in thread
From: Alan Cox @ 2011-04-27  9:29 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Willy Tarreau, linux-kernel, stable, stable-review, Alan Cox,
	Greg Kroah-Hartman

> >> Ok, but this doesn't fix the bug (the URB should be killed or something
> >> similar in that kernel), it only makes the window smaller.
> >
> > OK I get it now, it requires patch 4a90f09b which is quite not some
> > suitable material for -longterm.
> 
> Yeah and perhaps some other changes (like adding hangup support).
> 
> > Do you think it's better to completely remove this patch than making
> > one think the risk of bug is gone while it is not ? Unless we find
> > something more reliable, I'd rather drop the patch.
> 
> To be honest I don't know what's better :). Maybe I would incline to the 
> drop-it side, but leaving up to you.

I'm not sure why a .27 is still maintained to be honest but the reality
is that the lack of tty refcounting on hangup in old kernels is
exploitable in many cases via vhangup() and other approaches combined
with lack of NULL page protection. In several places NULL tty means
NULL->method() is invoked which on an old kernel where a user process has
mapped user virtual address zero means you just got owned.

This is all well known stuff. SELinux will mitigate fairly effectively on
some vendors systems.

Alan

^ permalink raw reply	[flat|nested] 192+ messages in thread

* Re: [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference
  2011-04-27  9:29         ` Alan Cox
@ 2011-04-27 19:52           ` Willy Tarreau
  0 siblings, 0 replies; 192+ messages in thread
From: Willy Tarreau @ 2011-04-27 19:52 UTC (permalink / raw)
  To: Alan Cox
  Cc: Jiri Slaby, linux-kernel, stable, stable-review, Alan Cox,
	Greg Kroah-Hartman

Hi Alan,

On Wed, Apr 27, 2011 at 10:29:03AM +0100, Alan Cox wrote:
> I'm not sure why a .27 is still maintained to be honest

[OT]

Well, just like 2.4, because there are (a few, but real) users who depend
on it. 2.6.27 was released just 2.5 years ago. There are many places where
servers are deployed to run more than 3 years. With 2.6.32 getting more
reliable nowadays, we could expect to see people deploying it now with
the hope that their servers will still be maintained in 3 years, and we'll
have this discussion again.

[/OT]

> but the reality
> is that the lack of tty refcounting on hangup in old kernels is
> exploitable in many cases via vhangup() and other approaches combined
> with lack of NULL page protection. In several places NULL tty means
> NULL->method() is invoked which on an old kernel where a user process has
> mapped user virtual address zero means you just got owned.

I completely agree with this. This is why I first thought this patch
alone was suitable. However in 2.6.27, DEFAULT_MMAP_MIN_ADDR is set
by default, which substantially reduces the risk.

> This is all well known stuff. SELinux will mitigate fairly effectively on
> some vendors systems.
> 
> Alan

Regards,
Willy


^ permalink raw reply	[flat|nested] 192+ messages in thread

end of thread, other threads:[~2011-04-27 19:53 UTC | newest]

Thread overview: 192+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <46075c3a3ef08be6d70339617d6afc98@local>
2011-04-25 20:02 ` [PATCH 000/173] 2.6.27.59-longterm review Willy Tarreau
2011-04-25 20:02 ` [PATCH 001/173] USB: EHCI: ASPM quirk of ISOC on AMD SB800 Willy Tarreau
2011-04-25 20:02 ` [PATCH 002/173] rt2x00: add device id for windy31 usb device Willy Tarreau
2011-04-25 20:02 ` [PATCH 003/173] hwmon: (via686a) Initialize fan_div values Willy Tarreau
2011-04-25 20:02 ` [PATCH 004/173] USB: usb-storage: unusual_devs entry for CamSport Evo Willy Tarreau
2011-04-25 20:02 ` [PATCH 005/173] USB: EHCI: ASPM quirk of ISOC on AMD Hudson Willy Tarreau
2011-04-25 20:02 ` [PATCH 006/173] USB: EHCI: fix DMA deallocation bug Willy Tarreau
2011-04-25 20:02 ` [PATCH 007/173] USB: g_printer: fix bug in module parameter definitions Willy Tarreau
2011-04-25 20:02 ` [PATCH 008/173] USB: io_edgeport: fix the reported firmware major and minor Willy Tarreau
2011-04-25 20:02 ` [PATCH 009/173] USB: ti_usb: fix module removal Willy Tarreau
2011-04-25 20:02 ` [PATCH 010/173] USB: Storage: Add unusual_devs entry for VTech Kidizoom Willy Tarreau
2011-04-25 20:02 ` [PATCH 011/173] USB: prevent buggy hubs from crashing the USB stack Willy Tarreau
2011-04-25 20:02 ` [PATCH 012/173] [SCSI] fix medium error problems with some arrays which can cause data corruption Willy Tarreau
2011-04-25 20:02 ` [PATCH 013/173] [SCSI] libsas: fix runaway error handler problem Willy Tarreau
2011-04-25 20:02 ` [PATCH 014/173] [media] radio-aimslab.c: Fix gcc 4.5+ bug Willy Tarreau
2011-04-25 20:02 ` [PATCH 015/173] ALSA : au88x0 - Limit number of channels to fix Oops via OSS emu Willy Tarreau
2011-04-25 20:02 ` [PATCH 016/173] Input: i8042 - introduce notimeout blacklist for Dell Vostro V13 Willy Tarreau
2011-04-25 20:02 ` [PATCH 017/173] NFS: Fix "kernel BUG at fs/aio.c:554!" Willy Tarreau
2011-04-25 20:02 ` [PATCH 018/173] rapidio: fix hang on RapidIO doorbell queue full condition Willy Tarreau
2011-04-25 20:02 ` [PATCH 019/173] serial: unbreak billionton CF card Willy Tarreau
2011-04-25 20:02 ` [PATCH 020/173] ptrace: use safer wake up on ptrace_detach() Willy Tarreau
2011-04-25 20:02 ` [PATCH 021/173] fix jiffy calculations in calibrate_delay_direct to handle overflow Willy Tarreau
2011-04-25 20:02 ` [PATCH 022/173] USB: serial: pl2303: Hybrid reader Uniform HCR331 Willy Tarreau
2011-04-25 20:02 ` [PATCH 023/173] drivers: update to pl2303 usb-serial to support Motorola cables Willy Tarreau
2011-04-25 20:02 ` [PATCH 024/173] powerpc: Fix some 6xx/7xxx CPU setup functions Willy Tarreau
2011-04-25 20:02 ` [PATCH 025/173] parisc: pass through \t to early (iodc) console Willy Tarreau
2011-04-25 20:02 ` [PATCH 026/173] parisc : Remove broken line wrapping handling pdc_iodc_print() Willy Tarreau
2011-04-25 20:02 ` [PATCH 027/173] hostap_cs: fix sleeping function called from invalid context Willy Tarreau
2011-04-25 20:03 ` [PATCH 028/173] md: fix regression with re-adding devices to arrays with no metadata Willy Tarreau
2011-04-25 20:03 ` [PATCH 029/173] pata_mpc52xx: inherit from ata_bmdma_port_ops Willy Tarreau
2011-04-26 10:44   ` Sergei Shtylyov
2011-04-26 19:56     ` [stable] " Willy Tarreau
2011-04-25 20:03 ` [PATCH 030/173] TPM: Long default timeout fix Willy Tarreau
2011-04-25 20:03 ` [PATCH 031/173] drm/radeon: remove 0x4243 pci id Willy Tarreau
2011-04-25 20:03 ` [PATCH 032/173] x86, mm: avoid possible bogus tlb entries by clearing prev mm_cpumask after switching mm Willy Tarreau
2011-04-25 20:03 ` [PATCH 033/173] NFSD: memory corruption due to writing beyond the stat array Willy Tarreau
2011-04-25 20:03 ` [PATCH 034/173] sctp: Fix out-of-bounds reading in sctp_asoc_get_hmac() Willy Tarreau
2011-04-25 20:03 ` [PATCH 035/173] ocfs2_connection_find() returns pointer to bad structure Willy Tarreau
2011-04-25 20:03 ` [PATCH 036/173] Fix pktcdvd ioctl dev_minor range check Willy Tarreau
2011-04-25 20:03 ` [PATCH 037/173] filter: make sure filters dont read uninitialized memory Willy Tarreau
2011-04-25 20:03 ` [PATCH 038/173] x25: decrement netdev reference counts on unload Willy Tarreau
2011-04-25 20:03 ` [PATCH 039/173] OHCI: work around for nVidia shutdown problem Willy Tarreau
2011-04-25 21:24   ` Alan Stern
2011-04-25 21:29     ` Willy Tarreau
2011-04-25 20:03 ` [PATCH 040/173] [media] [v3,media] av7110: check for negative array offset Willy Tarreau
2011-04-25 20:03 ` [PATCH 041/173] NFS: fix the return value of nfs_file_fsync() Willy Tarreau
2011-04-25 20:03 ` [PATCH 042/173] isdn: hisax: Replace the bogus access to irq stats Willy Tarreau
2011-04-25 20:03 ` [PATCH 043/173] dm raid1: fail writes if errors are not handled and log fails Willy Tarreau
2011-04-25 20:03 ` [PATCH 044/173] GFS2: Fix bmap allocation corner-case bug Willy Tarreau
2011-04-25 20:03 ` [PATCH 045/173] sunrpc/cache: fix module refcnt leak in a failure path Willy Tarreau
2011-04-25 20:03 ` [PATCH 046/173] tcp: Increase TCP_MAXSEG socket option minimum Willy Tarreau
2011-04-25 20:03 ` [PATCH 047/173] tcp: Make TCP_MAXSEG minimum more correct Willy Tarreau
2011-04-25 20:03 ` [PATCH 048/173] nfsd: correctly handle return value from nfsd_map_name_to_* Willy Tarreau
2011-04-25 20:03 ` [PATCH 049/173] s390: remove task_show_regs Willy Tarreau
2011-04-25 20:03 ` [PATCH 050/173] fs/partitions: Validate map_count in Mac partition tables Willy Tarreau
2011-04-25 20:03 ` [PATCH 051/173] [media] radio-aimslab.c needs #include <linux/delay.h> Willy Tarreau
2011-04-25 20:03 ` [PATCH 052/173] ARM: Ensure predictable endian state on signal handler entry Willy Tarreau
2011-04-25 20:03 ` [PATCH 053/173] platform: x86: asus_acpi: world-writable procfs files Willy Tarreau
2011-04-25 20:03 ` [PATCH 054/173] acer-wmi: Fix capitalisation of GUID Willy Tarreau
2011-04-25 22:00   ` Carlos Corbacho
2011-04-25 22:44     ` [stable] " Willy Tarreau
2011-04-25 20:03 ` [PATCH 055/173] platform: x86: acer-wmi: world-writable sysfs threeg file Willy Tarreau
2011-04-25 20:03 ` [PATCH 056/173] platform: x86: tc1100-wmi: world-writable sysfs wireless and jogdial files Willy Tarreau
2011-04-25 20:03 ` [PATCH 057/173] genirq: Disable the SHIRQ_DEBUG call in request_threaded_irq for now Willy Tarreau
2011-04-25 20:03 ` [PATCH 058/173] usb: musb: omap2430: fix kernel panic on reboot Willy Tarreau
2011-04-25 20:03 ` [PATCH 059/173] ldm: corrupted partition table can cause kernel oops Willy Tarreau
2011-04-25 20:03 ` [PATCH 060/173] md: correctly handle probe of an mdp device Willy Tarreau
2011-04-25 20:03 ` [PATCH 061/173] x25: Do not reference freed memory Willy Tarreau
2011-04-25 20:03 ` [PATCH 062/173] mfd: Fix NULL pointer due to non-initialized ucb1x00-ts absinfo Willy Tarreau
2011-04-25 20:03 ` [PATCH 063/173] x86: Use u32 instead of long to set reset vector back to 0 Willy Tarreau
2011-04-25 20:03 ` [PATCH 064/173] ext2: Fix link count corruption under heavy link+rename load Willy Tarreau
2011-04-25 20:03 ` [PATCH 065/173] sctp: Fix oops when sending queued ASCONF chunks Willy Tarreau
2011-04-25 20:03 ` [PATCH 066/173] virtio: set pci bus master enable bit Willy Tarreau
2011-04-25 20:03 ` [PATCH 067/173] dccp: fix oops on Reset after close Willy Tarreau
2011-04-25 20:03 ` [PATCH 068/173] r8169: disable ASPM Willy Tarreau
2011-04-25 20:03 ` [PATCH 069/173] usb: iowarrior: dont trust report_size for buffer size Willy Tarreau
2011-04-25 20:03 ` [PATCH 070/173] [S390] keyboard: integer underflow bug Willy Tarreau
2011-04-25 20:03 ` [PATCH 071/173] mm: fix possible cause of a page_mapped BUG Willy Tarreau
2011-04-25 20:03 ` [PATCH 072/173] powerpc/kdump: CPUs assume the context of the oopsing CPU Willy Tarreau
2011-04-25 20:03 ` [PATCH 073/173] powerpc/kdump: Use chip->shutdown to disable IRQs Willy Tarreau
2011-04-25 20:03 ` [PATCH 074/173] powerpc: Use more accurate limit for first segment memory allocations Willy Tarreau
2011-04-25 20:03 ` [PATCH 075/173] powerpc/pseries: Add hcall to read 4 ptes at a time in real mode Willy Tarreau
2011-04-25 20:03 ` [PATCH 076/173] powerpc/kexec: Speedup kexec hash PTE tear down Willy Tarreau
2011-04-25 20:03 ` [PATCH 077/173] powerpc/crashdump: Do not fail on NULL pointer dereferencing Willy Tarreau
2011-04-25 20:03 ` [PATCH 078/173] powerpc/kexec: Fix orphaned offline CPUs across kexec Willy Tarreau
2011-04-25 20:03 ` [PATCH 079/173] hwmon/f71882fg: Set platform drvdata to NULL later Willy Tarreau
2011-04-25 20:03 ` [PATCH 080/173] libata: no special completion processing for EH commands Willy Tarreau
2011-04-25 20:03 ` [PATCH 081/173] x86: Fix panic when handling "mem={invalid}" param Willy Tarreau
2011-04-25 20:03 ` [PATCH 082/173] ahci: add device IDs for Ibex Peak ahci controllers Willy Tarreau
2011-04-25 20:03 ` [PATCH 083/173] ahci: AHCI and RAID mode SATA patch for Intel Cougar Point DeviceIDs Willy Tarreau
2011-04-25 20:03 ` [PATCH 084/173] ahci: AHCI and RAID mode SATA patch for Intel Patsburg DeviceIDs Willy Tarreau
2011-04-25 20:03 ` [PATCH 085/173] ahci: AHCI mode SATA patch for Intel DH89xxCC DeviceIDs Willy Tarreau
2011-04-25 20:03 ` [PATCH 086/173] ahci: AHCI mode SATA patch for Intel Patsburg SATA RAID controller Willy Tarreau
2011-04-25 20:03 ` [PATCH 087/173] RDMA/cma: Fix crash in request handlers Willy Tarreau
2011-04-25 20:04 ` [PATCH 088/173] IB/cm: Bump reference count on cm_id before invoking callback Willy Tarreau
2011-04-25 20:04 ` [PATCH 089/173] x86, quirk: Fix SB600 revision check Willy Tarreau
2011-04-25 20:04 ` [PATCH 090/173] USB: serial/kobil_sct, fix potential tty NULL dereference Willy Tarreau
2011-04-26 10:07   ` Jiri Slaby
2011-04-26 19:53     ` Willy Tarreau
2011-04-26 22:01       ` Jiri Slaby
2011-04-27  9:29         ` Alan Cox
2011-04-27 19:52           ` Willy Tarreau
2011-04-25 20:04 ` [PATCH 091/173] USB: serial: ch341: add new id Willy Tarreau
2011-04-25 20:04 ` [PATCH 092/173] PCI: add more checking to ICH region quirks Willy Tarreau
2011-04-25 20:04 ` [PATCH 093/173] PCI: do not create quirk I/O regions below PCIBIOS_MIN_IO for ICH Willy Tarreau
2011-04-25 20:04 ` [PATCH 094/173] SUNRPC: Ensure we always run the tk_callback before tk_action Willy Tarreau
2011-04-25 20:04 ` [PATCH 095/173] ext3: Always set dx_nodes fake_dirent explicitly Willy Tarreau
2011-04-25 20:04 ` [PATCH 096/173] x86: Flush TLB if PGD entry is changed in i386 PAE mode Willy Tarreau
2011-04-25 20:04 ` [PATCH 097/173] isdn: avoid calling tty_ldisc_flush() in atomic context Willy Tarreau
2011-04-25 20:04 ` [PATCH 098/173] [PARISC] fix per-cpu flag problem in the cpu affinity checkers Willy Tarreau
2011-04-25 20:04 ` [PATCH 099/173] powerpc/kdump: Fix race in kdump shutdown Willy Tarreau
2011-04-25 20:04 ` [PATCH 100/173] powerpc: rtas_flash needs to use rtas_data_buf Willy Tarreau
2011-04-25 20:04 ` [PATCH 101/173] x86, binutils, xen: Fix another wrong size directive Willy Tarreau
2011-04-25 20:04 ` [PATCH 102/173] aio: wake all waiters when destroying ctx Willy Tarreau
2011-04-25 20:04 ` [PATCH 103/173] shmem: let shared anonymous be nonlinear again Willy Tarreau
2011-04-25 20:04 ` [PATCH 104/173] Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code Willy Tarreau
2011-04-26 13:03   ` Oleg Nesterov
2011-04-26 20:00     ` Willy Tarreau
2011-04-25 20:04 ` [PATCH 105/173] ext3: skip orphan cleanup on rocompat fs Willy Tarreau
2011-04-25 20:04 ` [PATCH 106/173] procfs: fix /proc/<pid>/maps heap check Willy Tarreau
2011-04-25 20:04 ` [PATCH 107/173] proc: protect mm start_code/end_code in /proc/pid/stat Willy Tarreau
2011-04-25 20:04 ` [PATCH 108/173] fbcon: Bugfix soft cursor detection in Tile Blitting Willy Tarreau
2011-04-25 20:04 ` [PATCH 109/173] ehci-hcd: Bug fix: dont set a QHs Halt bit Willy Tarreau
2011-04-25 20:04 ` [PATCH 110/173] USB: uss720 fixup refcount position Willy Tarreau
2011-04-25 20:04 ` [PATCH 111/173] USB: cdc-acm: fix potential null-pointer dereference on disconnect Willy Tarreau
2011-04-25 20:04 ` [PATCH 112/173] Input: xen-kbdfront - advertise either absolute or relative coordinates Willy Tarreau
2011-04-25 20:31   ` Olaf Hering
2011-04-25 20:42     ` Willy Tarreau
2011-04-26  3:07     ` Konrad Rzeszutek Wilk
2011-04-25 20:04 ` [PATCH 113/173] dcdbas: force SMI to happen when expected Willy Tarreau
2011-04-25 20:04 ` [PATCH 114/173] myri10ge: fix rmmod crash Willy Tarreau
2011-04-25 20:04 ` [PATCH 115/173] cciss: fix lost command issue Willy Tarreau
2011-04-25 20:04 ` [PATCH 116/173] sound/oss/opl3: validate voice and channel indexes Willy Tarreau
2011-04-25 20:04 ` [PATCH 117/173] mac80211: initialize sta->last_rx in sta_info_alloc Willy Tarreau
2011-04-25 20:04 ` [PATCH 118/173] [SCSI] ses: show devices for enclosures with no page 7 Willy Tarreau
2011-04-25 20:04 ` [PATCH 119/173] [SCSI] ses: Avoid kernel panic when lun 0 is not mapped Willy Tarreau
2011-04-25 20:04 ` [PATCH 120/173] eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix Willy Tarreau
2011-04-25 20:04 ` [PATCH 121/173] Relax si_code check in rt_sigqueueinfo and rt_tgsigqueueinfo Willy Tarreau
2011-04-25 20:04 ` [PATCH 122/173] xfs: prevent leaking uninitialized stack memory in FSGEOMETRY_V1 Willy Tarreau
2011-04-25 20:04 ` [PATCH 123/173] irda: validate peer name and attribute lengths Willy Tarreau
2011-04-25 20:04 ` [PATCH 124/173] irda: prevent heap corruption on invalid nickname Willy Tarreau
2011-04-25 20:04 ` [PATCH 125/173] ASoC: Explicitly say registerless widgets have no register Willy Tarreau
2011-04-25 20:04 ` [PATCH 126/173] ALSA: ens1371: fix Creative Ectiva support Willy Tarreau
2011-04-25 20:04 ` [PATCH 127/173] ROSE: prevent heap corruption with bad facilities Willy Tarreau
2011-04-25 20:04 ` [PATCH 128/173] UBIFS: do not read flash unnecessarily Willy Tarreau
2011-04-25 20:04 ` [PATCH 129/173] UBIFS: fix oops on error path in read_pnode Willy Tarreau
2011-04-25 20:04 ` [PATCH 130/173] quota: Dont write quota info in dquot_commit() Willy Tarreau
2011-04-25 20:04 ` [PATCH 131/173] mm: avoid wrapping vm_pgoff in mremap() Willy Tarreau
2011-04-25 20:04 ` [PATCH 132/173] Bluetooth: sco: fix information leak to userspace Willy Tarreau
2011-04-25 20:04 ` [PATCH 133/173] bridge: netfilter: fix information leak Willy Tarreau
2011-04-25 20:04 ` [PATCH 134/173] Bluetooth: bnep: fix buffer overflow Willy Tarreau
2011-04-25 20:04 ` [PATCH 135/173] Bluetooth: add support for Apple MacBook Pro 8,2 Willy Tarreau
2011-04-25 20:04 ` [PATCH 136/173] Treat writes as new when holes span across page boundaries Willy Tarreau
2011-04-25 20:04 ` [PATCH 137/173] char/tpm: Fix unitialized usage of data buffer Willy Tarreau
2011-04-25 20:04 ` [PATCH 138/173] netfilter: ip_tables: fix infoleak to userspace Willy Tarreau
2011-04-25 20:04 ` [PATCH 139/173] netfilter: arp_tables: " Willy Tarreau
2011-04-25 20:04 ` [PATCH 140/173] netfilter: ipt_CLUSTERIP: fix buffer overflow Willy Tarreau
2011-04-25 20:04 ` [PATCH 141/173] ipv6: netfilter: ip6_tables: fix infoleak to userspace Willy Tarreau
2011-04-25 20:04 ` [PATCH 142/173] drivers/rtc/rtc-ds1511.c: world-writable sysfs nvram file Willy Tarreau
2011-04-25 20:04 ` [PATCH 143/173] econet: 4 byte infoleak to the network Willy Tarreau
2011-04-25 20:04 ` [PATCH 144/173] sound/oss: remove offset from load_patch callbacks Willy Tarreau
2011-04-25 20:04 ` [PATCH 145/173] sound: oss: midi_synth: check get_user() return value Willy Tarreau
2011-04-25 20:04 ` [PATCH 146/173] repair gdbstub to match the gdbserial protocol specification Willy Tarreau
2011-04-25 20:04 ` [PATCH 147/173] powerpc/kexec: Add ifdef CONFIG_PPC_STD_MMU_64 to PPC64 code Willy Tarreau
2011-04-25 20:05 ` [PATCH 148/173] powerpc: Fix default_machine_crash_shutdown #ifdef botch Willy Tarreau
2011-04-25 20:05 ` [PATCH 149/173] sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set Willy Tarreau
2011-04-25 20:05 ` [PATCH 150/173] net: ax25: fix information leak to userland Willy Tarreau
2011-04-25 20:05 ` [PATCH 151/173] net: packet: " Willy Tarreau
2011-04-25 20:05 ` [PATCH 152/173] ext4: fix credits computing for indirect mapped files Willy Tarreau
2011-04-25 20:05 ` [PATCH 153/173] nfsd: fix auth_domain reference leak on nlm operations Willy Tarreau
2011-04-25 20:05 ` [PATCH 154/173] net: tipc: fix information leak to userland Willy Tarreau
2011-04-25 20:05 ` [PATCH 155/173] inet_diag: Make sure we actually run the same bytecode we audited Willy Tarreau
2011-04-25 20:05 ` [PATCH 156/173] econet: Fix crash in aun_incoming() Willy Tarreau
2011-04-25 20:05 ` [PATCH 157/173] irda: prevent integer underflow in IRLMP_ENUMDEVICES Willy Tarreau
2011-04-25 20:05 ` [PATCH 158/173] CAN: Use inode instead of kernel address for /proc file Willy Tarreau
2011-04-25 20:05 ` [PATCH 159/173] exec: make argv/envp memory visible to oom-killer Willy Tarreau
2011-04-25 20:05 ` [PATCH 160/173] exec: copy-and-paste the fixes into compat_do_execve() paths Willy Tarreau
2011-04-25 20:05 ` [PATCH 161/173] xfs: zero proper structure size for geometry calls Willy Tarreau
2011-04-25 20:05 ` [PATCH 162/173] [media] video: sn9c102: world-wirtable sysfs files Willy Tarreau
2011-04-25 20:05 ` [PATCH 163/173] x86: Fix a bogus unwind annotation in lib/semaphore_32.S Willy Tarreau
2011-04-25 20:05 ` [PATCH 164/173] [IA64] tioca: Fix assignment from incompatible pointer warnings Willy Tarreau
2011-04-25 20:05 ` [PATCH 165/173] ramfs: fix memleak on no-mmu arch Willy Tarreau
2011-04-26  0:37   ` Hugh Dickins
2011-04-26  5:01     ` Willy Tarreau
2011-04-25 20:05 ` [PATCH 166/173] MAINTAINERS: update STABLE BRANCH info Willy Tarreau
2011-04-25 20:05 ` [PATCH 167/173] UBIFS: fix oops when R/O file-system is fsynced Willy Tarreau
2011-04-25 20:05 ` [PATCH 168/173] next_pidmap: fix overflow condition Willy Tarreau
2011-04-25 20:05 ` [PATCH 169/173] proc: do proper range check on readdir offset Willy Tarreau
2011-04-25 20:05 ` [PATCH 170/173] USB: EHCI: unlink unused QHs when the controller is stopped Willy Tarreau
2011-04-25 20:05 ` [PATCH 171/173] net: ax25: fix information leak to userland harder Willy Tarreau
2011-04-25 20:05 ` [PATCH 172/173] net: Fix oops from tcp_collapse() when using splice() Willy Tarreau
2011-04-25 20:05 ` [PATCH 173/173] [SCSI] mptsas: fix hangs caused by ATA pass-through Willy Tarreau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).