Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Validate client side socket port bind capability #436

Closed
kerneltime opened this issue Jun 2, 2016 · 5 comments
Closed

Validate client side socket port bind capability #436

kerneltime opened this issue Jun 2, 2016 · 5 comments

Comments

@kerneltime
Copy link
Contributor

We only want processes with root privileges to be able to communicate with the ESX backend.
This requires

  1. Ability to bind a port dynamically below 1024 on the client side
  2. Validate the client port on the server side.

Relevant doc
and from vSockets Programming Guide, pg 17

The port number is arbitrary, although server (listener) and client (connector) must use the same number,
which must designate a port not already in use. Only privileged processes can use ports < 1024.
@kerneltime
Copy link
Contributor Author

Fixed in #469

@lipingxue
Copy link
Contributor

I saw a issue which may related to this client side socket port bind issue.
I use the following simple bash script to create 60 docker volumes,

#!/bin/bash

for i in {1..60}
do
        vol_name_prefix="t"
        vol_name="${vol_name_prefix}${i}"
        echo $vol_name
        docker volume create --driver=vmdk --name=$vol_name -o size=100mb
        #docker run -it -v $vol_name:/data busybox
done

I do see some intermittent errors like this

           root@photon-machine [ ~ ]# ./create_vol.sh 
......
t6
t7
Error response from daemon: create t7: VolumeDriver.Create: 'create' failed: address already in use (errno=98).
......
t30
Error response from daemon: create t30: VolumeDriver.Create: 'create' failed: address already in use (errno=98).
......
Error response from daemon: create t53: VolumeDriver.Create: 'create' failed: address already in use (errno=98).

I talked with Mark, and he said that this may relate to the client socket bind issue.

We check the "docker-volume-vsphere.log", and we did see other commands (such as "get")
also failed with the same error.

vi /var/log/docker-volume-vsphere.log

