* ARM syscall restarting with TIF_SYSCALL_RESTARTSYS
@ 2012-06-15 11:56 Catalin Marinas
0 siblings, 0 replies; only message in thread
From: Catalin Marinas @ 2012-06-15 11:56 UTC (permalink / raw)
To: linux-arm-kernel
Hi Al,
With the recent changes the syscall restarting on ARM is done via the
TIF_SYSCALL_RESTARTSYS flag which causes the override of the syscall
number in syscall_trace(). I think there is a scenario where this could
fail:
1. app does a syscall
2. syscall interrupted and returns -ERESTART_RESTARTBLOCK. There is no
signal to deliver
3. do_signal() sets TIF_SYSCALL_RESTARTSYS and ARM_pc to restart_addr
4. Linux returns to the SVC instruction (restart_addr) in user space
but, before SVC is re-executed, it gets an interrupt
5. When returning from interrupt, a signal is to be delivered.
do_signal() does not clear TIF_SYSCALL_RESTARTSYS since it is
returning from interrupt
6. Signal handler calls sigreturn() but the syscall number gets
overridden by syscall_trace() since TIF_SYSCALL_RESTARTSYS is set
The solution I see is to do the restarting within the kernel without
returning to user and risk getting another signal (I think Russell
mentioned this in the past).
Are my assumptions above correct or did I miss anything?
Thanks.
--
Catalin
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-06-15 11:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15 11:56 ARM syscall restarting with TIF_SYSCALL_RESTARTSYS Catalin Marinas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).