android_kernel_samsung_msm8976/drivers
Mike Marciniszyn b6c92a436f IB/qib: fix mcast detach when qp not attached
commit 09dc9cd6528f5b52bcbd3292a6312e762c85260f upstream.

The code produces the following trace:

[1750924.419007] general protection fault: 0000 [#3] SMP
[1750924.420364] Modules linked in: nfnetlink autofs4 rpcsec_gss_krb5 nfsv4
dcdbas rfcomm bnep bluetooth nfsd auth_rpcgss nfs_acl dm_multipath nfs lockd
scsi_dh sunrpc fscache radeon ttm drm_kms_helper drm serio_raw parport_pc
ppdev i2c_algo_bit lpc_ich ipmi_si ib_mthca ib_qib dca lp parport ib_ipoib
mac_hid ib_cm i3000_edac ib_sa ib_uverbs edac_core ib_umad ib_mad ib_core
ib_addr tg3 ptp dm_mirror dm_region_hash dm_log psmouse pps_core
[1750924.420364] CPU: 1 PID: 8401 Comm: python Tainted: G D
3.13.0-39-generic #66-Ubuntu
[1750924.420364] Hardware name: Dell Computer Corporation PowerEdge
860/0XM089, BIOS A04 07/24/2007
[1750924.420364] task: ffff8800366a9800 ti: ffff88007af1c000 task.ti:
ffff88007af1c000
[1750924.420364] RIP: 0010:[<ffffffffa0131d51>] [<ffffffffa0131d51>]
qib_mcast_qp_free+0x11/0x50 [ib_qib]
[1750924.420364] RSP: 0018:ffff88007af1dd70  EFLAGS: 00010246
[1750924.420364] RAX: 0000000000000001 RBX: ffff88007b822688 RCX:
000000000000000f
[1750924.420364] RDX: ffff88007b822688 RSI: ffff8800366c15a0 RDI:
6764697200000000
[1750924.420364] RBP: ffff88007af1dd78 R08: 0000000000000001 R09:
0000000000000000
[1750924.420364] R10: 0000000000000011 R11: 0000000000000246 R12:
ffff88007baa1d98
[1750924.420364] R13: ffff88003ecab000 R14: ffff88007b822660 R15:
0000000000000000
[1750924.420364] FS:  00007ffff7fd8740(0000) GS:ffff88007fc80000(0000)
knlGS:0000000000000000
[1750924.420364] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[1750924.420364] CR2: 00007ffff597c750 CR3: 000000006860b000 CR4:
00000000000007e0
[1750924.420364] Stack:
[1750924.420364]  ffff88007b822688 ffff88007af1ddf0 ffffffffa0132429
000000007af1de20
[1750924.420364]  ffff88007baa1dc8 ffff88007baa0000 ffff88007af1de70
ffffffffa00cb313
[1750924.420364]  00007fffffffde88 0000000000000000 0000000000000008
ffff88003ecab000
[1750924.420364] Call Trace:
[1750924.420364]  [<ffffffffa0132429>] qib_multicast_detach+0x1e9/0x350
[ib_qib]
[1750924.568035]  [<ffffffffa00cb313>] ? ib_uverbs_modify_qp+0x323/0x3d0
[ib_uverbs]
[1750924.568035]  [<ffffffffa0092d61>] ib_detach_mcast+0x31/0x50 [ib_core]
[1750924.568035]  [<ffffffffa00cc213>] ib_uverbs_detach_mcast+0x93/0x170
[ib_uverbs]
[1750924.568035]  [<ffffffffa00c61f6>] ib_uverbs_write+0xc6/0x2c0 [ib_uverbs]
[1750924.568035]  [<ffffffff81312e68>] ? apparmor_file_permission+0x18/0x20
[1750924.568035]  [<ffffffff812d4cd3>] ? security_file_permission+0x23/0xa0
[1750924.568035]  [<ffffffff811bd214>] vfs_write+0xb4/0x1f0
[1750924.568035]  [<ffffffff811bdc49>] SyS_write+0x49/0xa0
[1750924.568035]  [<ffffffff8172f7ed>] system_call_fastpath+0x1a/0x1f
[1750924.568035] Code: 66 2e 0f 1f 84 00 00 00 00 00 31 c0 5d c3 66 2e 0f 1f
84 00 00 00 00 00 66 90 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 8b 7f 10
<f0> ff 8f 40 01 00 00 74 0e 48 89 df e8 8e f8 06 e1 5b 5d c3 0f
[1750924.568035] RIP  [<ffffffffa0131d51>] qib_mcast_qp_free+0x11/0x50
[ib_qib]
[1750924.568035]  RSP <ffff88007af1dd70>
[1750924.650439] ---[ end trace 73d5d4b3f8ad4851 ]

The fix is to note the qib_mcast_qp that was found.   If none is found, then
return EINVAL indicating the error.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Reported-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03 15:06:24 -08:00
..
accessibility
acpi ACPICA: Tables: Fix an issue that FACS initialization is performed twice 2015-08-03 09:29:46 -07:00
amba
ata sata_sil: disable trim 2016-03-03 15:06:22 -08:00
atm
auxdisplay auxdisplay: ks0108: fix refcount 2015-09-21 10:00:09 -07:00
base regmap: debugfs: Don't bother actually printing when calculating max length 2015-10-22 14:37:51 -07:00
bcma
block xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing) 2015-11-09 10:12:58 -08:00
bluetooth Bluetooth: btusb: Fix memory leak in Intel setup routine 2015-08-03 09:29:42 -07:00
bus bus: mvebu: pass the coherency availability information at init time 2015-07-03 19:48:09 -07:00
cdrom
char vTPM: fix memory allocation flag for rtce buffer at kernel boot 2016-02-19 14:22:38 -08:00
clk clk: versatile: off by one in clk_sp810_timerclken_of_get() 2015-09-21 10:00:07 -07:00
clocksource clocksource/drivers/vt8500: Increase the minimum delta 2016-03-03 15:06:20 -08:00
connector connector: bump skb->users before callback invocation 2016-01-28 21:49:33 -08:00
cpufreq cpufreq: speedstep-smi: enable interrupts when waiting 2015-03-06 14:40:48 -08:00
cpuidle cpuidle / menu: Return (-1) if there are no suitable states 2015-08-03 09:29:41 -07:00
crypto crypto: caam - fix memory corruption in ahash_final_ctx 2015-09-13 09:07:59 -07:00
dca
devfreq
dio
dma dmaengine: mv_xor: bug fix for racing condition in descriptors cleanup 2015-08-03 09:29:46 -07:00
edac EDAC, ppc4xx: Access mci->csrows array elements properly 2015-09-13 09:07:59 -07:00
eisa
extcon
firewire firewire: ohci: fix JMicron JMB38x IT context discovery 2016-01-22 19:47:53 -08:00
firmware efi-pstore: Make efi-pstore return a unique id 2015-02-05 22:35:40 -08:00
gpio gpio: sysfs: fix memory leaks and device hotplug 2015-05-17 09:51:32 -07:00
gpu drm/radeon: use post-decrement in error handling 2016-03-03 15:06:24 -08:00
hid HID: usbhid: fix recursive deadlock 2016-02-19 14:22:37 -08:00
hsi
hv Drivers: hv: vmbus: Don't wait after requesting offers 2015-05-13 05:15:43 -07:00
hwmon hwmon: (mcp3021) Fix broken output scaling 2015-08-03 09:29:46 -07:00
hwspinlock
i2c i2c: rcar: enable RuntimePM before registering to the core 2015-10-27 09:44:50 +09:00
ide
idle
iio iio: dac: mcp4725: set iio name property in sysfs 2016-02-25 11:57:48 -08:00
infiniband IB/qib: fix mcast detach when qp not attached 2016-03-03 15:06:24 -08:00
input Input: i8042 - add Fujitsu Lifebook U745 to the nomux list 2016-02-25 11:57:49 -08:00
iommu iommu/vt-d: Fix 64-bit accesses to 32-bit DMAR_GSTS_REG 2016-02-25 11:57:49 -08:00
ipack
irqchip
isdn ppp, slip: Validate VJ compression slot parameters completely 2016-01-28 21:49:35 -08:00
leds
lguest lguest: fix out-by-one error in address checking. 2015-06-05 23:19:54 -07:00
macintosh windfarm: decrement client count when unregistering 2015-10-22 14:37:49 -07:00
mailbox
md dm snapshot: fix hung bios when copy error occurs 2016-03-03 15:06:23 -08:00
media tda1004x: only update the frontend properties if locked 2016-03-03 15:06:23 -08:00
memory
memstick memstick: mspro_block: add missing curly braces 2015-05-06 21:56:28 +02:00
message
mfd mfd: sm501: dbg_regs attribute must be read-only 2015-08-16 20:51:37 -07:00
misc
mmc mmc: mmci: fix an ages old detection error 2016-03-03 15:06:23 -08:00
mtd mtd: mtdpart: fix add_mtd_partitions error path 2016-02-19 14:22:38 -08:00
net can: sja1000: clear interrupts on start 2016-03-03 15:06:21 -08:00
nfc
ntb
nubus
of of/address: Don't loop forever in of_find_matching_node_by_address(). 2015-09-21 10:00:09 -07:00
oprofile
parisc parisc iommu: fix panic due to trying to allocate too large region 2016-01-28 21:49:36 -08:00
parport drivers: parport: Kconfig: exclude arm64 for PARPORT_PC 2015-05-06 21:56:26 +02:00
pci PCI: Fix TI816X class code quirk 2015-09-21 10:00:07 -07:00
pcmcia Disable write buffering on Toshiba ToPIC95 2015-08-03 09:29:41 -07:00
pinctrl pinctrl: mvebu: armada-xp: fix functions of MPP48 2015-08-03 09:29:42 -07:00
platform intel_scu_ipcutil: underflow in scu_reg_access() 2016-02-25 11:57:49 -08:00
pnp
power wm831x_power: Use IRQF_ONESHOT to request threaded IRQs 2016-03-03 15:06:20 -08:00
pps
ps3
ptp
pwm
rapidio
regulator regulator: core: fix constraints output buffer 2015-08-03 09:29:41 -07:00
remoteproc remoteproc: avoid stack overflow in debugfs file 2016-02-19 14:22:37 -08:00
reset
rpmsg
rtc
s390 s390/dasd: fix refcount for PAV reassignment 2016-03-03 15:06:23 -08:00
sbus
scsi ses: fix additional element traversal bug 2016-03-03 15:06:22 -08:00
sfi
sh
sn
spi spi: fix parent-device reference leak 2016-02-19 14:22:38 -08:00
ssb
ssbi
staging iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock 2016-02-25 11:57:48 -08:00
target iscsi-target: Fix potential dead-lock during node acl delete 2016-02-25 11:57:47 -08:00
tc
thermal
tty pty: make sure super_block is still valid in final /dev/tty close 2016-02-25 11:57:46 -08:00
uio
usb USB: option: add "4G LTE usb-modem U901" 2016-03-03 15:06:19 -08:00
uwb
vfio vfio-pci: Fix the check on pci device type in vfio_pci_probe() 2015-01-27 07:52:32 -08:00
vhost vhost/scsi: potential memory corruption 2015-10-01 12:07:34 +02:00
video video: vgacon: Don't build on arm64 2015-05-06 21:56:25 +02:00
virt
virtio virtio: fix memory leak of virtio ida cache layers 2016-03-03 15:06:21 -08:00
vlynq
vme
w1
watchdog watchdog: omap: assert the counter being stopped before reprogramming 2015-08-03 09:29:47 -07:00
xen xen/gntdev: Grant maps should not be subject to NUMA balancing 2016-01-28 21:49:28 -08:00
zorro
Kconfig
Makefile