Bug 2403785 - oping/noping can't be used by non-root users
Summary: oping/noping can't be used by non-root users
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: liboping
Version: 44
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Frantisek Sumsal
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/octo/liboping/issu...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-14 14:11 UTC by Sam Morris
Modified: 2026-07-01 09:58 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2026-06-09 13:17:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sam Morris 2025-10-14 14:11:16 UTC
As a non-root user, oping and noping fail:

$ oping google.com
PING google.com (142.250.129.139) 56 bytes of data.
ping_send failed: Operation not permitted

ping from iputils works fine.

Reproducible: Always

Steps to Reproduce:
1. Run 'oping google.com'

Actual Results:
Operation not permitted error

Expected Results:
Success

Additional Information:
strace reveals the problem is the socket syscall. liboping uses SOCK_RAW/IPPROTO_ICMP:

$ strace -e socket oping -c 1 127.0.0.1
socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_ROUTE) = 3
PING 127.0.0.1 (127.0.0.1) 56 bytes of data.
socket(AF_INET, SOCK_RAW, IPPROTO_ICMP) = -1 EPERM (Operation not permitted)
ping_send failed: Operation not permitted
+++ exited with 1 +++

... which requires privileges (e.g., CAP_NET_ADMIN & CAP_NET_RAW file capabilities).

iputils' ping, on the other hand uses SOCK_DGRAM/IPPROTO_ICMP:

$ strace -e socket ping -c1 127.0.0.1
socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP) = 3
socket(AF_INET6, SOCK_DGRAM, IPPROTO_ICMPV6) = 4
socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.079 ms

--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.079/0.079/0.079/0.000 ms
+++ exited with 0 +++

... which can be called by unprivileged users, provided their UID is within the range set in /proc/sys/net/ipv4/ping_group_range which as been the case since Fedora 31 according to <https://fedoraproject.org/wiki/Changes/EnableSysctlPingGroupRange>.

Comment 1 Fedora Release Engineering 2026-05-06 14:35:23 UTC
This message is a reminder that Fedora Linux 42 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 42 on 2026-05-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '42'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 42 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 2 Aoife Moloney 2026-06-09 13:17:05 UTC
Fedora Linux 42 entered end-of-life (EOL) status on 2026-05-27.

Fedora Linux 42 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 Sam Morris 2026-07-01 09:58:46 UTC
Forwarded upstream: https://github.com/octo/liboping/issues/78


Note You need to log in before you can comment on or make changes to this bug.