Allow Wine ICMP/ping without running as root

Bug #518989 reported by Scott Ritchie
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Wine
Fix Released
Wishlist
wine1.2 (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Binary package hint: wine1.2

The program Ping Plotter is a network analysis tool that works under Wine, but only when run as root. Running Wine as root is something that should be avoided, both for security and usability reasons (sudo can mess up the ownership of files in the Wine folder).

One option is to use an SELinux feature and give Wine CAP_NET_RAW capability, which is something that should be done for the system ping as well (which I believe currently runs setuid root). The downside would be that any Windows program could then open raw sockets.

An old mail suggests another possibility: http://www.winehq.org/pipermail/wine-devel/2007-December/061479.html -- splitting Wine into different binaries with different permissions levels. I'm not sure how viable this is, as it would depend on splitting off different parts of the Windows API into secured and non-secured functions and then moving those functions into separate binaries. That would only be useful if there was an actual restricted (non-general) use of raw sockets in the API.

Revision history for this message
In , Ken Sharp (kennybobs) wrote :

$man ping

"SECURITY
       ping requires CAP_NET_RAWIO capability to be executed. It may be used as set-uid root."

Revision history for this message
In , Dmitry-codeweavers (dmitry-codeweavers) wrote :

This is a Linux kernel limitation not a Wine one.

Revision history for this message
In , Dmitry-codeweavers (dmitry-codeweavers) wrote :

Closing invalid.

Revision history for this message
In , Austin English (austinenglish) wrote :

I tried testing a couple batch scripts I use at work on wine. Since batch doesn't have a 'sleep command', the common workaround is to use ping several times instead, which works fine on windows. Wine, however, lacks ping, so it fails miserably.

Implementing our own ping.exe shouldn't be too terribly hard. There are several open source versions floating around to base the work off of. Hell, here's the original public domain source:
http://www.ping127001.com/pingpage/ping.text

Revision history for this message
In , Vitaliy-bugzilla (vitaliy-bugzilla) wrote :

(In reply to comment #0)
> Implementing our own ping.exe shouldn't be too terribly hard.
But it will require root privileges to run...

Revision history for this message
In , Austin English (austinenglish) wrote :

(In reply to comment #1)
> (In reply to comment #0)
> > Implementing our own ping.exe shouldn't be too terribly hard.
> But it will require root privileges to run...

Could perhaps just use a wrapper around the system's ping.

Revision history for this message
Scott Ritchie (scottritchie) wrote :

Binary package hint: wine1.2

The program Ping Plotter is a network analysis tool that works under Wine, but only when run as root. Running Wine as root is something that should be avoided, both for security and usability reasons (sudo can mess up the ownership of files in the Wine folder).

One option is to use an SELinux feature and give Wine CAP_NET_RAW capability, which is something that should be done for the system ping as well (which I believe currently runs setuid root). The downside would be that any Windows program could then open raw sockets.

An old mail suggests another possibility: http://www.winehq.org/pipermail/wine-devel/2007-December/061479.html -- splitting Wine into different binaries with different permissions levels. I'm not sure how viable this is, as it would depend on splitting off different parts of the Windows API into secured and non-secured functions and then moving those functions into separate binaries. That would only be useful if there was an actual restricted (non-general) use of raw sockets in the API.

Changed in wine:
status: Unknown → Invalid
Revision history for this message
In , Steve Dodier-Lazaro (sidi) wrote :

I think a solution could be to set the correct capability in the binary that does the ping itself, which could be done in Wine's Makefile (unless the app Daniel K. Attling uses is trying to send the ping packet on it's own, in which case there is nothing to do to workaround this bug).

Revision history for this message
In , Pa78 (pa78) wrote :

No matter if it's a bug or a linux kernel security limitation. There must be a proper solution!

I would need it for eMule's UploadSpeedSense feature... :(((

Revision history for this message
Peter-Alexander (pp78) wrote :

No matter if it's a bug or a linux kernel security limitation. There must be a proper solution!

I would need it for eMule's UploadSpeedSense feature... :(((

Revision history for this message
Sergiy Zuban (s-zuban) wrote :

try sudo setcap cap_net_raw+epi /usr/bin/wine-preloader

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in wine1.2 (Ubuntu):
status: New → Invalid
Changed in wine:
importance: Unknown → Low
Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. My apologies as I should not have marked this Invalid. The issue that you reported is one that should be reproducible with the live environment of the Desktop CD of the development release - Maverick Meerkat. It would help us greatly if you could test with it so we can work on getting it fixed in the next release of Ubuntu. You can find out more about the development release at http://www.ubuntu.com/testing/ . Thanks again and we appreciate your help.

Changed in wine1.2 (Ubuntu):
status: Invalid → Incomplete
Revision history for this message
Scott Ritchie (scottritchie) wrote :

rusivi1 please read the bug reports more carefully before giving automated responses.

CAP_NET_RAW on the Wine binary is not the correct solution, as that gives all Windows programs raw socket capability (which they no longer expect, as Windows itself disabled this around XP service pack 2)

The real solution (also at http://bugs.winehq.org/show_bug.cgi?id=20854) is to have a Wine version of Windows ping.exe, and to give THAT program CAP_NET_RAW. It's possible this can be done by just wrapping the existing system ping program.

Changed in wine1.2 (Ubuntu):
status: Incomplete → Triaged
Changed in wine:
importance: Low → Unknown
status: Invalid → Unknown
Changed in wine1.2 (Ubuntu):
importance: Undecided → Low
Changed in wine:
importance: Unknown → Wishlist
status: Unknown → Confirmed
Revision history for this message
In , Austin English (austinenglish) wrote :
Changed in wine:
status: Confirmed → Fix Released
Revision history for this message
In , Alexandre Julliard (julliard) wrote :

Closing bugs fixed in 1.3.20.

Revision history for this message
Ken Sharp (kennybobs) wrote :

Even when this is fixed, it is unlikely to make the Wine1.2 branch in Ubuntu.

Revision history for this message
dino99 (9d9) wrote :

this is no more a supported version

Changed in wine1.2 (Ubuntu):
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.