Pengwin: Ping doesn't work as /bin/ping is not SUID

Created on 24 Nov 2018  Â·  7Comments  Â·  Source: WhitewaterFoundry/Pengwin

Describe the bug
Ping operations (e.g. ping localhost) fail with the error ping: socket: Operation not permitted.
The command does work when run with root privilege (e.g. sudo ping localhost).
This particular issue should have been resolved since the Creator's Update (see, e.g. https://github.com/Microsoft/WSL/issues/18), and does not exhibit in a fresh install of the Ubuntu WSL distro (I am running Windows 10 1809 release)
In comparing /bin/ping in WLinux and Ubuntu (18.04) WSL distros, it seems my ping in WLinux does not have the SUID bit:

WLinux /bin/ping

-rwxr-xr-x 1 root root 64K Aug 3 17:53 /bin/ping

Ubuntu 18.04 /bin/ping

-rwsr-xr-x 1 root root 63K Mar 9 2017 /bin/ping

To Reproduce
Steps to reproduce the behavior:

  1. Install WLinux
  2. Attempt to ping an address
  3. Observe the error ping: socket: Operation not permitted
  4. Try again with sudo, observe success
  5. Execute chmod u+s /bin/ping, repeat ping without root and observe success

Expected behavior
/bin/ping should have the SUID bit (u+s) set, so that ping operations without root privilege should work without error.

Basic Troubleshooting Checklist

[X] I have searched Google for the error message.
[X] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled.
[X] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues.
[X] I have searched the WLinux issues page: https://github.com/WhitewaterFoundry/WLinux/issues.
[X] I have reset WLinux: Settings->Apps->Apps & features->WLinux->Advanced Options->Reset.
[ ] I have disabled and re-enabled WSL in Windows Features.
[X] I have run Windows 10 updates and restarted.

What other troubleshooting have you attempted?

I ran chmod u+s on /bin/ping in WLinux, and now it works as expected.

WLinux Version

1.1.25.0

Windows Build

OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.17763 N/A Build 17763
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
BIOS Version: Dell Inc. 1.5.1, 09/08/2018

Bug Patched

All 7 comments

Same version Wlinux Version : 1.125.0 and fully updated "apt update && apt upgrade" and I don't have it. (didn't change it too) (Shared for helping purpose)

image

Hmm, bizarre. Maybe something odd about my install. I didn't do apt upgrade (tho don't know if wlinux-setup does this?).
Unfortunately don't really want to blow away my install now to reset & retry. Feel free to close if not reproducible.

I will leave open for now, see if other reports come in, and try to reproduce on 1.1.26.

Hi everyone:
I newly installed WLinux 1.1.27.0 on Build 17763, ran ping localhost as my first thing after creating the user, and reproduced it. 😢 (Maybe I should be 😄 since I reproduced it? lol)

I could reproduce it in the same Windows 10 and WLinux versions. In fact after issuing sudo chmod u+s $(which ping) ping starts working. The strange thing is that in my other machine with Widnows 1803 it works and have the same permissions without running sudo chmod u+s $(which ping)

I mean we can add something to the rootfs script creation just to make sure the setuid bit is set, which would fix it, but understanding why is definitely something I'm going to work towards figuring out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patmolloy picture patmolloy  Â·  4Comments

Photonico picture Photonico  Â·  5Comments

thalamus picture thalamus  Â·  3Comments

sirredbeard picture sirredbeard  Â·  3Comments

camilorojasguzman picture camilorojasguzman  Â·  4Comments