Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db86be3a authored by Dan Carpenter's avatar Dan Carpenter Committed by Tyler Hicks
Browse files

eCryptfs: use after free in ecryptfs_release_messaging()



We're freeing the list iterator so we should be using the _safe()
version of hlist_for_each_entry().

Fixes: 88b4a07e ("[PATCH] eCryptfs: Public key transport mechanism")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
parent abbae6d5
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -442,13 +442,14 @@ 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(daemon,
			hlist_for_each_entry_safe(daemon, n,
						  &ecryptfs_daemon_hash[i],
						  euid_chain) {
				rc = ecryptfs_exorcise_daemon(daemon);