From: Blaisorblade <blaisorblade@yahoo.it>
To: Jeff Dike <jdike@addtoit.com>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] SKAS leftovers: having fun with old code relicts (aka PTRACE_SIGPENDING)
Date: Sun, 6 Mar 2005 19:49:03 +0100 [thread overview]
Message-ID: <200503061949.03819.blaisorblade@yahoo.it> (raw)
Ok, what I discovered today is just funny...
A little, ignarious programmer (me) was porting the SKAS patch to x86_64, and
proof-checking the sizes of vars.
While looking at PTRACE_SIGPENDING, he realized that in the i386 version we
copy a sigset_t value (child->pending.signal), which is 64-bit wide, to a
"unsigned long", i.e. 32-bit wide*.
case PTRACE_SIGPENDING:
ret = copy_to_user((unsigned long *) data,
&child->pending.signal,
sizeof(child->pending.signal));
break;
"What the fuck!" said the ignarious programmer (me), and he went looking
carefully to each and every usage of PTRACE_SIGPENDING in the Uml code, to
check why nobody sees the world collapsing (maybe the callers are correct
anyway, he thought):
$ find arch/um/ include/asm-um/ |xargs grep PTRACE_SIGPENDING
arch/um/kernel/ptrace.c: case PTRACE_SIGPENDING:
arch/um/include/skas_ptrace.h:#define PTRACE_SIGPENDING 53
He checked better, and better, distrusting the Truth discovered by his poor
and liable mate, Lord Grep... but at last he couldn't ignore the Truth:
PTRACE_SIGPENDING is a (broken) relict!
After this story, we come to the question: Jeff, what I missed (apart that
probably it was used in releases before SKAS3)?
Could I delete PTRACE_SIGPENDING from the SKAS patch?
I wouldn't for the sake of compatibility, but since the interface has never
been used by SKAS, and probably (if somebody else used it) it didn't work
well, I'm not certain.
*Actually, even if we write 64-bit to a 32-bit pointer above, this is done
also for PTRACE_LDT, so type of the cast is just cosmetical. The point is
that it's misleading for the reader.
--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next reply other threads:[~2005-03-07 19:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-06 18:49 Blaisorblade [this message]
2005-03-08 0:00 ` [uml-devel] Re: SKAS leftovers: having fun with old code relicts (aka PTRACE_SIGPENDING) Jeff Dike
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=200503061949.03819.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=jdike@addtoit.com \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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