linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* CLONE from pthread_create fails with ERESTARTNOINTR and application crashes
@ 2014-05-21 13:40 Raghu Pv
  2014-05-22  9:04 ` Will Deacon
  0 siblings, 1 reply; 3+ messages in thread
From: Raghu Pv @ 2014-05-21 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

Overview:



CLONE from pthread_create fails with ERESTARTNOINTR and application crashes



Steps to reproduce:



Executing a multithreaded application that creates and terminates
threads and also there a lot of signals



If a signal arrives during execution of clone(), clone is returning
ERESTARTNOINTR to userspace.



We see the following implementation that sets ERESTARTNOINTR:



        /*

         * Process group and session signals need to be delivered to just the

         * parent before the fork or both the parent and the child after the

         * fork. Restart if a signal comes in before we add the new process to

         * it's process group.

         * A fatal signal pending means that current will exit, so the new

         * thread can't slip out of an OOM kill (or normal SIGKILL).

         */

        recalc_sigpending();

        if (signal_pending(current)) {

                spin_unlock(&current->sighand->siglock);

                write_unlock_irq(&tasklist_lock);

                retval = -ERESTARTNOINTR;

                goto bad_fork_cleanup_namespace;

        }





Leaking ERESTARTNOINTR to userspace is a big concern because this a
kernel internal error code.



Immediately after that the application crashes.



Actual result: Application crashes



Expected Result: Application should not crash and clone system call
should restart if clone is previously interrupted by a signal.

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

end of thread, other threads:[~2014-05-22  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 13:40 CLONE from pthread_create fails with ERESTARTNOINTR and application crashes Raghu Pv
2014-05-22  9:04 ` Will Deacon
2014-05-22  9:40   ` Raghu Pv

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).