All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [RFC PATCH 4/10] SKAS4 - Workaround compat PTRACE_GETSIGINFO bug
@ 2008-01-14 21:36 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2008-01-14 21:36 UTC (permalink / raw)
  To: UML-user, uml-devel

    copy_siginfo_to_user correctly strips off the high bits of si->si_code
    before copying it to userspace.
    
    Unfortunately, ptrace32_siginfo calls copy_siginfo_to_user to put the
    siginfo into a temporary userspace buffer and counts on the high bits
    still being present so that it may initialize the union in the final
    32-bit siginfo.
    
    This patch works around this problem by having copy_siginfo_to_user
    copy si->si_code intact to userspace.  This introduces a bug in native
    64-bit PTRACE_GETSIGINFO, but I haven't noticed anything being
    bothered by it.

diff --git a/kernel/signal.c b/kernel/signal.c
index 1e067a1..28813b1 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2088,7 +2088,7 @@ int copy_siginfo_to_user(siginfo_t __user *to, siginfo_t *from)
 	 */
 	err = __put_user(from->si_signo, &to->si_signo);
 	err |= __put_user(from->si_errno, &to->si_errno);
-	err |= __put_user((short)from->si_code, &to->si_code);
+	err |= __put_user(from->si_code, &to->si_code);
 	switch (from->si_code & __SI_MASK) {
 	case __SI_KILL:
 		err |= __put_user(from->si_pid, &to->si_pid);

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-01-14 21:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-14 21:36 [uml-devel] [RFC PATCH 4/10] SKAS4 - Workaround compat PTRACE_GETSIGINFO bug Jeff Dike

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.