aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-04-06 19:46:34 +0000
committerJakub Kicinski <kuba@kernel.org>2023-04-07 20:07:07 -0700
commit48b7ea1d22ddf657e2692fb2b399138a02d31c17 (patch)
tree24b070b322b98c4c2958258a4bb8329b180656c0 /net/core/sock.c
parent039a692ad93e5d2f7327a26ba19cf37b1d763788 (diff)
downloadlinux-48b7ea1d22ddf657e2692fb2b399138a02d31c17.tar.gz
net: make SO_BUSY_POLL available to all users
After commit 217f69743681 ("net: busy-poll: allow preemption in sk_busy_loop()"), a thread willing to use busy polling is not hurting other threads anymore in a non preempt kernel. I think it is safe to remove CAP_NET_ADMIN check. Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/20230406194634.1804691-1-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index c258887953905c..5440e67bcfe3b0 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1396,15 +1396,10 @@ set_sndbuf:
#ifdef CONFIG_NET_RX_BUSY_POLL
case SO_BUSY_POLL:
- /* allow unprivileged users to decrease the value */
- if ((val > sk->sk_ll_usec) && !sockopt_capable(CAP_NET_ADMIN))
- ret = -EPERM;
- else {
- if (val < 0)
- ret = -EINVAL;
- else
- WRITE_ONCE(sk->sk_ll_usec, val);
- }
+ if (val < 0)
+ ret = -EINVAL;
+ else
+ WRITE_ONCE(sk->sk_ll_usec, val);
break;
case SO_PREFER_BUSY_POLL:
if (valbool && !sockopt_capable(CAP_NET_ADMIN))