1. 09 11月, 2016 20 次提交
  2. 27 10月, 2016 2 次提交
  3. 25 10月, 2016 1 次提交
  4. 19 10月, 2016 1 次提交
  5. 18 10月, 2016 3 次提交
    • A
      scsi: NCR5380: no longer mark irq probing as __init · 77f18a87
      Arnd Bergmann 提交于
      The g_NCR5380 has been converted to more regular probing, which
      means its probe function can now be invoked after the __init section
      is discarded, as pointed out by this kbuild warning:
      
      WARNING: drivers/scsi/built-in.o(.text+0x3a105): Section mismatch in reference from the function generic_NCR5380_isa_match() to the function .init.text:probe_intr()
      WARNING: drivers/scsi/built-in.o(.text+0x3a145): Section mismatch in reference from the function generic_NCR5380_isa_match() to the variable .init.data:probe_irq
      
      To make sure this works correctly in all cases, let's remove
      the __init and __initdata annotations.
      
      Fixes: a8cfbcae ("scsi: g_NCR5380: Stop using scsi_module.c")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NFinn Thain <fthain@telegraphics.com.au>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      77f18a87
    • J
      scsi: be2iscsi: Replace _bh with _irqsave/irqrestore · 7d2c0d64
      Jitendra Bhivare 提交于
      [ 3843.132217] WARNING: CPU: 20 PID: 1227 at kernel/softirq.c:150 __local_bh_enable_ip+0x6b/0x90
      [ 3843.142815] Modules linked in:
      ...
      [ 3843.294328] CPU: 20 PID: 1227 Comm: kworker/20:1H Tainted: G            E   4.8.0-rc1+ #3
      [ 3843.304944] Hardware name: Dell Inc. PowerEdge R720/0X6H47, BIOS 1.4.8 10/25/2012
      [ 3843.314798] Workqueue: kblockd blk_timeout_work
      [ 3843.321350]  0000000000000086 00000000a32f4533 ffff8802216d7bd8 ffffffff8135c3cf
      [ 3843.331146]  0000000000000000 0000000000000000 ffff8802216d7c18 ffffffff8108d661
      [ 3843.340918]  00000096216d7c50 0000000000000200 ffff8802d07cc828 ffff8801b3632550
      [ 3843.350687] Call Trace:
      [ 3843.354866]  [<ffffffff8135c3cf>] dump_stack+0x63/0x84
      [ 3843.362061]  [<ffffffff8108d661>] __warn+0xd1/0xf0
      [ 3843.368851]  [<ffffffff8108d79d>] warn_slowpath_null+0x1d/0x20
      [ 3843.376791]  [<ffffffff810930eb>] __local_bh_enable_ip+0x6b/0x90
      [ 3843.384903]  [<ffffffff816fe7be>] _raw_spin_unlock_bh+0x1e/0x20
      [ 3843.392940]  [<ffffffffa085f710>] beiscsi_alloc_pdu+0x2f0/0x6e0 [be2iscsi]
      [ 3843.402076]  [<ffffffffa06bc358>] __iscsi_conn_send_pdu+0xf8/0x370 [libiscsi]
      [ 3843.411549]  [<ffffffffa06bc6fe>] iscsi_send_nopout+0xbe/0x110 [libiscsi]
      [ 3843.420639]  [<ffffffffa06bd98b>] iscsi_eh_cmd_timed_out+0x29b/0x2b0 [libiscsi]
      [ 3843.430339]  [<ffffffff814cd1de>] scsi_times_out+0x5e/0x250
      [ 3843.438119]  [<ffffffff813374af>] blk_rq_timed_out+0x1f/0x60
      [ 3843.446009]  [<ffffffff8133759d>] blk_timeout_work+0xad/0x150
      [ 3843.454010]  [<ffffffff810a6642>] process_one_work+0x152/0x400
      [ 3843.462114]  [<ffffffff810a6f35>] worker_thread+0x125/0x4b0
      [ 3843.469961]  [<ffffffff810a6e10>] ? rescuer_thread+0x380/0x380
      [ 3843.478116]  [<ffffffff810aca28>] kthread+0xd8/0xf0
      [ 3843.485212]  [<ffffffff816fedff>] ret_from_fork+0x1f/0x40
      [ 3843.492908]  [<ffffffff810ac950>] ? kthread_park+0x60/0x60
      [ 3843.500715] ---[ end trace 57ec0a1d8f0dd3a0 ]---
      [ 3852.328667] NMI watchdog: Watchdog detected hard LOCKUP on cpu 1Kernel panic - not syncing: Hard LOCKUP
      
      blk_timeout_work takes queue_lock spin_lock with interrupts disabled
      before invoking iscsi_eh_cmd_timed_out. This causes a WARN_ON_ONCE in
      spin_unlock_bh for wrb_lock/io_sgl_lock/mgmt_sgl_lock.
      
      CPU was kept busy in lot of bottom half work with interrupts disabled
      thus causing hard lock up.
      Signed-off-by: NJitendra Bhivare <jitendra.bhivare@broadcom.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Reviewed-by: NChris Leech <cleech@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      7d2c0d64
    • J
      scsi: libiscsi: Fix locking in __iscsi_conn_send_pdu · 4fa50799
      Jitendra Bhivare 提交于
      The code at free_task label in __iscsi_conn_send_pdu can get executed
      from blk_timeout_work which takes queue_lock using spin_lock_irq.
      back_lock taken with spin_unlock_bh will cause WARN_ON_ONCE.  The code
      gets executed either with bottom half or IRQ disabled hence using
      spin_lock/spin_unlock for back_lock is safe.
      Signed-off-by: NJitendra Bhivare <jitendra.bhivare@broadcom.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Reviewed-by: NChris Leech <cleech@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      4fa50799
  6. 15 10月, 2016 1 次提交
    • B
      scsi: ipr: Fix async error WARN_ON · 8a4236a2
      Brian King 提交于
      Commit afc3f83c ("scsi: ipr: Add asynchronous error notification")
      introduced the warn on shown below. To fix this, rather than attempting
      to send the KOBJ_CHANGE uevent from interrupt context, which is what is
      causing the WARN_ON, just wake the ipr worker thread which will send a
      KOBJ_CHANGE uevent.
      
      [  142.278120] WARNING: CPU: 15 PID: 0 at kernel/softirq.c:161 __local_bh_enable_ip+0x7c/0xd0
      [  142.278124] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw iptable_filter ses enclosure scsi_transport_sas sg pseries_rng nfsd auth_rpcgss nfs_acl lockd grace sunrpc ip_tables xfs libcrc32c sr_mod sd_mod cdrom ipr libata ibmvscsi scsi_transport_srp ibmveth dm_mirror dm_region_hash dm_log dm_mod
      [  142.278208] CPU: 15 PID: 0 Comm: swapper/15 Not tainted 4.8.0.ipr+ #21
      [  142.278213] task: c00000010cf24480 task.stack: c00000010cfec000
      [  142.278217] NIP: c0000000000c0c7c LR: c000000000881778 CTR: c0000000003c5bf0
      [  142.278221] REGS: c00000010cfef080 TRAP: 0700   Not tainted  (4.8.0.ipr+)
      [  142.278224] MSR: 8000000000029033 <SF,EE,ME,IR,DR,RI,LE>  CR: 28008022  XER: 2000000f
      [  142.278236] CFAR: c0000000000c0c20 SOFTE: 0
      GPR00: c000000000706c78 c00000010cfef300 c000000000f91d00 c000000000706c78
      GPR04: 0000000000000200 c000000000f7bc80 0000000000000000 00000000024000c0
      GPR08: 0000000000000000 0000000000000001 c000000000ee1d00 c000000000a9bdd0
      GPR12: c0000000003c5bf0 c00000000eb22d00 c000000100ca3880 c00000020ed38400
      GPR16: 0000000000000000 0000000000000000 c000000100940508 0000000000000000
      GPR20: 0000000000000000 0000000000000000 0000000000000000 00000000024000c0
      GPR24: c0000000004588e0 c00000010863bd00 c00000010863bd00 c0000000013773f8
      GPR28: c000000000f7bc80 0000000000000000 ffffffffffffffff c000000000f7bcd8
      [  142.278290] NIP [c0000000000c0c7c] __local_bh_enable_ip+0x7c/0xd0
      [  142.278296] LR [c000000000881778] _raw_spin_unlock_bh+0x38/0x60
      [  142.278299] Call Trace:
      [  142.278303] [c00000010cfef300] [c000000000f7bc80] init_net+0x0/0x1900 (unreliable)
      [  142.278310] [c00000010cfef320] [c000000000706c78] peernet2id+0x58/0x80
      [  142.278316] [c00000010cfef370] [c00000000075caec] netlink_broadcast_filtered+0x30c/0x550
      [  142.278323] [c00000010cfef430] [c000000000459078] kobject_uevent_env+0x588/0x780
      [  142.278331] [c00000010cfef510] [d000000003163a6c] ipr_process_error+0x11c/0x240 [ipr]
      [  142.278337] [c00000010cfef5c0] [d000000003152298] ipr_fail_all_ops+0x108/0x220 [ipr]
      [  142.278343] [c00000010cfef670] [d0000000031643f8] ipr_reset_restore_cfg_space+0xa8/0x240 [ipr]
      [  142.278350] [c00000010cfef6f0] [d000000003158a00] ipr_reset_ioa_job+0x80/0xe0 [ipr]
      [  142.278356] [c00000010cfef720] [d000000003153f78] ipr_reset_timer_done+0xa8/0xe0 [ipr]
      [  142.278363] [c00000010cfef770] [c000000000149c88] call_timer_fn+0x58/0x1c0
      [  142.278368] [c00000010cfef800] [c000000000149f60] expire_timers+0x140/0x200
      [  142.278373] [c00000010cfef870] [c00000000014a0e8] run_timer_softirq+0xc8/0x230
      [  142.278379] [c00000010cfef900] [c0000000000c0844] __do_softirq+0x164/0x3c0
      [  142.278384] [c00000010cfef9f0] [c0000000000c0f18] irq_exit+0x1a8/0x1c0
      [  142.278389] [c00000010cfefa20] [c000000000020b54] timer_interrupt+0xa4/0xe0
      [  142.278394] [c00000010cfefa50] [c000000000002414] decrementer_common+0x114/0x180
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      8a4236a2
  7. 12 10月, 2016 3 次提交
    • M
      scsi: Remove one useless stack variable · 03eb6b8d
      Ming Lei 提交于
      The local variable of 'devname' in scsi_report_lun_scan() isn't used any
      more, so remove it.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      03eb6b8d
    • M
      scsi: Fix use-after-free · bcd8f2e9
      Ming Lei 提交于
      This patch fixes one use-after-free report[1] by KASAN.
      
      In __scsi_scan_target(), when a type 31 device is probed,
      SCSI_SCAN_TARGET_PRESENT is returned and the target will be scanned
      again.
      
      Inside the following scsi_report_lun_scan(), one new scsi_device
      instance is allocated, and scsi_probe_and_add_lun() is called again to
      probe the target and still see type 31 device, finally
      __scsi_remove_device() is called to remove & free the device at the end
      of scsi_probe_and_add_lun(), so cause use-after-free in
      scsi_report_lun_scan().
      
      And the following SCSI log can be observed:
      
      	scsi 0:0:2:0: scsi scan: INQUIRY pass 1 length 36
      	scsi 0:0:2:0: scsi scan: INQUIRY successful with code 0x0
      	scsi 0:0:2:0: scsi scan: peripheral device type of 31, no device added
      	scsi 0:0:2:0: scsi scan: Sending REPORT LUNS to (try 0)
      	scsi 0:0:2:0: scsi scan: REPORT LUNS successful (try 0) result 0x0
      	scsi 0:0:2:0: scsi scan: REPORT LUN scan
      	scsi 0:0:2:0: scsi scan: INQUIRY pass 1 length 36
      	scsi 0:0:2:0: scsi scan: INQUIRY successful with code 0x0
      	scsi 0:0:2:0: scsi scan: peripheral device type of 31, no device added
      	BUG: KASAN: use-after-free in __scsi_scan_target+0xbf8/0xe40 at addr ffff88007b44a104
      
      This patch fixes the issue by moving the putting reference at
      the end of scsi_report_lun_scan().
      
      [1] KASAN report
      ==================================================================
      [    3.274597] PM: Adding info for serio:serio1
      [    3.275127] BUG: KASAN: use-after-free in __scsi_scan_target+0xd87/0xdf0 at addr ffff880254d8c304
      [    3.275653] Read of size 4 by task kworker/u10:0/27
      [    3.275903] CPU: 3 PID: 27 Comm: kworker/u10:0 Not tainted 4.8.0 #2121
      [    3.276258] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
      [    3.276797] Workqueue: events_unbound async_run_entry_fn
      [    3.277083]  ffff880254d8c380 ffff880259a37870 ffffffff94bbc6c1 ffff880078402d80
      [    3.277532]  ffff880254d8bb80 ffff880259a37898 ffffffff9459fec1 ffff880259a37930
      [    3.277989]  ffff880254d8bb80 ffff880078402d80 ffff880259a37920 ffffffff945a0165
      [    3.278436] Call Trace:
      [    3.278528]  [<ffffffff94bbc6c1>] dump_stack+0x65/0x84
      [    3.278797]  [<ffffffff9459fec1>] kasan_object_err+0x21/0x70
      [    3.279063] device: 'psaux': device_add
      [    3.279616]  [<ffffffff945a0165>] kasan_report_error+0x205/0x500
      [    3.279651] PM: Adding info for No Bus:psaux
      [    3.280202]  [<ffffffff944ecd22>] ? kfree_const+0x22/0x30
      [    3.280486]  [<ffffffff94bc2dc9>] ? kobject_release+0x119/0x370
      [    3.280805]  [<ffffffff945a0543>] __asan_report_load4_noabort+0x43/0x50
      [    3.281170]  [<ffffffff9507e1f7>] ? __scsi_scan_target+0xd87/0xdf0
      [    3.281506]  [<ffffffff9507e1f7>] __scsi_scan_target+0xd87/0xdf0
      [    3.281848]  [<ffffffff9507d470>] ? scsi_add_device+0x30/0x30
      [    3.282156]  [<ffffffff94f7f660>] ? pm_runtime_autosuspend_expiration+0x60/0x60
      [    3.282570]  [<ffffffff956ddb07>] ? _raw_spin_lock+0x17/0x40
      [    3.282880]  [<ffffffff9507e505>] scsi_scan_channel+0x105/0x160
      [    3.283200]  [<ffffffff9507e8a2>] scsi_scan_host_selected+0x212/0x2f0
      [    3.283563]  [<ffffffff9507eb3c>] do_scsi_scan_host+0x1bc/0x250
      [    3.283882]  [<ffffffff9507efc1>] do_scan_async+0x41/0x450
      [    3.284173]  [<ffffffff941c1fee>] async_run_entry_fn+0xfe/0x610
      [    3.284492]  [<ffffffff941a8954>] ? pwq_dec_nr_in_flight+0x124/0x2a0
      [    3.284876]  [<ffffffff941d1770>] ? preempt_count_add+0x130/0x160
      [    3.285207]  [<ffffffff941a9a84>] process_one_work+0x544/0x12d0
      [    3.285526]  [<ffffffff941aa8e9>] worker_thread+0xd9/0x12f0
      [    3.285844]  [<ffffffff941aa810>] ? process_one_work+0x12d0/0x12d0
      [    3.286182]  [<ffffffff941bb365>] kthread+0x1c5/0x260
      [    3.286443]  [<ffffffff940855cd>] ? __switch_to+0x88d/0x1430
      [    3.286745]  [<ffffffff941bb1a0>] ? kthread_worker_fn+0x5a0/0x5a0
      [    3.287085]  [<ffffffff956dde9f>] ret_from_fork+0x1f/0x40
      [    3.287368]  [<ffffffff941bb1a0>] ? kthread_worker_fn+0x5a0/0x5a0
      [    3.287697] Object at ffff880254d8bb80, in cache kmalloc-2048 size: 2048
      [    3.288064] Allocated:
      [    3.288147] PID = 27
      [    3.288218]  [<ffffffff940b27ab>] save_stack_trace+0x2b/0x50
      [    3.288531]  [<ffffffff9459f246>] save_stack+0x46/0xd0
      [    3.288806]  [<ffffffff9459f4bd>] kasan_kmalloc+0xad/0xe0
      [    3.289098]  [<ffffffff9459c07e>] __kmalloc+0x13e/0x250
      [    3.289378]  [<ffffffff95078e5a>] scsi_alloc_sdev+0xea/0xcf0
      [    3.289701]  [<ffffffff9507de76>] __scsi_scan_target+0xa06/0xdf0
      [    3.290034]  [<ffffffff9507e505>] scsi_scan_channel+0x105/0x160
      [    3.290362]  [<ffffffff9507e8a2>] scsi_scan_host_selected+0x212/0x2f0
      [    3.290724]  [<ffffffff9507eb3c>] do_scsi_scan_host+0x1bc/0x250
      [    3.291055]  [<ffffffff9507efc1>] do_scan_async+0x41/0x450
      [    3.291354]  [<ffffffff941c1fee>] async_run_entry_fn+0xfe/0x610
      [    3.291695]  [<ffffffff941a9a84>] process_one_work+0x544/0x12d0
      [    3.292022]  [<ffffffff941aa8e9>] worker_thread+0xd9/0x12f0
      [    3.292325]  [<ffffffff941bb365>] kthread+0x1c5/0x260
      [    3.292594]  [<ffffffff956dde9f>] ret_from_fork+0x1f/0x40
      [    3.292886] Freed:
      [    3.292945] PID = 27
      [    3.293016]  [<ffffffff940b27ab>] save_stack_trace+0x2b/0x50
      [    3.293327]  [<ffffffff9459f246>] save_stack+0x46/0xd0
      [    3.293600]  [<ffffffff9459fa61>] kasan_slab_free+0x71/0xb0
      [    3.293916]  [<ffffffff9459bac2>] kfree+0xa2/0x1f0
      [    3.294168]  [<ffffffff9508158a>] scsi_device_dev_release_usercontext+0x50a/0x730
      [    3.294598]  [<ffffffff941ace9a>] execute_in_process_context+0xda/0x130
      [    3.294974]  [<ffffffff9508107c>] scsi_device_dev_release+0x1c/0x20
      [    3.295322]  [<ffffffff94f566f6>] device_release+0x76/0x1e0
      [    3.295626]  [<ffffffff94bc2db7>] kobject_release+0x107/0x370
      [    3.295942]  [<ffffffff94bc29ce>] kobject_put+0x4e/0xa0
      [    3.296222]  [<ffffffff94f56e17>] put_device+0x17/0x20
      [    3.296497]  [<ffffffff9505201c>] scsi_device_put+0x7c/0xa0
      [    3.296801]  [<ffffffff9507e1bc>] __scsi_scan_target+0xd4c/0xdf0
      [    3.297132]  [<ffffffff9507e505>] scsi_scan_channel+0x105/0x160
      [    3.297458]  [<ffffffff9507e8a2>] scsi_scan_host_selected+0x212/0x2f0
      [    3.297829]  [<ffffffff9507eb3c>] do_scsi_scan_host+0x1bc/0x250
      [    3.298156]  [<ffffffff9507efc1>] do_scan_async+0x41/0x450
      [    3.298453]  [<ffffffff941c1fee>] async_run_entry_fn+0xfe/0x610
      [    3.298777]  [<ffffffff941a9a84>] process_one_work+0x544/0x12d0
      [    3.299105]  [<ffffffff941aa8e9>] worker_thread+0xd9/0x12f0
      [    3.299408]  [<ffffffff941bb365>] kthread+0x1c5/0x260
      [    3.299676]  [<ffffffff956dde9f>] ret_from_fork+0x1f/0x40
      [    3.299967] Memory state around the buggy address:
      [    3.300209]  ffff880254d8c200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [    3.300608]  ffff880254d8c280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [    3.300986] >ffff880254d8c300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [    3.301408]                    ^
      [    3.301550]  ffff880254d8c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      [    3.301987]  ffff880254d8c400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [    3.302396]
      ==================================================================
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      bcd8f2e9
    • X
      scsi: Replace wrong device handler name for CLARiiON arrays · 0ba43a81
      Xose Vazquez Perez 提交于
      At drivers/scsi/device_handler/scsi_dh_emc.c it was defined as:
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
      Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: SCSI ML <linux-scsi@vger.kernel.org>
      Cc: device-mapper development <dm-devel@redhat.com>
      Signed-off-by: NXose Vazquez Perez <xose.vazquez@gmail.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      0ba43a81
  8. 30 9月, 2016 6 次提交
  9. 28 9月, 2016 3 次提交