ARM syscall restarting with TIF_SYSCALL_RESTARTSYS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter