projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e23be0a
)
HID: hiddev: fix use after free in hiddev_release
author
Dan Carpenter
<error27@gmail.com>
Thu, 26 May 2011 08:49:16 +0000
(11:49 +0300)
committer
Jiri Kosina
<jkosina@suse.cz>
Thu, 26 May 2011 12:04:40 +0000
(14:04 +0200)
There are a couple use after free bugs here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
[jkosina@suse.cz: removed already fixed hunk]
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/hiddev.c
patch
|
blob
|
history
diff --git
a/drivers/hid/usbhid/hiddev.c
b/drivers/hid/usbhid/hiddev.c
index 4985f485932fb5e3582601c14918411c38a1d14d..7c1188b53c3ec0ea4aca4364239d9e3596cb7cfa 100644
(file)
--- a/
drivers/hid/usbhid/hiddev.c
+++ b/
drivers/hid/usbhid/hiddev.c
@@
-248,12
+248,15
@@
static int hiddev_release(struct inode * inode, struct file * file)
usbhid_close(list->hiddev->hid);
usbhid_put_power(list->hiddev->hid);
} else {
+ mutex_unlock(&list->hiddev->existancelock);
kfree(list->hiddev);
+ kfree(list);
+ return 0;
}
}
- kfree(list);
mutex_unlock(&list->hiddev->existancelock);
+ kfree(list);
return 0;
}