Bug 1194156

Summary: iputils: setting /usr/bin/ping to root:root 0755 "= cap_net_raw+ep". (wrong missing capabilities)
Product: [openSUSE] openSUSE Distribution Reporter: Ulrich Windl <Ulrich.Windl>
Component: Upgrade ProblemsAssignee: package coldpool <coldpool>
Status: RESOLVED INVALID QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: gnome-bugs, matthias.gerstner, meissner, petr.vorel, petr.vorel, pgajdos
Version: Leap 15.3   
Target Milestone: ---   
Hardware: Other   
OS: Other   
See Also: https://bugzilla.suse.com/show_bug.cgi?id=1174504
https://bugzilla.suse.com/show_bug.cgi?id=1140993
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ulrich Windl 2021-12-30 01:44:21 UTC
Upgrading from Leap 15.2 to 15.3 via "zypper dup" showed this error message:
(1989/5706) Installing: iputils-s20161105-8.3.1.x86_64 ....[done]
Additional rpm output:
setting /usr/bin/ping to root:root 0755 "= cap_net_raw+ep". (wrong missing capabilities)
Comment 1 Ulrich Windl 2021-12-30 01:45:37 UTC
Similar:
(2137/5706) Installing: gstreamer-1.16.3-3.3.1.x86_64 ....[done]
Additional rpm output:
setting /usr/lib/gstreamer-1.0/gst-ptp-helper to root:root 0755 "= cap_net_bind_service+ep". (wrong missing capabilities)
Comment 2 Ulrich Windl 2022-01-05 11:47:39 UTC
Reading it again, it may seem that what I thought is an error message ("wrong missing capabilities") actually is a success message ("added missing capability").
Am I right?
Comment 3 Petr Gajdos 2022-01-10 11:29:37 UTC
Reassigning to openSUSE maintainers of package iputils.
Comment 4 Petr Gajdos 2022-01-10 11:30:47 UTC
Marcus, Petr, could you please help us? In case that not, do not hesitate to reassign back.

Thanks for consideration
Comment 5 Petr Gajdos 2022-01-10 11:39:00 UTC
Also adding gnome-bugs@suse.de for gstreamer.
Comment 7 Petr Vorel 2022-01-10 22:50:52 UTC
Can you use pin
Comment 8 Petr Vorel 2022-01-10 22:53:49 UTC
Can you actually use ping as user? 

$ ping -c1 ::1; echo $?
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.057 ms

--- ::1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.057/0.057/0.057/0.000 ms
0

