projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
abbae6d
)
eCryptfs: use after free in ecryptfs_release_messaging()
author
Dan Carpenter
<dan.carpenter@oracle.com>
Tue, 22 Aug 2017 20:41:28 +0000
(23:41 +0300)
committer
Tyler Hicks
<tyhicks@canonical.com>
Mon, 6 Nov 2017 18:22:34 +0000
(18:22 +0000)
We're freeing the list iterator so we should be using the _safe()
version of hlist_for_each_entry().
Fixes:
88b4a07e6610
("[PATCH] eCryptfs: Public key transport mechanism")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
fs/ecryptfs/messaging.c
patch
|
blob
|
history
diff --git
a/fs/ecryptfs/messaging.c
b/fs/ecryptfs/messaging.c
index
286f10b
..
4f457d5
100644
(file)
--- a/
fs/ecryptfs/messaging.c
+++ b/
fs/ecryptfs/messaging.c
@@
-442,15
+442,16
@@
void ecryptfs_release_messaging(void)
}
if (ecryptfs_daemon_hash) {
struct ecryptfs_daemon *daemon;
+ struct hlist_node *n;
int i;
mutex_lock(&ecryptfs_daemon_hash_mux);
for (i = 0; i < (1 << ecryptfs_hash_bits); i++) {
int rc;
- hlist_for_each_entry
(daemo
n,
- &ecryptfs_daemon_hash[i],
- euid_chain) {
+ hlist_for_each_entry
_safe(daemon,
n,
+
&ecryptfs_daemon_hash[i],
+
euid_chain) {
rc = ecryptfs_exorcise_daemon(daemon);
if (rc)
printk(KERN_ERR "%s: Error whilst "