← Back to team overview

kernel-packages team mailing list archive

[Bug 1593657] Re: ControlPath unix socket is created in a weird way


OK. I did just a bare minimum checks.
The file is called mux.c, the function is "void muxserver_listen(void)" at line 1241.
Two comments seem quite important:

         * Use a temporary path before listen so we can pseudo-atomically
         * establish the listening socket in its final location to avoid
         * other processes racing in between bind() and listen() and hitting
         * an unready socket.


        /* Now atomically "move" the mux socket into position */

Unluckily I haven't enough time to go on. Maybe later...

You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.

  ControlPath unix socket is created in a weird way

Status in linux package in Ubuntu:
Status in openssh package in Ubuntu:

Bug description:

  1. Create a ControlPath socket with something like "-o ControlPath=/tmp/sshcontrol-%C" during an SSH connection.
  2. Check with ls the socket is there. I am getting

  srw------- 1 enzo enzo  0 2016-06-17 10:17:21 sshcontrol-

  3. Ask lsof who's that socket belonging to:

  lsof /tmp/sshcontrol-369d1187d3900c559f063f947218528001d0e705

  4. Ask lsof the same but with grep

  lsof | grep /tmp/sshcontrol-369d1187d3900c559f063f947218528001d0e705

  For step no. 3 I am getting nothing (but the WARNING about /sys/kernel/debug/tracing)
  For step no. 4 I am getting:

  [enzo@Feynman ~] lsof | grep /tmp/sshcontrol-369d1187d3900c559f063f947218528001d0e705
  lsof: WARNING: can't stat() tracefs file system /sys/kernel/debug/tracing
        Output information may be incomplete.
  ssh       10667             enzo    4u     unix 0x0000000000000000       0t0     173813 /tmp/sshcontrol-369d1187d3900c559f063f947218528001d0e705.NDScoG3mgs0mWc4q type=STREAM

  Where you can see clearly that the socket name has a trailing part

  5. Ask lsof about the socket with the extended name


  [enzo@Feynman ~] lsof /tmp/sshcontrol-369d1187d3900c559f063f947218528001d0e705.NDScoG3mgs0mWc4q
  lsof: WARNING: can't stat() tracefs file system /sys/kernel/debug/tracing
        Output information may be incomplete.
  lsof: status error on /tmp/sshcontrol-369d1187d3900c559f063f947218528001d0e705.NDScoG3mgs0mWc4q: No such file or directory
  lsof 4.89
   latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
   latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
   latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
   usage: [-?abhKlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-E] [+|-e s] [+|-f[gG]]
   [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s]
   [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names]
  Use the ``-h'' option to get more help information.

  A reasonable output from lsof detailing the real and actual unix socket.


  man 5 ssh_config at the section "ControlPath"

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: openssh-client 1:7.2p2-4ubuntu1
  Uname: Linux 4.4.13-040413-lowlatency x86_64
  NonfreeKernelModules: rfcomm ipt_REJECT nf_reject_ipv4 pci_stub vboxpci vboxnetadp vboxnetflt vboxdrv bnep btusb btrtl btbcm btintel xt_multiport iptable_filter ip_tables x_tables 8812au ath3k cfg80211 bluetooth uas usb_storage input_leds hp_wmi sparse_keymap snd_hda_codec_realtek snd_hda_codec_generic intel_rapl x86_pkg_temp_thermal intel_powerclamp snd_hda_intel coretemp snd_hda_codec kvm_intel snd_hda_core kvm snd_hwdep snd_pcm irqbypass crct10dif_pclmul crc32_pclmul aesni_intel snd_seq_midi aes_x86_64 snd_seq_midi_event lrw snd_rawmidi gf128mul glue_helper ablk_helper cryptd snd_seq snd_seq_device serio_raw snd_timer mei_me snd mei soundcore shpchp lpc_ich 8250_fintek mac_hid parport_pc ppdev lp parport autofs4 xfs raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 multipath linear hid_generic usbhid hid raid0 i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt psmouse ahci fb_sys_fops libahci drm r8169 mii wmi fjes video
  ApportVersion: 2.20.1-0ubuntu2.1
  Architecture: amd64
  CurrentDesktop: KDE
  Date: Fri Jun 17 11:49:04 2016
  InstallationDate: Installed on 2016-04-22 (55 days ago)
  InstallationMedia: Kubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
   ssh-askpass       N/A
   libpam-ssh        N/A
   keychain          N/A
   ssh-askpass-gnome N/A
  SSHClientVersion: OpenSSH_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips  1 Mar 2016
  SourcePackage: openssh
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to: