[patch 64/88] KVM: Prevent trace call into unloaded module text

Greg KH
2009-04-30T17:36:20Z

[-- Attachment #1: kvm-prevent-trace-call-into-unloaded-module-text.patch --]
[-- Type: text/plain, Size: 864 bytes --]

2.6.28-stable review patch. If anyone has any objections, please let us know.

------------------

From: Wu Fengguang <fengguang.wu@intel.com>

(cherry picked from b82091824ee4970adf92d5cd6d57b12273171625)

Add marker_synchronize_unregister() before module unloading.
This prevents possible trace calls into unloaded module text.

Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
virt/kvm/kvm_trace.c | 1 +
1 file changed, 1 insertion(+)

--- a/virt/kvm/kvm_trace.c
+++ b/virt/kvm/kvm_trace.c
@@ -252,6 +252,7 @@ void kvm_trace_cleanup(void)
struct kvm_trace_probe *p = &kvm_trace_probes[i];
marker_probe_unregister(p->name, p->probe_func, p);
}
+ marker_synchronize_unregister();

relay_close(kt->rchan);
debugfs_remove(kt->lost_file);