1. 14 Feb, 2013 3 commits
    • T Makphaibulchoke's avatar
      kernel/resource.c: fix stack overflow in __reserve_region_with_split() · 4d973b29
      T Makphaibulchoke authored
      commit 4965f566 upstream.
      
      Using a recursive call add a non-conflicting region in
      __reserve_region_with_split() could result in a stack overflow in the case
      that the recursive calls are too deep.  Convert the recursive calls to an
      iterative loop to avoid the problem.
      
      Tested on a machine containing 135 regions.  The kernel no longer panicked
      with stack overflow.
      
      Also tested with code arbitrarily adding regions with no conflict,
      embedding two consecutive conflicts and embedding two non-consecutive
      conflicts.
      Signed-off-by: default avatarT Makphaibulchoke <tmac@hp.com>
      Reviewed-by: default avatarRam Pai <linuxram@us.ibm.com>
      Cc: Paul Gortmaker <paul.gortmaker@gmail.com>
      Cc: Wei Yang <weiyang@linux.vnet.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4d973b29
    • Sjur Brændeland's avatar
      virtio_console: Don't access uninitialized data. · 61cf42c5
      Sjur Brændeland authored
      commit aded024a upstream.
      
      Don't access uninitialized work-queue when removing device.
      The work queue is initialized only if the device multi-queue.
      So don't call cancel_work unless this is a multi-queue device.
      
      This fixes the following panic:
      
      Kernel panic - not syncing: BUG!
      Call Trace:
      62031b28:  [<6026085d>] panic+0x16b/0x2d3
      62031b30:  [<6004ef5e>] flush_work+0x0/0x1d7
      62031b60:  [<602606f2>] panic+0x0/0x2d3
      62031b68:  [<600333b0>] memcpy+0x0/0x140
      62031b80:  [<6002d58a>] unblock_signals+0x0/0x84
      62031ba0:  [<602609c5>] printk+0x0/0xa0
      62031bd8:  [<60264e51>] __mutex_unlock_slowpath+0x13d/0x148
      62031c10:  [<6004ef5e>] flush_work+0x0/0x1d7
      62031c18:  [<60050234>] try_to_grab_pending+0x0/0x17e
      62031c38:  [<6004e984>] get_work_gcwq+0x71/0x8f
      62031c48:  [<60050539>] __cancel_work_timer+0x5b/0x115
      62031c78:  [<628acc85>] unplug_port+0x0/0x191 [virtio_console]
      62031c98:  [<6005061c>] cancel_work_sync+0x12/0x14
      62031ca8:  [<628ace96>] virtcons_remove+0x80/0x15c [virtio_console]
      62031ce8:  [<628191de>] virtio_dev_remove+0x1e/0x7e [virtio]
      62031d08:  [<601cf242>] __device_release_driver+0x75/0xe4
      62031d28:  [<601cf2dd>] device_release_driver+0x2c/0x40
      62031d48:  [<601ce0dd>] driver_unbind+0x7d/0xc6
      62031d88:  [<601cd5d9>] drv_attr_store+0x27/0x29
      62031d98:  [<60115f61>] sysfs_write_file+0x100/0x14d
      62031df8:  [<600b737d>] vfs_write+0xcb/0x184
      62031e08:  [<600b58b8>] filp_close+0x88/0x94
      62031e38:  [<600b7686>] sys_write+0x59/0x88
      62031e88:  [<6001ced1>] handle_syscall+0x5d/0x80
      62031ea8:  [<60030a74>] userspace+0x405/0x531
      62031f08:  [<600d32cc>] sys_dup+0x0/0x5e
      62031f28:  [<601b11d6>] strcpy+0x0/0x18
      62031f38:  [<600be46c>] do_execve+0x10/0x12
      62031f48:  [<600184c7>] run_init_process+0x43/0x45
      62031fd8:  [<60019a91>] new_thread_handler+0xba/0xbc
      Signed-off-by: default avatarSjur Brændeland <sjur.brandeland@stericsson.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      61cf42c5
    • Larry Finger's avatar
      rtlwifi: Fix the usage of the wrong variable in usb.c · ff3c8fd1
      Larry Finger authored
      commit 0a06ad8e upstream.
      
      In routine _rtl_rx_pre_process(), skb_dequeue() is called to get an skb;
      however, the wrong variable name is used in subsequent calls.
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ff3c8fd1
  2. 11 Feb, 2013 17 commits
  3. 04 Feb, 2013 16 commits
  4. 28 Jan, 2013 4 commits
    • Greg Kroah-Hartman's avatar
      Linux 3.0.61 · 214dfbe8
      Greg Kroah-Hartman authored
      214dfbe8
    • Shuah Khan's avatar
      ioat: Fix DMA memory sync direction correct flag · be6ee99f
      Shuah Khan authored
      commit ac498987 upstream.
      
      ioat does DMA memory sync with DMA_TO_DEVICE direction on a buffer allocated
      for DMA_FROM_DEVICE dma, resulting in the following warning from dma debug.
      Fixed the dma_sync_single_for_device() call to use the correct direction.
      
      [  226.288947] WARNING: at lib/dma-debug.c:990 check_sync+0x132/0x550()
      [  226.288948] Hardware name: ProLiant DL380p Gen8
      [  226.288951] ioatdma 0000:00:04.0: DMA-API: device driver syncs DMA memory with different direction [device address=0x00000000ffff7000] [size=4096 bytes] [mapped with DMA_FROM_DEVICE] [synced with DMA_TO_DEVICE]
      [  226.288953] Modules linked in: iTCO_wdt(+) sb_edac(+) ioatdma(+) microcode serio_raw pcspkr edac_core hpwdt(+) iTCO_vendor_support hpilo(+) dca acpi_power_meter ata_generic pata_acpi sd_mod crc_t10dif ata_piix libata hpsa tg3 netxen_nic(+) sunrpc dm_mirror dm_region_hash dm_log dm_mod
      [  226.288967] Pid: 1055, comm: work_for_cpu Tainted: G        W    3.3.0-0.20.el7.x86_64 #1
      [  226.288968] Call Trace:
      [  226.288974]  [<ffffffff810644cf>] warn_slowpath_common+0x7f/0xc0
      [  226.288977]  [<ffffffff810645c6>] warn_slowpath_fmt+0x46/0x50
      [  226.288980]  [<ffffffff81345502>] check_sync+0x132/0x550
      [  226.288983]  [<ffffffff81345c9f>] debug_dma_sync_single_for_device+0x3f/0x50
      [  226.288988]  [<ffffffff81661002>] ? wait_for_common+0x72/0x180
      [  226.288995]  [<ffffffffa019590f>] ioat_xor_val_self_test+0x3e5/0x832 [ioatdma]
      [  226.288999]  [<ffffffff811a5739>] ? kfree+0x259/0x270
      [  226.289004]  [<ffffffffa0195d77>] ioat3_dma_self_test+0x1b/0x20 [ioatdma]
      [  226.289008]  [<ffffffffa01952c3>] ioat_probe+0x2f8/0x348 [ioatdma]
      [  226.289011]  [<ffffffffa0195f51>] ioat3_dma_probe+0x1d5/0x2aa [ioatdma]
      [  226.289016]  [<ffffffffa0194d12>] ioat_pci_probe+0x139/0x17c [ioatdma]
      [  226.289020]  [<ffffffff81354b8c>] local_pci_probe+0x5c/0xd0
      [  226.289023]  [<ffffffff81083e50>] ? destroy_work_on_stack+0x20/0x20
      [  226.289025]  [<ffffffff81083e68>] do_work_for_cpu+0x18/0x30
      [  226.289029]  [<ffffffff8108d997>] kthread+0xb7/0xc0
      [  226.289033]  [<ffffffff8166cef4>] kernel_thread_helper+0x4/0x10
      [  226.289036]  [<ffffffff81662d20>] ? _raw_spin_unlock_irq+0x30/0x50
      [  226.289038]  [<ffffffff81663234>] ? retint_restore_args+0x13/0x13
      [  226.289041]  [<ffffffff8108d8e0>] ? kthread_worker_fn+0x1a0/0x1a0
      [  226.289044]  [<ffffffff8166cef0>] ? gs_change+0x13/0x13
      [  226.289045] ---[ end trace e1618afc7a606089 ]---
      [  226.289047] Mapped at:
      [  226.289048]  [<ffffffff81345307>] debug_dma_map_page+0x87/0x150
      [  226.289050]  [<ffffffffa019653c>] dma_map_page.constprop.18+0x70/0xb34 [ioatdma]
      [  226.289054]  [<ffffffffa0195702>] ioat_xor_val_self_test+0x1d8/0x832 [ioatdma]
      [  226.289058]  [<ffffffffa0195d77>] ioat3_dma_self_test+0x1b/0x20 [ioatdma]
      [  226.289061]  [<ffffffffa01952c3>] ioat_probe+0x2f8/0x348 [ioatdma]
      Signed-off-by: default avatarShuah Khan <shuah.khan@hp.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be6ee99f
    • Konrad Rzeszutek Wilk's avatar
      ACPI / cpuidle: Fix NULL pointer issues when cpuidle is disabled · a94e7cf8
      Konrad Rzeszutek Wilk authored
      commit b88a634a upstream.
      
      If cpuidle is disabled, that means that:
      
      	per_cpu(acpi_cpuidle_device, pr->id)
      
      is set to NULL as the acpi_processor_power_init ends up failing at
      
      	 retval = cpuidle_register_driver(&acpi_idle_driver)
      
      (in acpi_processor_power_init) and never sets the per_cpu idle
      device.  So when acpi_processor_hotplug on CPU online notification
      tries to reference said device it crashes:
      
      cpu 3 spinlock event irq 62
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
      IP: [<ffffffff81381013>] acpi_processor_setup_cpuidle_cx+0x3f/0x105
      PGD a259b067 PUD ab38b067 PMD 0
      Oops: 0002 [#1] SMP
      odules linked in: dm_multipath dm_mod xen_evtchn iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi libcrc32c crc32c nouveau mxm_wmi wmi radeon ttm sg sr_mod sd_mod cdrom ata_generic ata_piix libata crc32c_intel scsi_mod atl1c i915 fbcon tileblit font bitblit softcursor drm_kms_helper video xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd mperf
      CPU 1
      Pid: 3047, comm: bash Not tainted 3.8.0-rc3upstream-00250-g165c029 #1 MSI MS-7680/H61M-P23 (MS-7680)
      RIP: e030:[<ffffffff81381013>]  [<ffffffff81381013>] acpi_processor_setup_cpuidle_cx+0x3f/0x105
      RSP: e02b:ffff88001742dca8  EFLAGS: 00010202
      RAX: 0000000000010be9 RBX: ffff8800a0a61800 RCX: ffff880105380000
      RDX: 0000000000000003 RSI: 0000000000000200 RDI: ffff8800a0a61800
      RBP: ffff88001742dce8 R08: ffffffff81812360 R09: 0000000000000200
      R10: aaaaaaaaaaaaaaaa R11: 0000000000000001 R12: ffff8800a0a61800
      R13: 00000000ffffff01 R14: 0000000000000000 R15: ffffffff81a907a0
      FS:  00007fd6942f7700(0000) GS:ffff880105280000(0000) knlGS:0000000000000000
      CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000004 CR3: 00000000a6773000 CR4: 0000000000042660
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process bash (pid: 3047, threadinfo ffff88001742c000, task ffff880017944000)
      Stack:
       0000000000000150 ffff880100f59e00 ffff88001742dcd8 ffff8800a0a61800
       0000000000000000 00000000ffffff01 0000000000000000 ffffffff81a907a0
       ffff88001742dd18 ffffffff813815b1 ffff88001742dd08 ffffffff810ae336
      Call Trace:
       [<ffffffff813815b1>] acpi_processor_hotplug+0x7c/0x9f
       [<ffffffff810ae336>] ? schedule_delayed_work_on+0x16/0x20
       [<ffffffff8137ee8f>] acpi_cpu_soft_notify+0x90/0xca
       [<ffffffff8166023d>] notifier_call_chain+0x4d/0x70
       [<ffffffff810bc369>] __raw_notifier_call_chain+0x9/0x10
       [<ffffffff81094a4b>] __cpu_notify+0x1b/0x30
       [<ffffffff81652cf7>] _cpu_up+0x103/0x14b
       [<ffffffff81652e18>] cpu_up+0xd9/0xec
       [<ffffffff8164a254>] store_online+0x94/0xd0
       [<ffffffff814122fb>] dev_attr_store+0x1b/0x20
       [<ffffffff81216404>] sysfs_write_file+0xf4/0x170
      
      This patch fixes it.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a94e7cf8
    • Robin Holt's avatar
      SGI-XP: handle non-fatal traps · 06cce029
      Robin Holt authored
      commit 891348ca upstream.
      
      We found a user code which was raising a divide-by-zero trap.  That trap
      would lead to XPC connections between system-partitions being torn down
      due to the die_chain notifier callouts it received.
      
      This also revealed a different issue where multiple callers into
      xpc_die_deactivate() would all attempt to do the disconnect in parallel
      which would sometimes lock up but often overwhelm the console on very
      large machines as each would print at least one line of output at the
      end of the deactivate.
      
      I reviewed all the users of the die_chain notifier and changed the code
      to ignore the notifier callouts for reasons which will not actually lead
      to a system to continue on to call die().
      
      [akpm@linux-foundation.org: fix ia64]
      Signed-off-by: default avatarRobin Holt <holt@sgi.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      06cce029