Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] syscall restart block.
@ 2004-09-12 18:45 Carlos O'Donell
  2004-09-12 21:36 ` James Bottomley
  2004-09-13  0:05 ` [parisc-linux] " Randolph Chung
  0 siblings, 2 replies; 4+ messages in thread
From: Carlos O'Donell @ 2004-09-12 18:45 UTC (permalink / raw)
  To: John David Anglin; +Cc: James Bottomley, Randolph Chung, parisc-linux


jda,

Oh, I realized today we still have a hole in the way we handle
restartable syscalls. Normally the restarter function is placed in a
function descriptor, a stack trampoline is laid down, the user process
is allowed to return, execute the stack trampoline with the modified
syscall number (indicating restart), upon entry to the kernel the
restart function is executed with arugments. 

The problem is that we should in general disable restartable syscalls as
we walk the userspace return trampoline. If the user took a signal
during the trampoline walk, the signal handler could execute a
restartable syscall, and if that syscall was interrupted, the restorer
function would be changed (there is only one entry for a restorer, they
aren't chained). This means that you technically call the wrong syscall
when you unwind from the signal that you took on the stack trampoline.

If we move stack trampolines to the gateway pagethen signals can't be
delivered to the returning process during the trampoline walk (signals
are not allowed to be delivered for processes on the gateway page). So
it fixes our hole too.

It also allows us to interpret PT_GNU_STACK properly, since the kernel
no longer needs to execute a trampoline on the users stack. The
toolchain can now correctly mark the stack as non-exec.

I only just realized we still had this hole and it might manifest itself
under heavy signal load.

Randolph, comments?
Does this analysis sound correct?

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-09-13 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-12 18:45 [parisc-linux] syscall restart block Carlos O'Donell
2004-09-12 21:36 ` James Bottomley
2004-09-13  0:05 ` [parisc-linux] " Randolph Chung
2004-09-13 16:03   ` [parisc-linux] [RFC] hppa needs a vDSO? Solves signal trampolines and opens up new possibilities Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox