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-prev] [day] [month] [year] [list]
Message-ID: <tip-d9a5ac9ef306eb5cc874f285185a15c303c50009@git.kernel.org>
Date:	Sun, 15 May 2011 12:16:13 GMT
From:	tip-bot for Julia Lawall <julia@...u.dk>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, julia@...u.dk, hpa@...or.com,
	mingo@...hat.com, yinghai@...nel.org, andreas.herrmann3@....com,
	robert.richter@....com, stable@...nel.org, tglx@...utronix.de,
	mingo@...e.hu, borislav.petkov@....com
Subject: [tip:x86/urgent] x86, mce, AMD: Fix leaving freed data in a list

Commit-ID:  d9a5ac9ef306eb5cc874f285185a15c303c50009
Gitweb:     http://git.kernel.org/tip/d9a5ac9ef306eb5cc874f285185a15c303c50009
Author:     Julia Lawall <julia@...u.dk>
AuthorDate: Fri, 13 May 2011 15:52:09 +0200
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 13 May 2011 17:11:02 +0200

x86, mce, AMD: Fix leaving freed data in a list

b may be added to a list, but is not removed before being freed
in the case of an error.  This is done in the corresponding
deallocation function, so the code here has been changed to
follow that.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E,E1,E2;
identifier l;
@@

*list_add(&E->l,E1);
... when != E1
    when != list_del(&E->l)
    when != list_del_init(&E->l)
    when != E = E2
*kfree(E);// </smpl>

Signed-off-by: Julia Lawall <julia@...u.dk>
Cc: Borislav Petkov <borislav.petkov@....com>
Cc: Robert Richter <robert.richter@....com>
Cc: Yinghai Lu <yinghai@...nel.org>
Cc: Andreas Herrmann <andreas.herrmann3@....com>
Cc: <stable@...nel.org>
Link: http://lkml.kernel.org/r/1305294731-12127-1-git-send-email-julia@diku.dk
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 arch/x86/kernel/cpu/mcheck/mce_amd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 167f97b..bb0adad 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -509,6 +509,7 @@ recurse:
 out_free:
 	if (b) {
 		kobject_put(&b->kobj);
+		list_del(&b->miscj);
 		kfree(b);
 	}
 	return err;
--
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