bugzilla-daemon at bugzilla.mindrot.org
2007-Aug-04  18:18 UTC
[Bug 1349] New: race condition with ControlMaster=auto
http://bugzilla.mindrot.org/show_bug.cgi?id=1349
           Summary: race condition with ControlMaster=auto
           Product: Portable OpenSSH
           Version: 4.6p1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ssh
        AssignedTo: bitbucket at mindrot.org
        ReportedBy: dot at dotat.at
Created an attachment (id=1335)
 --> (http://bugzilla.mindrot.org/attachment.cgi?id=1335)
Fix race in ControlMaster=auto
There is a race in the setup of the ControlMaster socket in auto mode,
as illustrated by the following command line:
ssh -oControlMaster=auto -oControlPath=sock localhost 'sleep 1; echo 1'
&
ssh -oControlMaster=auto -oControlPath=sock localhost 'sleep 2; echo 2'
&
Both of the commands will try to start up as a control client, find
that sock does not exist, and switch into control master mode. One will
succeed in creating the control master socket and the other will fail
and bomb.
The attached patch eliminates this race by trying to create a control
master socket first, and falling back to control client mode if master
mode fails.
-- 
Configure bugmail: http://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Mar-06  12:40 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
David Woodhouse <dwmw2 at infradead.org> changed:
           What    |Removed                     |Added                       
----------------------------------------------------------------------------
                 CC|                            |dwmw2 at infradead.org         
--- Comment #1 from David Woodhouse <dwmw2 at infradead.org>  2008-03-06
23:40:08 ---
You don't seem to use the new 'test' argument to
ssh_control_listener()
You also new use it before it's declared, leading to the following
error:
ssh.c: In function ?ssh_session?:
ssh.c:997: warning: implicit declaration of function
?ssh_control_listener?
ssh.c: At top level:
ssh.c:1072: error: static declaration of ?ssh_control_listener? follows
non-static declaration
ssh.c:997: error: previous implicit declaration of
?ssh_control_listener? was here
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Mar-06  12:43 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
David Woodhouse <dwmw2 at infradead.org> changed:
           What    |Removed                     |Added                       
----------------------------------------------------------------------------
   Attachment #1335|0                           |1                           
        is obsolete|                            |                            
--- Comment #2 from David Woodhouse <dwmw2 at infradead.org>  2008-03-06
23:43:32 ---
Created an attachment (id=1461)
 --> (http://bugzilla.mindrot.org/attachment.cgi?id=1461)
updated patch
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Mar-06  12:45 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349 --- Comment #3 from David Woodhouse <dwmw2 at infradead.org> 2008-03-06 23:45:25 --- I verified that in combination with my patch for bug #1329, this still copes correctly with stale sockets. -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Mar-06  13:42 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349 --- Comment #4 from Tony Finch <dot at dotat.at> 2008-03-07 00:42:19 --- Thanks for looking at this patch. My original patch doesn't call ssh_control_listener() from ssh_session() so I think you introduced that error. I believe the control socket doesn't work with protocol version 1 because the latter doesn't support arbitrary multiplexed streams. If so it's wrong to add the call and wrong to re-arrange the code to make the call compile. Thanks for spotting that the test argument is redundant. -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Mar-06  13:59 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
David Woodhouse <dwmw2 at infradead.org> changed:
           What    |Removed                     |Added                       
----------------------------------------------------------------------------
   Attachment #1461|0                           |1                           
        is obsolete|                            |                            
--- Comment #5 from David Woodhouse <dwmw2 at infradead.org>  2008-03-07
00:59:36 ---
Created an attachment (id=1462)
 --> (http://bugzilla.mindrot.org/attachment.cgi?id=1462)
fixed patch
(In reply to comment #4)> My original patch doesn't call ssh_control_listener() from
> ssh_session() so I think you introduced that error.
So I did; sorry. I was applying this patch after the patch in bug #1330
to provide 'ControlPersist' support, and had to fix up a reject by hand
-- incompetently, it would seem.
This one puts it back where it should be. But also applies _after_ Alan
Barrett's patch in bug #1330, which is hopefully also ready to be
applied now.
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Mar-06  15:18 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
Tony Finch <dot at dotat.at> changed:
           What    |Removed                     |Added                       
----------------------------------------------------------------------------
                 CC|                            |dot at dotat.at                
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-May-09  08:20 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
Jeff Turner <jeff at atlassian.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeff at atlassian.com
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Jun-12  06:57 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
Damien Miller <djm at mindrot.org> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |djm at mindrot.org
         Depends on|                            |1329
             Blocks|                            |1452
--- Comment #6 from Damien Miller <djm at mindrot.org>  2008-06-12
16:57:13 ---
Fallback and recovery from mux socket errors is implemented in the
latest patch to bug #1329.
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Jun-13  00:18 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
Bug 1349 depends on bug 1329, which changed state.
Bug 1329 Summary: stale control sockets prevent connection.
http://bugzilla.mindrot.org/show_bug.cgi?id=1329
           What    |Old Value                   |New Value
----------------------------------------------------------------------------
         Resolution|                            |FIXED
             Status|NEW                         |RESOLVED
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Jun-13  00:20 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
Damien Miller <djm at mindrot.org> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.6p1                       |5.0p1
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
--- Comment #7 from Damien Miller <djm at mindrot.org>  2008-06-13
10:19:59 ---
the patch in attachment #1309 has been applied applied; will be in
openssh-5.1
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Jul-22  02:19 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
Damien Miller <djm at mindrot.org> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED
--- Comment #8 from Damien Miller <djm at mindrot.org>  2008-07-22
12:19:26 ---
Mass update RESOLVED->CLOSED after release of openssh-5.1
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2011-Mar-09  15:34 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
Bug 1349 depends on bug 1329, which changed state.
Bug 1329 Summary: stale control sockets prevent connection multiplexing.
https://bugzilla.mindrot.org/show_bug.cgi?id=1329
           What    |Old Value                   |New Value
----------------------------------------------------------------------------
         Resolution|FIXED                       |
             Status|CLOSED                      |REOPENED
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2011-Jun-03  02:20 UTC
[Bug 1349] race condition with ControlMaster=auto
https://bugzilla.mindrot.org/show_bug.cgi?id=1349
Bug 1349 depends on bug 1329, which changed state.
Bug 1329 Summary: stale control sockets prevent connection multiplexing.
https://bugzilla.mindrot.org/show_bug.cgi?id=1329
           What    |Old Value                   |New Value
----------------------------------------------------------------------------
         Resolution|                            |FIXED
             Status|REOPENED                    |RESOLVED
-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
Reasonably Related Threads
- race condition with ControlMaster=auto
 - [Bug 1329] New: stale control sockets prevent connection.
 - [Bug 1330] New: RFE: 'ControlPersist' support -- automatically fork and leave ControlMaster behind as a dæmon
 - [Bug 1917] New: Escape sequence (~) doesn't work right with ControlMaster/ControlPersist connections
 - ControlPersist and multiple X11 forwarding.