Message ID | 20211123203702.193221-1-zenczykowski@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | a1b519b745489a54189e05ee934ada1b6bc595a3 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: allow CAP_NET_RAW to setsockopt SO_PRIORITY | expand |
Hello: This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <kuba@kernel.org>: On Tue, 23 Nov 2021 12:37:02 -0800 you wrote: > From: Maciej Żenczykowski <maze@google.com> > > CAP_NET_ADMIN is and should continue to be about configuring the > system as a whole, not about configuring per-socket or per-packet > parameters. > Sending and receiving raw packets is what CAP_NET_RAW is all about. > > [...] Here is the summary with links: - net: allow CAP_NET_RAW to setsockopt SO_PRIORITY https://git.kernel.org/netdev/net-next/c/a1b519b74548 You are awesome, thank you!
diff --git a/net/core/sock.c b/net/core/sock.c index 31a2b79c9b38..1e49a127adef 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1135,6 +1135,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname, case SO_PRIORITY: if ((val >= 0 && val <= 6) || + ns_capable(sock_net(sk)->user_ns, CAP_NET_RAW) || ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) sk->sk_priority = val; else