lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat,  9 Jul 2011 08:49:01 +0200
From:	Edwin van Vliet <edwin@...atah.nl>
To:	dhowells@...hat.com
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	Edwin van Vliet <edwin@...atah.nl>
Subject: [PATCH] kernel/cred: Fix bug on cred reference count

The comment above states that the old obj ref and subj ref should BOTH be
released. However, the line is repeated so the old obj ref is released twice
yet the subj ref is not. So either the comment is wrong, or this is simpy a
bug. Releasing the same ref twice seems wrong in any case.

Signed-off-by: Edwin van Vliet <edwin@...atah.nl>
---
 kernel/cred.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/cred.c b/kernel/cred.c
index 174fa84..2492f08 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -537,7 +537,7 @@ int commit_creds(struct cred *new)
 
 	/* release the old obj and subj refs both */
 	put_cred(old);
-	put_cred(old);
+	put_cred(new);
 	return 0;
 }
 EXPORT_SYMBOL(commit_creds);
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