lkml.org 
[lkml]   [2011]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectpossible ERESTARTNOHAND leak into userspace
Hi,
this has already been discussed few years back with reports that select
returned with ERESTARTNOHAND in multi-threaded applications
(http://forum.soft32.com/linux/PATCH-select-fix-sys_select-leak-ERESTARTNOHAND-userspace-ftopict338572.html)

Dave has come up with a possible explanation of the race but there was
no further follow up with a conclusion.

Just for reference:
Thread_A Thread_B
CPU0 CPU1
syscall_XYZ
core_sys_select
ret = -ERESTARTNOHAND;
if (signal_pending(current))
do_notify_resume
do_signal (clear signal pending)
return ret;
return from syscall
no pending signal
return ERESTARTNOHAND

The race window is rather small and hard to trigger but we have seen
reports where people really saw select returning ERESTARTNOHAND (on
2.6.16 based kernel - x86_64).
I am not able to reproduce that myself neither with .16 kernel nor with
the current vanilla so I am not sure whether the problem has been fixed
already. But I do not see what prevents the race with vanilla.

Is the issue real and fixable?

Thanks
--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic


\
 
 \ /
  Last update: 2011-12-23 14:13    [W:0.484 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site