Also, due #1174504 you should not need any capability:
$ getcap `which ping` # nothing
Comment 9 Ulrich Windl 2022-01-17 19:26:23 UTC
(In reply to Petr Vorel from comment #8)
> Can you actually use ping as user? 

Yes, I can.

> Also, due #1174504 you should not need any capability:
> $ getcap `which ping` # nothing

I don't have a "getcap" utility here:
 which getcap
which: no getcap in (/home/windl/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin)
Comment 10 Petr Vorel 2022-01-17 21:49:09 UTC
(In reply to Ulrich Windl from comment #9)
> I don't have a "getcap" utility here:
>  which getcap
> which: no getcap in
> (/home/windl/bin:/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/sbin)

Please install libcap-progs.
Comment 11 Petr Gajdos 2022-01-18 09:56:13 UTC
Thank you Petr you are looking into, much appreciated.
Comment 12 Petr Vorel 2022-01-18 12:45:41 UTC
Well, I do understand of iputils background (I'm an upstream maintainer).

But I'm not really the expert on openSUSE packaging and upgrading (I use Tumbleweed myself), thus I'm not sure how I can help.

Although version in Tumbleweed does not require CAP_NET_RAW since last year
(https://build.opensuse.org/request/show/840044 and #1174504), Leap 15.3 inherits quite old version s20161105, where we still used CAP_NET_RAW instead of ICMP_PROTO (although ICMP_PROTO is supported by kernel thus it could be used).

But I guess this error is due using cap_net_raw+ep instead of just cap_net_raw+p.
See related bug #1140993 and change in Tumbleweed in "Fri Jul 26 06:19:44 UTC 2019":

- With new permissions package both clockdiff and ping have capabilities
  cap_net_raw+p instead of cap_net_raw+ep (boo#1140993), also ping6 does not
  try to set permissions on links (boo#1140991)
Comment 13 Petr Gajdos 2022-01-18 13:06:17 UTC
Thanks, Petr.

15.3 inherites the version from SUSE:SLE-15:Update. I can certainly help with packaging, however I am not completely sure what are you exactly proposing to do. 

Do you think we should update iputils in 15.3 update channel? Isn't that too risky? In case it is easy, perhaps we could consider to update it in 15sp4?

Or other way around?
Comment 14 Petr Vorel 2022-01-18 14:07:13 UTC
First, after confirming with Matthias Gerstner the "wrong missing capabilities" message is not a bug, just info. Thus closing bug as invalid.

He also suggested to backport just to 15.4. I suppose updating SLE 15.4 (with changes from #1140993 and #1140991 if not already merged) should work, Leap should then get the fix from update.
Comment 17 Petr Gajdos 2022-01-18 20:23:18 UTC
(In reply to Petr Vorel from comment #14)
> First, after confirming with Matthias Gerstner the "wrong missing
> capabilities" message is not a bug, just info. Thus closing bug as invalid.
> 
> He also suggested to backport just to 15.4. I suppose updating SLE 15.4
> (with changes from #1140993 and #1140991 if not already merged) should work,
> Leap should then get the fix from update.

Thanks for suggestions, in case I should submit something somewhere, feel free to let me know.
Comment 18 Ulrich Windl 2022-01-19 07:12:49 UTC
(In reply to Petr Vorel from comment #14)
> First, after confirming with Matthias Gerstner the "wrong missing
> capabilities" message is not a bug, just info. Thus closing bug as invalid.

I had suspected that already in comment #2. However the phrase "wrong missing ..." sounds much more like an error rather than a warning message.
Maybe re-phrase the message into something like "added missing capability/capabilities ...".
Comment 19 Petr Gajdos 2022-01-19 08:16:51 UTC
(In reply to Ulrich Windl from comment #18)
> (In reply to Petr Vorel from comment #14)
> > First, after confirming with Matthias Gerstner the "wrong missing
> > capabilities" message is not a bug, just info. Thus closing bug as invalid.
> 
> I had suspected that already in comment #2. However the phrase "wrong
> missing ..." sounds much more like an error rather than a warning message.
> Maybe re-phrase the message into something like "added missing
> capability/capabilities ...".

For what it's worth, this came from permissions-20181225/chkstat.c, in Tumbleweed it is */src/chkstat.cpp with quite a lot of rewritten code.
Comment 20 Matthias Gerstner 2022-01-19 09:10:43 UTC
(In reply to pgajdos@suse.com from comment #19)
> (In reply to Ulrich Windl from comment #18)
> > (In reply to Petr Vorel from comment #14)
> > > First, after confirming with Matthias Gerstner the "wrong missing
> > > capabilities" message is not a bug, just info. Thus closing bug as invalid.
> > 
> > I had suspected that already in comment #2. However the phrase "wrong
> > missing ..." sounds much more like an error rather than a warning message.
> > Maybe re-phrase the message into something like "added missing
> > capability/capabilities ...".
> 
> For what it's worth, this came from permissions-20181225/chkstat.c, in Tumbleweed it is */src/chkstat.cpp with quite a lot of rewritten code.

I agree that the wording is not ideal. The situation with this chkstat tool is
pretty complex, though. It is not only used during package installations but
also possibly interactively (e.g. `chkstat --system`) to restore or change
current permissions. The context in which it is executed is not clear to
chkstat.

See also here [1] for more information. There exist different profiles for
different security flavors.

[1]: https://en.opensuse.org/openSUSE:Security_Documentation#Available_Profiles

I will create an issue in our permissions project to track the problematic
wording, maybe we can still improve upon that.