Skip to content

Commit

Permalink
Revert "sock: Reset dst when changing sk_mark via setsockopt"
Browse files Browse the repository at this point in the history
This reverts commit 597b389 which is
commit 5025425 upstream.

It breaks a number of runtime Android networking tests, so something is
wrong with the backport, or something else also needed to be backported
at the same time.  So I'm dropping this from the tree as regressions are
not good.

Cc: David Barmann <david.barmann@stackpath.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Nov 29, 2019
1 parent 95e55e4 commit 2a1ddc6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/core/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,12 +945,10 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
clear_bit(SOCK_PASSSEC, &sock->flags);
break;
case SO_MARK:
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN)) {
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
ret = -EPERM;
} else if (val != sk->sk_mark) {
else
sk->sk_mark = val;
sk_dst_reset(sk);
}
break;

case SO_RXQ_OVFL:
Expand Down

0 comments on commit 2a1ddc6

Please sign in to comment.