[kernel-bugs] [Bug 1178280] Libvirt segfaults and causes kernel NULL pointer dereference on 5.9.1-1-default
https://bugzilla.suse.com/show_bug.cgi?id=1178280
https://bugzilla.suse.com/show_bug.cgi?id=1178280#c5
--- Comment #5 from Takashi Iwai
(In reply to Takashi Iwai from comment #2)
Created attachment 843153 [details] Test fix patch
Yeah, that should fix it. Alternativly we can handle the vcpu == NULL case in these debug printouts:
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 7f2e2a09ebbd..eca48467d35c 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -521,17 +521,19 @@ struct kvm { task_tgid_nr(current), ## __VA_ARGS__)
/* The guest did something we don't support. */ +#define vcpu_id(vcpu) \ + (vcpu) ? (vcpu)->vcpu_id : -1 #define vcpu_unimpl(vcpu, fmt, ...) \ kvm_pr_unimpl("vcpu%i, guest rIP: 0x%lx " fmt, \ - (vcpu)->vcpu_id, kvm_rip_read(vcpu), ## __VA_ARGS__) + vcpu_id(vcpu), kvm_rip_read(vcpu), ## __VA_ARGS__)
#define vcpu_debug(vcpu, fmt, ...) \ - kvm_debug("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__) + kvm_debug("vcpu%i " fmt, vcpu_id(vcpu), ## __VA_ARGS__) #define vcpu_debug_ratelimited(vcpu, fmt, ...) \ - kvm_debug_ratelimited("vcpu%i " fmt, (vcpu)->vcpu_id, \ + kvm_debug_ratelimited("vcpu%i " fmt, vcpu_id(vcpu), \ ## __VA_ARGS__) #define vcpu_err(vcpu, fmt, ...) \ - kvm_err("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__) + kvm_err("vcpu%i " fmt, vcpu_id(vcpu), ## __VA_ARGS__)
static inline bool kvm_dirty_log_manual_protect_and_init_set(struct kvm *kvm) {
Yes, that should work, too. I just chose a shorter change :) -- You are receiving this mail because: You are the assignee for the bug.
participants (1)
-
bugzilla_noreply@suse.com