Laura Abbott
5988818008
vsock: Fix blocking ops call in prepare_to_wait
We receoved a bug report from someone using vmware:
WARNING: CPU: 3 PID: 660 at kernel/sched/core.c:7389
__might_sleep+0x7d/0x90()
do not call blocking ops when !TASK_RUNNING; state=1 set at
[<ffffffff810fa68d>] prepare_to_wait+0x2d/0x90
Modules linked in: vmw_vsock_vmci_transport vsock snd_seq_midi
snd_seq_midi_event snd_ens1371 iosf_mbi gameport snd_rawmidi
snd_ac97_codec ac97_bus snd_seq coretemp snd_seq_device snd_pcm
snd_timer snd soundcore ppdev crct10dif_pclmul crc32_pclmul
ghash_clmulni_intel vmw_vmci vmw_balloon i2c_piix4 shpchp parport_pc
parport acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc btrfs
xor raid6_pq 8021q garp stp llc mrp crc32c_intel serio_raw mptspi vmwgfx
drm_kms_helper ttm drm scsi_transport_spi mptscsih e1000 ata_generic
mptbase pata_acpi
CPU: 3 PID: 660 Comm: vmtoolsd Not tainted
4.2.0-0.rc1.git3.1.fc23.x86_64 #1
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop
Reference Platform, BIOS 6.00 05/20/2014
0000000000000000 0000000049e617f3 ffff88006ac37ac8 ffffffff818641f5
0000000000000000 ffff88006ac37b20 ffff88006ac37b08 ffffffff810ab446
ffff880068009f40 ffffffff81c63bc0 0000000000000061 0000000000000000
Call Trace:
[<ffffffff818641f5>] dump_stack+0x4c/0x65
[<ffffffff810ab446>] warn_slowpath_common+0x86/0xc0
[<ffffffff810ab4d5>] warn_slowpath_fmt+0x55/0x70
[<ffffffff8112551d>] ? debug_lockdep_rcu_enabled+0x1d/0x20
[<ffffffff810fa68d>] ? prepare_to_wait+0x2d/0x90
[<ffffffff810fa68d>] ? prepare_to_wait+0x2d/0x90
[<ffffffff810da2bd>] __might_sleep+0x7d/0x90
[<ffffffff812163b3>] __might_fault+0x43/0xa0
[<ffffffff81430477>] copy_from_iter+0x87/0x2a0
[<ffffffffa039460a>] __qp_memcpy_to_queue+0x9a/0x1b0 [vmw_vmci]
[<ffffffffa0394740>] ? qp_memcpy_to_queue+0x20/0x20 [vmw_vmci]
[<ffffffffa0394757>] qp_memcpy_to_queue_iov+0x17/0x20 [vmw_vmci]
[<ffffffffa0394d50>] qp_enqueue_locked+0xa0/0x140 [vmw_vmci]
[<ffffffffa039593f>] vmci_qpair_enquev+0x4f/0xd0 [vmw_vmci]
[<ffffffffa04847bb>] vmci_transport_stream_enqueue+0x1b/0x20
[vmw_vsock_vmci_transport]
[<ffffffffa047ae05>] vsock_stream_sendmsg+0x2c5/0x320 [vsock]
[<ffffffff810fabd0>] ? wake_atomic_t_function+0x70/0x70
[<ffffffff81702af8>] sock_sendmsg+0x38/0x50
[<ffffffff81702ff4>] SYSC_sendto+0x104/0x190
[<ffffffff8126e25a>] ? vfs_read+0x8a/0x140
[<ffffffff817042ee>] SyS_sendto+0xe/0x10
[<ffffffff8186d9ae>] entry_SYSCALL_64_fastpath+0x12/0x76
transport->stream_enqueue may call copy_to_user so it should
not be called inside a prepare_to_wait. Narrow the scope of
the prepare_to_wait to avoid the bad call. This also applies
to vsock_stream_recvmsg as well.
Reported-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Laura Abbott <labbott@fedoraproject.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-13 05:57:39 -05:00
..
2015-12-20 08:21:00 +01:00
2016-01-24 12:39:09 -08:00
2015-12-15 16:50:08 -05:00
2015-11-30 14:47:33 -05:00
2015-12-14 16:09:30 -05:00
2016-01-16 22:50:00 +08:00
2016-01-29 11:47:24 +01:00
2016-01-28 16:21:31 -08:00
2015-12-01 15:45:05 -05:00
2015-10-13 17:42:34 +02:00
2016-02-04 18:26:08 +01:00
2016-02-09 07:07:48 -05:00
2015-10-09 07:52:27 -07:00
2015-12-03 21:09:12 -05:00
2015-12-14 16:09:30 -05:00
2015-11-18 16:27:46 -05:00
2016-01-07 14:31:26 -05:00
2016-01-06 16:31:56 -05:00
2015-11-23 14:56:15 -05:00
2016-01-05 22:25:57 -05:00
2016-02-13 05:57:39 -05:00
2016-02-09 04:15:37 -05:00
2016-01-29 22:56:46 -08:00
2016-01-19 14:21:08 -05:00
2015-10-23 03:05:19 -07:00
2016-01-04 16:45:24 -05:00
2015-10-07 04:27:43 -07:00
2015-07-27 01:06:53 -07:00
2016-02-01 15:56:08 -08:00
2016-01-04 20:40:41 +01:00
2015-12-17 22:08:28 -05:00
2016-01-20 14:15:31 +01:00
2016-01-29 20:25:17 -08:00
2015-06-18 21:14:32 +02:00
2016-01-04 21:48:15 -05:00
2016-02-10 05:50:03 -05:00
2015-11-29 22:17:17 -05:00
2016-01-12 12:05:38 -05:00
2016-01-23 18:45:06 -08:00
2016-01-26 11:32:05 +01:00
2015-06-24 02:58:51 -07:00
2016-01-12 18:57:02 -08:00
2016-01-29 17:26:44 -08:00
2016-02-09 04:53:16 -05:00
2016-01-23 18:45:06 -08:00
2016-01-28 16:21:31 -08:00
2016-01-29 15:14:21 -05:00
2016-02-08 10:30:42 -05:00
2016-02-13 05:57:39 -05:00
2015-08-09 22:43:52 -07:00
2016-01-14 11:10:13 +01:00
2016-01-15 14:35:24 -05:00
2016-01-10 22:13:15 -05:00
2015-09-29 20:40:32 -07:00
2016-01-14 16:00:49 -08:00
2015-10-23 06:22:08 -07:00