1. 09 Dec, 2010 32 commits
  2. 22 Nov, 2010 8 commits
    • Greg Kroah-Hartman's avatar
      Linux 2.6.32.26 · b55f3d92
      Greg Kroah-Hartman authored
      b55f3d92
    • Robin Holt's avatar
      sgi-xp: incoming XPC channel messages can come in after the channel's... · 73d4907e
      Robin Holt authored
      sgi-xp: incoming XPC channel messages can come in after the channel's partition structures have been torn down
      
      commit 09358972 upstream.
      
      Under some workloads, some channel messages have been observed being
      delayed on the sending side past the point where the receiving side has
      been able to tear down its partition structures.
      
      This condition is already detected in xpc_handle_activate_IRQ_uv(), but
      that information is not given to xpc_handle_activate_mq_msg_uv().  As a
      result, xpc_handle_activate_mq_msg_uv() assumes the structures still exist
      and references them, causing a NULL-pointer deref.
      Signed-off-by: default avatarRobin Holt <holt@sgi.com>
      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@suse.de>
      
      73d4907e
    • Mike Christie's avatar
      Fix regressions in scsi_internal_device_block · c4244895
      Mike Christie authored
      commit 986fe6c7 upstream.
      
      Deleting a SCSI device on a blocked fc_remote_port (before
      fast_io_fail_tmo fires) results in a hanging thread:
      
        STACK:
        0 schedule+1108 [0x5cac48]
        1 schedule_timeout+528 [0x5cb7fc]
        2 wait_for_common+266 [0x5ca6be]
        3 blk_execute_rq+160 [0x354054]
        4 scsi_execute+324 [0x3b7ef4]
        5 scsi_execute_req+162 [0x3b80ca]
        6 sd_sync_cache+138 [0x3cf662]
        7 sd_shutdown+138 [0x3cf91a]
        8 sd_remove+112 [0x3cfe4c]
        9 __device_release_driver+124 [0x3a08b8]
      10 device_release_driver+60 [0x3a0a5c]
      11 bus_remove_device+266 [0x39fa76]
      12 device_del+340 [0x39d818]
      13 __scsi_remove_device+204 [0x3bcc48]
      14 scsi_remove_device+66 [0x3bcc8e]
      15 sysfs_schedule_callback_work+50 [0x260d66]
      16 worker_thread+622 [0x162326]
      17 kthread+160 [0x1680b0]
      18 kernel_thread_starter+6 [0x10aaea]
      
      During the delete, the SCSI device is in moved to SDEV_CANCEL.  When
      the FC transport class later calls scsi_target_unblock, this has no
      effect, since scsi_internal_device_unblock ignores SCSI devics in this
      state.
      
      It looks like all these are regressions caused by:
      5c10e63c
      [SCSI] limit state transitions in scsi_internal_device_unblock
      
      Fix by rejecting offline and cancel in the state transition.
      Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
      [jejb: Original patch by Christof Schmitt, modified by Mike Christie]
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c4244895
    • Christof Schmitt's avatar
      Fix race when removing SCSI devices · d8482738
      Christof Schmitt authored
      commit 546ae796 upstream.
      
      Removing SCSI devices through
      echo 1 > /sys/bus/scsi/devices/ ... /delete
      
      while the FC transport class removes the SCSI target can lead to an
      oops:
      
      Unable to handle kernel pointer dereference at virtual kernel address 00000000b6815000
      Oops: 0011 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      Modules linked in: sunrpc qeth_l3 binfmt_misc dm_multipath scsi_dh dm_mod ipv6 qeth ccwgroup [last unloaded: scsi_wait_scan]
      CPU: 1 Not tainted 2.6.35.5-45.x.20100924-s390xdefault #1
      Process fc_wq_0 (pid: 861, task: 00000000b7331240, ksp: 00000000b735bac0)
      Krnl PSW : 0704200180000000 00000000003ff6e4 (__scsi_remove_device+0x24/0xd0)
                 R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:0 CC:2 PM:0 EA:3
      Krnl GPRS: 0000000000000001 0000000000000000 00000000b6815000 00000000bc24a8c0
                 00000000003ff7c8 000000000056dbb8 0000000000000002 0000000000835d80
                 ffffffff00000000 0000000000001000 00000000b6815000 00000000bc24a7f0
                 00000000b68151a0 00000000b6815000 00000000b735bc20 00000000b735bbf8
      Krnl Code: 00000000003ff6d6: a7840001            brc 8,3ff6d8
                 00000000003ff6da: a7fbffd8            aghi %r15,-40
                 00000000003ff6de: e3e0f0980024        stg %r14,152(%r15)
                >00000000003ff6e4: e31021200004        lg %r1,288(%r2)
                 00000000003ff6ea: a71f0000            cghi    %r1,0
                 00000000003ff6ee: a7a40011            brc 10,3ff710
                 00000000003ff6f2: a7390003            lghi    %r3,3
                 00000000003ff6f6: c0e5ffffc8b1        brasl %r14,3f8858
      Call Trace:
      ([<0000000000001000>] 0x1000)
       [<00000000003ff7d2>] scsi_remove_device+0x42/0x54
       [<00000000003ff8ba>] __scsi_remove_target+0xca/0xfc
       [<00000000003ff99a>] __remove_child+0x3a/0x48
       [<00000000003e3246>] device_for_each_child+0x72/0xbc
       [<00000000003ff93a>] scsi_remove_target+0x4e/0x74
       [<0000000000406586>] fc_rport_final_delete+0xb2/0x23c
       [<000000000015d080>] worker_thread+0x200/0x344
       [<000000000016330c>] kthread+0xa0/0xa8
       [<0000000000106c1a>] kernel_thread_starter+0x6/0xc
       [<0000000000106c14>] kernel_thread_starter+0x0/0xc
      INFO: lockdep is turned off.
      Last Breaking-Event-Address:
       [<00000000003ff7cc>] scsi_remove_device+0x3c/0x54
      
      The function __scsi_remove_target iterates through the SCSI devices on
      the host, but it drops the host_lock before calling
      scsi_remove_device. When the SCSI device is deleted from another
      thread, the pointer to the SCSI device in scsi_remove_device can
      become invalid. Fix this by getting a reference to the SCSI device
      before dropping the host_lock to keep the SCSI device alive for the
      call to scsi_remove_device.
      Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d8482738
    • Dan Carpenter's avatar
      gdth: integer overflow in ioctl · f8923660
      Dan Carpenter authored
      commit f63ae56e upstream.
      
      gdth_ioctl_alloc() takes the size variable as an int.
      copy_from_user() takes the size variable as an unsigned long.
      gen.data_len and gen.sense_len are unsigned longs.
      On x86_64 longs are 64 bit and ints are 32 bit.
      
      We could pass in a very large number and the allocation would truncate
      the size to 32 bits and allocate a small buffer.  Then when we do the
      copy_from_user(), it would result in a memory corruption.
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f8923660
    • David Milburn's avatar
      libsas: fix NCQ mixing with non-NCQ · f8d4ab3d
      David Milburn authored
      commit f0ad30d3 upstream.
      
      Some cards (like mvsas) have issue troubles if non-NCQ commands are
      mixed with NCQ ones.  Fix this by using the libata default NCQ check
      routine which waits until all NCQ commands are complete before issuing
      a non-NCQ one.  The impact to cards (like aic94xx) which don't need
      this logic should be minimal
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      f8d4ab3d
    • Michael Reed's avatar
      sd name space exhaustion causes system hang · 9f26affd
      Michael Reed authored
      commit 1a03ae0f upstream.
      
      Following a site power outage which re-enabled all the ports on my FC
      switches, my system subsequently booted with far too many luns!  I had
      let it run hoping it would make multi-user.  It didn't.  :(  It hung solid
      after exhausting the last sd device, sdzzz, and attempting to create sdaaaa
      and beyond.  I was unable to get a dump.
      
      Discovered using a 2.6.32.13 based system.
      
      correct this by detecting when the last index is utilized and failing
      the sd probe of the device.  Patch applies to scsi-misc-2.6.
      Signed-off-by: default avatarMichael Reed <mdr@sgi.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9f26affd
    • Alan Stern's avatar
      USB: accept some invalid ep0-maxpacket values · 7d7e0fa3
      Alan Stern authored
      commit 56626a72 upstream.
      
      A few devices (such as the RCA VR5220 voice recorder) are so
      non-compliant with the USB spec that they have invalid maxpacket sizes
      for endpoint 0.  Nevertheless, as long as we can safely use them, we
      may as well do so.
      
      This patch (as1432) softens our acceptance criterion by allowing
      high-speed devices to have ep0-maxpacket sizes other than 64.  A
      warning is printed in the system log when this happens, and the
      existing error message is clarified.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Reported-by: default avatarJames <bjlockie@lockie.ca>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7d7e0fa3