projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a374e89
)
KVM: s390: avoid memory leaks if __inject_vm() fails
author
David Hildenbrand
<
[email protected]
>
Fri, 16 Jan 2015 11:58:09 +0000
(12:58 +0100)
committer
Christian Borntraeger
<
[email protected]
>
Fri, 23 Jan 2015 12:25:41 +0000
(13:25 +0100)
We have to delete the allocated interrupt info if __inject_vm() fails.
Otherwise user space can keep flooding kvm with floating interrupts and
provoke more and more memory leaks.
Reported-by: Dominik Dingel <
[email protected]
>
Reviewed-by: Dominik Dingel <
[email protected]
>
Signed-off-by: David Hildenbrand <
[email protected]
>
Cc:
[email protected]
# v3.15+
Signed-off-by: Christian Borntraeger <
[email protected]
>
arch/s390/kvm/interrupt.c
patch
|
blob
|
history
diff --git
a/arch/s390/kvm/interrupt.c
b/arch/s390/kvm/interrupt.c
index a6cb238049d18fa92f40be7f6b51ae4b143df257..6d7513e1556082f5f860ef9ebe8cdbe875d5db17 100644
(file)
--- a/
arch/s390/kvm/interrupt.c
+++ b/
arch/s390/kvm/interrupt.c
@@
-1277,6
+1277,7
@@
int kvm_s390_inject_vm(struct kvm *kvm,
struct kvm_s390_interrupt *s390int)
{
struct kvm_s390_interrupt_info *inti;
+ int rc;
inti = kzalloc(sizeof(*inti), GFP_KERNEL);
if (!inti)
@@
-1324,7
+1325,10
@@
int kvm_s390_inject_vm(struct kvm *kvm,
trace_kvm_s390_inject_vm(s390int->type, s390int->parm, s390int->parm64,
2);
- return __inject_vm(kvm, inti);
+ rc = __inject_vm(kvm, inti);
+ if (rc)
+ kfree(inti);
+ return rc;
}
void kvm_s390_reinject_io_int(struct kvm *kvm,