trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: davej@redhat.com
Cc: trinity@vger.kernel.org, jirislaby@gmail.com
Subject: [PATCH] modify_ldt: initialize scratch
Date: Mon, 20 Jan 2014 21:15:35 +0100	[thread overview]
Message-ID: <1390248935-22801-1-git-send-email-jslaby@suse.cz> (raw)

From: Jiri Slaby <jirislaby@gmail.com>

We store a pointer in the scratch area, but only conditionally. Hence
there can be an uninitialized value which causes problems in the
tear-down path:
*** Error in `trinity': double free or corruption (!prev):
0x0000000002484530 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x740af)[0x7f2a66eb60af]
/lib64/libc.so.6(+0x798de)[0x7f2a66ebb8de]
/lib64/libc.so.6(+0x7a5e6)[0x7f2a66ebc5e6]
trinity[0x40abc8]
trinity[0x40dabc]
trinity[0x40338a]
trinity[0x40704c]
trinity[0x402c47]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f2a66e63b15]
trinity[0x402f13]
---
 syscalls/modify_ldt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/syscalls/modify_ldt.c b/syscalls/modify_ldt.c
index de9cbbe..c0cac1a 100644
--- a/syscalls/modify_ldt.c
+++ b/syscalls/modify_ldt.c
@@ -18,6 +18,7 @@ static void sanitise_modify_ldt(int childno)
 	void *ldt;
 	//struct user_desc *desc;
 
+	shm->scratch[childno] = 0;
 	switch (shm->a1[childno]) {
 	case 0:
 		/* read the ldt into the memory pointed to by ptr.
-- 
1.8.5.2

             reply	other threads:[~2014-01-20 20:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 20:15 Jiri Slaby [this message]
2014-01-20 21:39 ` [PATCH] modify_ldt: initialize scratch Dave Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390248935-22801-1-git-send-email-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=davej@redhat.com \
    --cc=jirislaby@gmail.com \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).