X Tutup
Skip to content

Commit 90ce762

Browse files
debarshiraypoettering
authored andcommitted
sysctl: Enable ping(8) inside rootless Podman containers
This makes ping(8) work without CAP_NET_ADMIN and CAP_NET_RAW because those aren't effective inside rootless Podman containers. It's quite useful when using OSTree based operating systems like Fedora Silverblue, where development environments are often set up using rootless Podman containers with helpers like Toolbox [1]. Not having a basic network utility like ping(8) work inside the development environment can be inconvenient. See: https://lwn.net/Articles/422330/ http://man7.org/linux/man-pages/man7/icmp.7.html containers/podman#1550 The upper limit of the range of group identifiers is set to 2147483647, which is 2^31-1. Values greater than that get rejected by the kernel because of this definition in linux/include/net/ping.h: #define GID_T_MAX (((gid_t)~0U) >> 1) That's not so bad because values between 2^31 and 2^32-1 are reserved on systemd-based systems anyway [2]. [1] https://github.com/debarshiray/toolbox [2] https://systemd.io/UIDS-GIDS.html#summary
1 parent 181824e commit 90ce762

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ systemd System and Service Manager
22

33
CHANGES WITH 243 in spe:
44

5+
* Enable unprivileged programs, neither setuid nor having file
6+
capabilities, to send ICMP Echo requests by turning on the
7+
net.ipv4.ping_group_range parameter of the Linux kernel for all
8+
groups. If this is not desirable, then it can be disabled by setting
9+
the parameter to "1 0".
10+
511
* Previously, filters defined with SystemCallFilter= would have the
612
effect that an calling an offending system call would terminate the
713
calling thread. This behaviour never made much sense, since killing

sysctl.d/50-default.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ net.ipv4.conf.all.accept_source_route = 0
3030
# Promote secondary addresses when the primary address is removed
3131
net.ipv4.conf.all.promote_secondaries = 1
3232

33+
# ping(8) without CAP_NET_ADMIN and CAP_NET_RAW
34+
# The upper limit is set to 2^31-1. Values greater than that get rejected by
35+
# the kernel because of this definition in linux/include/net/ping.h:
36+
# #define GID_T_MAX (((gid_t)~0U) >> 1)
37+
# That's not so bad because values between 2^31 and 2^32-1 are reserved on
38+
# systemd-based systems anyway: https://systemd.io/UIDS-GIDS.html#summary
39+
net.ipv4.ping_group_range = 0 2147483647
40+
3341
# Fair Queue CoDel packet scheduler to fight bufferbloat
3442
net.core.default_qdisc = fq_codel
3543

0 commit comments

Comments
 (0)
X Tutup