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
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to