Revert "net: core: Handle 'sk' being NULL in UID-based routing"
authorAmit Pundir <amit.pundir@linaro.org>
Mon, 2 Jan 2017 08:34:56 +0000 (14:04 +0530)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 2 Jan 2017 08:35:11 +0000 (14:05 +0530)
This reverts commit ad493510385ee040516bf83a60e6c4921fcdfdac.

Bug: 16355602
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
include/net/route.h
net/ipv4/route.c

index d016a8cb45cfb14684bbec4b04702592d65c72e9..bf6fe1a6527e0e074630a8773aa12b6c5c8bdc6d 100644 (file)
@@ -154,8 +154,7 @@ static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi
        flowi4_init_output(fl4, oif, sk ? sk->sk_mark : 0, tos,
                           RT_SCOPE_UNIVERSE, proto,
                           sk ? inet_sk_flowi_flags(sk) : 0,
-                          daddr, saddr, dport, sport,
-                          sk ? sock_i_uid(sk) : GLOBAL_ROOT_UID);
+                          daddr, saddr, dport, sport, sock_i_uid(sk));
        if (sk)
                security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
        return ip_route_output_flow(net, fl4, sk);
index f75b5658a3a0534d26d882db1fd86fff26d62070..de51d32d6af80de828d1a8f8dc5006a2c4b8ad49 100644 (file)
@@ -518,7 +518,7 @@ static void __build_flow_key(struct flowi4 *fl4, struct sock *sk,
                           RT_SCOPE_UNIVERSE, prot,
                           flow_flags,
                           iph->daddr, iph->saddr, 0, 0,
-                          sk ? sock_i_uid(sk) : GLOBAL_ROOT_UID);
+                          sock_i_uid(sk));
 }
 
 static void build_skb_flow_key(struct flowi4 *fl4, const struct sk_buff *skb,