https://github.com/torvalds/linux
Revision 3366cdb6d350d95466ee430ac50f3c8415ca8f46 authored by Olaf Hering on 07 September 2018, 14:31:35 UTC, committed by Boris Ostrovsky on 14 September 2018, 12:51:10 UTC
The command 'xl vcpu-set 0 0', issued in dom0, will crash dom0: BUG: unable to handle kernel NULL pointer dereference at 00000000000002d8 PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 7 PID: 65 Comm: xenwatch Not tainted 4.19.0-rc2-1.ga9462db-default #1 openSUSE Tumbleweed (unreleased) Hardware name: Intel Corporation S5520UR/S5520UR, BIOS S5500.86B.01.00.0050.050620101605 05/06/2010 RIP: e030:device_offline+0x9/0xb0 Code: 77 24 00 e9 ce fe ff ff 48 8b 13 e9 68 ff ff ff 48 8b 13 e9 29 ff ff ff 48 8b 13 e9 ea fe ff ff 90 66 66 66 66 90 41 54 55 53 <f6> 87 d8 02 00 00 01 0f 85 88 00 00 00 48 c7 c2 20 09 60 81 31 f6 RSP: e02b:ffffc90040f27e80 EFLAGS: 00010203 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff8801f3800000 RSI: ffffc90040f27e70 RDI: 0000000000000000 RBP: 0000000000000000 R08: ffffffff820e47b3 R09: 0000000000000000 R10: 0000000000007ff0 R11: 0000000000000000 R12: ffffffff822e6d30 R13: dead000000000200 R14: dead000000000100 R15: ffffffff8158b4e0 FS: 00007ffa595158c0(0000) GS:ffff8801f39c0000(0000) knlGS:0000000000000000 CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000002d8 CR3: 00000001d9602000 CR4: 0000000000002660 Call Trace: handle_vcpu_hotplug_event+0xb5/0xc0 xenwatch_thread+0x80/0x140 ? wait_woken+0x80/0x80 kthread+0x112/0x130 ? kthread_create_worker_on_cpu+0x40/0x40 ret_from_fork+0x3a/0x50 This happens because handle_vcpu_hotplug_event is called twice. In the first iteration cpu_present is still true, in the second iteration cpu_present is false which causes get_cpu_device to return NULL. In case of cpu#0, cpu_online is apparently always true. Fix this crash by checking if the cpu can be hotplugged, which is false for a cpu that was just removed. Also check if the cpu was actually offlined by device_remove, otherwise leave the cpu_present state as it is. Rearrange to code to do all work with device_hotplug_lock held. Signed-off-by: Olaf Hering <olaf@aepfle.de> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
1 parent 197ecb3
Tip revision: 3366cdb6d350d95466ee430ac50f3c8415ca8f46 authored by Olaf Hering on 07 September 2018, 14:31:35 UTC
xen: avoid crash in disable_hotplug_cpu
xen: avoid crash in disable_hotplug_cpu
Tip revision: 3366cdb
File | Mode | Size |
---|---|---|
partitions | ||
Kconfig | -rw-r--r-- | 6.7 KB |
Kconfig.iosched | -rw-r--r-- | 2.7 KB |
Makefile | -rw-r--r-- | 1.6 KB |
badblocks.c | -rw-r--r-- | 14.5 KB |
bfq-cgroup.c | -rw-r--r-- | 33.5 KB |
bfq-iosched.c | -rw-r--r-- | 188.3 KB |
bfq-iosched.h | -rw-r--r-- | 31.7 KB |
bfq-wf2q.c | -rw-r--r-- | 52.2 KB |
bio-integrity.c | -rw-r--r-- | 13.0 KB |
bio.c | -rw-r--r-- | 51.2 KB |
blk-cgroup.c | -rw-r--r-- | 47.5 KB |
blk-core.c | -rw-r--r-- | 105.2 KB |
blk-exec.c | -rw-r--r-- | 2.9 KB |
blk-flush.c | -rw-r--r-- | 17.3 KB |
blk-integrity.c | -rw-r--r-- | 12.1 KB |
blk-ioc.c | -rw-r--r-- | 10.9 KB |
blk-iolatency.c | -rw-r--r-- | 25.7 KB |
blk-lib.c | -rw-r--r-- | 11.1 KB |
blk-map.c | -rw-r--r-- | 5.9 KB |
blk-merge.c | -rw-r--r-- | 20.7 KB |
blk-mq-cpumap.c | -rw-r--r-- | 1.6 KB |
blk-mq-debugfs-zoned.c | -rw-r--r-- | 478 bytes |
blk-mq-debugfs.c | -rw-r--r-- | 24.1 KB |
blk-mq-debugfs.h | -rw-r--r-- | 2.3 KB |
blk-mq-pci.c | -rw-r--r-- | 1.7 KB |
blk-mq-rdma.c | -rw-r--r-- | 1.7 KB |
blk-mq-sched.c | -rw-r--r-- | 13.0 KB |
blk-mq-sched.h | -rw-r--r-- | 2.6 KB |
blk-mq-sysfs.c | -rw-r--r-- | 8.1 KB |
blk-mq-tag.c | -rw-r--r-- | 11.8 KB |
blk-mq-tag.h | -rw-r--r-- | 2.3 KB |
blk-mq-virtio.c | -rw-r--r-- | 1.7 KB |
blk-mq.c | -rw-r--r-- | 77.3 KB |
blk-mq.h | -rw-r--r-- | 5.8 KB |
blk-rq-qos.c | -rw-r--r-- | 4.1 KB |
blk-rq-qos.h | -rw-r--r-- | 2.6 KB |
blk-settings.c | -rw-r--r-- | 28.6 KB |
blk-softirq.c | -rw-r--r-- | 4.4 KB |
blk-stat.c | -rw-r--r-- | 4.7 KB |
blk-stat.h | -rw-r--r-- | 4.5 KB |
blk-sysfs.c | -rw-r--r-- | 24.8 KB |
blk-tag.c | -rw-r--r-- | 9.3 KB |
blk-throttle.c | -rw-r--r-- | 68.6 KB |
blk-timeout.c | -rw-r--r-- | 6.0 KB |
blk-wbt.c | -rw-r--r-- | 19.0 KB |
blk-wbt.h | -rw-r--r-- | 3.0 KB |
blk-zoned.c | -rw-r--r-- | 8.7 KB |
blk.h | -rw-r--r-- | 12.4 KB |
bounce.c | -rw-r--r-- | 8.8 KB |
bsg-lib.c | -rw-r--r-- | 8.7 KB |
bsg.c | -rw-r--r-- | 12.4 KB |
cfq-iosched.c | -rw-r--r-- | 126.7 KB |
cmdline-parser.c | -rw-r--r-- | 4.9 KB |
compat_ioctl.c | -rw-r--r-- | 10.9 KB |
deadline-iosched.c | -rw-r--r-- | 13.2 KB |
elevator.c | -rw-r--r-- | 27.4 KB |
genhd.c | -rw-r--r-- | 49.0 KB |
ioctl.c | -rw-r--r-- | 15.2 KB |
ioprio.c | -rw-r--r-- | 5.1 KB |
kyber-iosched.c | -rw-r--r-- | 25.3 KB |
mq-deadline.c | -rw-r--r-- | 20.0 KB |
noop-iosched.c | -rw-r--r-- | 2.6 KB |
opal_proto.h | -rw-r--r-- | 9.3 KB |
partition-generic.c | -rw-r--r-- | 17.2 KB |
scsi_ioctl.c | -rw-r--r-- | 19.1 KB |
sed-opal.c | -rw-r--r-- | 58.8 KB |
t10-pi.c | -rw-r--r-- | 7.9 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...