2016-08-13 22:00:12.094932863 +0000 UTC [INFO] Volume created name=t38
2016-08-13 22:00:12.251016903 +0000 UTC [INFO] Volume created name=t39
2016-08-13 22:00:12.395618983 +0000 UTC [INFO] Volume created name=t40
2016-08-13 22:00:12.506006561 +0000 UTC [INFO] Volume created name=t41
2016-08-13 22:00:12.519231089 +0000 UTC [WARNING] 'get' failed: address already in use (errno=98).
2016-08-13 22:00:12.616420137 +0000 UTC [INFO] Volume created name=t42
2016-08-13 22:00:12.760454636 +0000 UTC [INFO] Volume created name=t43
2016-08-13 22:00:12.910903202 +0000 UTC [INFO] Volume created name=t44
2016-08-13 22:00:13.060382974 +0000 UTC [INFO] Volume created name=t45
2016-08-13 22:00:13.1764114 +0000 UTC [INFO] Volume created name=t46
2016-08-13 22:00:13.296623184 +0000 UTC [INFO] Volume created name=t47
2016-08-13 22:00:13.443843147 +0000 UTC [INFO] Volume created name=t48
2016-08-13 22:00:13.562961135 +0000 UTC [INFO] Volume created name=t49
2016-08-13 22:00:13.693503985 +0000 UTC [INFO] Volume created name=t50
2016-08-13 22:00:13.816635196 +0000 UTC [INFO] Volume created name=t51
2016-08-13 22:00:13.975281485 +0000 UTC [INFO] Volume created name=t52
2016-08-13 22:00:14.153144985 +0000 UTC [WARNING] 'create' failed: address already in use (errno=98).
2016-08-13 22:00:14.153195988 +0000 UTC [ERROR] Create volume failed name=t53 error="'create' failed: address already in use (errno=98)."
2016-08-13 22:00:14.29438264 +0000 UTC [INFO] Volume created name=t54
2016-08-13 22:00:14.42941481 +0000 UTC [INFO] Volume created name=t55
2016-08-13 22:00:14.587360087 +0000 UTC [INFO] Volume created name=t56
2016-08-13 22:00:14.764507282 +0000 UTC [INFO] Volume created name=t57
2016-08-13 22:00:14.934984588 +0000 UTC [INFO] Volume created name=t58
2016-08-13 22:00:15.110658079 +0000 UTC [INFO] Volume created name=t59
2016-08-13 22:00:15.260319668 +0000 UTC [INFO] Volume created name=t60
2016-08-13 22:01:39.885544279 +0000 UTC [INFO] Mounting volume name=t1
2016-08-13 22:01:40.113348702 +0000 UTC [INFO] Attach complete event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:0:0": 0x100 == IN_CREATE name=t1
2016-08-13 22:01:41.943454524 +0000 UTC [INFO] Mounting volume name=t2
2016-08-13 22:01:42.190171407 +0000 UTC [INFO] Attach complete name=t2 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:1:0": 0x100 == IN_CREATE
2016-08-13 22:01:43.01221391 +0000 UTC [INFO] Mounting volume name=t3
2016-08-13 22:01:43.277601551 +0000 UTC [INFO] Attach complete name=t3 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:2:0": 0x100 == IN_CREATE
2016-08-13 22:01:44.730767562 +0000 UTC [INFO] Mounting volume name=t4
2016-08-13 22:01:45.012322181 +0000 UTC [INFO] Attach complete event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:3:0": 0x100 == IN_CREATE name=t4
2016-08-13 22:01:45.547569428 +0000 UTC [INFO] Mounting volume name=t5
2016-08-13 22:01:45.812254598 +0000 UTC [INFO] Attach complete name=t5 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:4:0": 0x100 == IN_CREATE
2016-08-13 22:01:46.791665135 +0000 UTC [INFO] Mounting volume name=t6
2016-08-13 22:01:47.08349805 +0000 UTC [INFO] Attach complete name=t6 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:5:0": 0x100 == IN_CREATE
2016-08-13 22:01:47.807384149 +0000 UTC [INFO] Mounting volume name=t7
2016-08-13 22:01:48.106079367 +0000 UTC [WARNING] 'attach' failed: address already in use (errno=98).
2016-08-13 22:01:48.106117783 +0000 UTC [ERROR] Failed to mount name=t7 error="'attach' failed: address already in use (errno=98)."
2016-08-13 22:01:48.181060424 +0000 UTC [INFO] Unmounting Volume name=t7
2016-08-13 22:01:48.181154585 +0000 UTC [ERROR] Failed to unmount volume. Now trying to detach... mountpoint="/mnt/vmdk/t7" error="invalid argument"
2016-08-13 22:01:48.36211354 +0000 UTC [INFO] Mounting volume name=t8
2016-08-13 22:01:48.65506011 +0000 UTC [INFO] Attach complete name=t8 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:6:0": 0x100 == IN_CREATE
2016-08-13 22:01:55.943062202 +0000 UTC [INFO] Mounting volume name=t9
2016-08-13 22:01:56.23817864 +0000 UTC [INFO] Attach complete name=t9 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:8:0": 0x100 == IN_CREATE
2016-08-13 22:01:57.598737083 +0000 UTC [INFO] Mounting volume name=t10
2016-08-13 22:01:57.905286364 +0000 UTC [INFO] Attach complete name=t10 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:9:0": 0x100 == IN_CREATE
2016-08-13 22:01:59.174427904 +0000 UTC [INFO] Mounting volume name=t11
2016-08-13 22:01:59.503064626 +0000 UTC [INFO] Attach complete name=t11 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:10:0": 0x100 == IN_CREATE
2016-08-13 22:02:00.686381058 +0000 UTC [INFO] Mounting volume name=t12
2016-08-13 22:02:01.018796811 +0000 UTC [INFO] Attach complete name=t12 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:11:0": 0x100 == IN_CREATE
2016-08-13 22:02:05.878525334 +0000 UTC [INFO] Mounting volume name=t13
2016-08-13 22:02:06.236054358 +0000 UTC [INFO] Attach complete name=t13 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:12:0": 0x100 == IN_CREATE
2016-08-13 22:02:07.590262952 +0000 UTC [INFO] Mounting volume name=t14
2016-08-13 22:02:07.938647582 +0000 UTC [INFO] Attach complete name=t14 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:13:0": 0x100 == IN_CREATE
2016-08-13 22:02:09.292208955 +0000 UTC [INFO] Mounting volume name=t15
2016-08-13 22:02:09.65822443 +0000 UTC [INFO] Attach complete name=t15 event="/dev/disk/by-path/pci-0000:0b:00.0-scsi-0:0:14:0": 0x100 == IN_CREATE

I am reopening this bug.
Ritesh, could you take a look? Thanks! @kerneltime

@lipingxue lipingxue reopened this Aug 18, 2016
@kerneltime
Copy link
Contributor Author

Thanks, will do.

@kerneltime kerneltime modified the milestones: 0.7 release, v1 Beta Sep 8, 2016
@kerneltime
Copy link
Contributor Author

Plan to fix this for next release.

@kerneltime
Copy link
Contributor Author

kerneltime commented Sep 29, 2016

Range extended in #606

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants