All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Bellon <mbellon@mvista.com>
To: linux-kernel@vger.kernel.org
Subject: PATCH: 2.4.28: 32 bit ltrace oops when tracing 64 bit executable [X86_64]
Date: Wed, 05 Jan 2005 14:41:28 -0700	[thread overview]
Message-ID: <41DC5F08.4020402@mvista.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

Didn't see  a fix for this so here it is. Tried using "ltrace -i" on a 
64 bit executable when ltrace was a 32 bit executable. The kernel threw 
an oops.

The find_target routine (arch/x86/ia32/ptrace32.c) doesn't deal with a 
NULL return from  find_task_by_pid properly - if NULL is returned 
put_task_struct() is still called.

mark




[-- Attachment #2: ltrace-patch --]
[-- Type: text/plain, Size: 731 bytes --]

Index: arch/x86_64/ia32/ptrace32.c
===================================================================
RCS file: /cvsdev/mvl-kernel/linux/arch/x86_64/ia32/ptrace32.c,v
retrieving revision 1.1.36.1.8.3
diff -a -u -r1.1.36.1.8.3 ptrace32.c
--- arch/x86_64/ia32/ptrace32.c	19 Nov 2004 04:41:58 -0000	1.1.36.1.8.3
+++ arch/x86_64/ia32/ptrace32.c	5 Jan 2005 19:26:43 -0000
@@ -182,14 +182,14 @@
 			goto out;
 		*err = ptrace_check_attach(child, request == PTRACE_KILL); 
 		if (*err < 0) 
-				goto out;
+			goto out;
 		return child; 
-	} 
 
  out:
-	put_task_struct(child);
+		put_task_struct(child);
+	} 
+
 	return NULL; 
-	
 } 
 
 extern asmlinkage long sys_ptrace(long request, long pid, unsigned long addr, unsigned long data);

                 reply	other threads:[~2005-01-05 21:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=41DC5F08.4020402@mvista.com \
    --to=mbellon@mvista.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.