Why is CapEff all zeros in /proc/$PID/status

孤街浪徒 提交于 2019-12-06 10:06:18

A helpful person in #kernelnewbies on OFTC (irc) was kind enough to provide me with the answer.

ping sets cap_net_raw in the effective set, creates the socket, then drops cap_net_raw, as can been seen with strace:

$ strace -e socket,capset ping -c1 localhost
  capset({_LINUX_CAPABILITY_VERSION_3, 0}, {CAP_NET_RAW, CAP_NET_ADMIN|CAP_NET_RAW, 0}) = 0
  socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = 3
  capset({_LINUX_CAPABILITY_VERSION_3, 0}, {0, CAP_NET_ADMIN|CAP_NET_RAW, 0}) = 0

Once the socket is open, no more privileges are required to write to it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!