android_kernel_oneplus_msm8998/net/ipv6
Lorenzo Colitti a8e959ae30 net: inet: Support UID-based routing in IP protocols.
- Use the UID in routing lookups made by protocol connect() and
  sendmsg() functions.
- Make sure that routing lookups triggered by incoming packets
  (e.g., Path MTU discovery) take the UID of the socket into
  account.
- For packets not associated with a userspace socket, (e.g., ping
  replies) use UID 0 inside the user namespace corresponding to
  the network namespace the socket belongs to. This allows
  all namespaces to apply routing and iptables rules to
  kernel-originated traffic in that namespaces by matching UID 0.
  This is better than using the UID of the kernel socket that is
  sending the traffic, because the UID of kernel sockets created
  at namespace creation time (e.g., the per-processor ICMP and
  TCP sockets) is the UID of the user that created the socket,
  which might not be mapped in the namespace.

Bug: 16355602
Change-Id: I910504b508948057912bc188fd1e8aca28294de3
Tested: compiles allnoconfig, allyesconfig, allmodconfig
Tested: https://android-review.googlesource.com/253302
Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

[AmitP: A little bit of refactoring because of LTS cherry-pick commit
        e5abc10d19 ("tcp: fix NULL deref in tcp_v4_send_ack()")
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2017-01-02 14:44:15 +05:30
..
netfilter netfilter: x_tables: introduce and use xt_copy_counters_from_user 2016-06-24 10:18:24 -07:00
addrconf.c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2016-11-15 18:33:34 +05:30
addrconf_core.c ipv6: change ipv6_stub_impl.ipv6_dst_lookup to take net argument 2015-07-31 15:21:30 -07:00
addrlabel.c ipv6/addrlabel: fix ip6addrlbl_get() 2015-12-22 15:57:54 -05:00
af_inet6.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
ah6.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
anycast.c ipv6: coding style: comparison for equality with NULL 2015-03-31 13:51:54 -04:00
datagram.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
esp6.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
exthdrs.c ipv6: add complete rcu protection around np->opt 2015-12-02 23:37:16 -05:00
exthdrs_core.c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2016-04-21 14:08:44 +08:00
exthdrs_offload.c ipv6: fix exthdrs offload registration in out_rt path 2015-09-02 15:31:00 -07:00
fib6_rules.c ipv6: fix the incorrect return value of throw route 2015-10-23 02:38:18 -07:00
icmp.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
ila.c dst: Pass net into dst->output 2015-10-08 04:27:03 -07:00
inet6_connection_sock.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
inet6_hashtables.c net: SO_INCOMING_CPU setsockopt() support 2015-10-12 19:28:20 -07:00
ip6_checksum.c udp: Generic functions to set checksum 2014-06-04 22:46:38 -07:00
ip6_fib.c ipv6: Fix mem leak in rt6i_pcpu 2016-07-27 09:47:31 -07:00
ip6_flowlabel.c ipv6: fix a lockdep splat 2016-03-03 15:07:05 -08:00
ip6_gre.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
ip6_icmp.c ipv6: White-space cleansing : Line Layouts 2014-08-24 22:37:52 -07:00
ip6_input.c netfilter: Pass net into okfn 2015-09-17 17:18:37 -07:00
ip6_offload.c net: add recursion limit to GRO 2016-11-15 07:46:38 +01:00
ip6_offload.h
ip6_output.c ipv6: Skip XFRM lookup if dst_entry in socket cache is valid 2016-06-24 10:18:17 -07:00
ip6_tunnel.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
ip6_udp_tunnel.c vxlan: do not receive IPv4 packets on IPv6 socket 2015-08-29 13:07:54 -07:00
ip6_vti.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
ip6mr.c ipmr, ip6mr: fix scheduling while atomic and a deadlock with ipmr_get_route 2016-11-15 07:46:37 +01:00
ipcomp6.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
ipv6_sockglue.c ipv6: add complete rcu protection around np->opt 2015-12-02 23:37:16 -05:00
Kconfig net: Identifier Locator Addressing module 2015-08-17 21:33:06 -07:00
Makefile net: Identifier Locator Addressing module 2015-08-17 21:33:06 -07:00
mcast.c mld, igmp: Fix reserved tailroom calculation 2016-04-20 15:41:58 +09:00
mcast_snoop.c net: fix wrong skb_get() usage / crash in IGMP/MLD parsing code 2015-08-13 17:08:39 -07:00
mip6.c ipv6: use ktime_t for internal timestamps 2015-10-05 03:16:47 -07:00
ndisc.c ipv6: honor ifindex in case we receive ll addresses in router advertisements 2015-12-23 22:03:54 -05:00
netfilter.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
output_core.c ipv6: Set skb->protocol properly for local output 2016-12-10 19:07:26 +01:00
ping.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
proc.c udp: Increment UDP_MIB_IGNOREDMULTI for arriving unmatched multicasts 2014-11-07 15:45:50 -05:00
protocol.c net: Export inet_offloads and inet6_offloads 2014-09-19 17:15:31 -04:00
raw.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
reassembly.c net: use skb_postpush_rcsum instead of own implementations 2016-05-18 17:06:36 -07:00
route.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
sit.c tunnels: Remove encapsulation offloads on decap. 2016-10-31 04:13:59 -06:00
syncookies.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
sysctl_net_ipv6.c ipv6: Implement different admin modes for automatic flow labels 2015-07-31 17:07:11 -07:00
tcp_ipv6.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
tcpv6_offload.c tcp: cleanup static functions 2015-02-28 16:56:51 -05:00
tunnel6.c ipv6: fix tunnel error handling 2015-11-03 10:52:13 -05:00
udp.c net: inet: Support UID-based routing in IP protocols. 2017-01-02 14:44:15 +05:30
udp_impl.h net: Remove iocb argument from sendmsg and recvmsg 2015-03-02 13:06:31 -05:00
udp_offload.c ipv6: hash net ptr into fragmentation bucket selection 2015-03-25 14:07:04 -04:00
udplite.c net: Eliminate no_check from protosw 2014-05-23 16:28:53 -04:00
xfrm6_input.c netfilter: Pass struct net into the netfilter hooks 2015-09-17 17:18:37 -07:00
xfrm6_mode_beet.c xfrm: simplify xfrm_address_t use 2015-03-31 13:58:35 -04:00
xfrm6_mode_ro.c ipv4/ipv6: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c ipv6: update skb->csum when CE mark is propagated 2016-01-31 11:29:01 -08:00
xfrm6_output.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-24 06:54:12 -07:00
xfrm6_policy.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec 2015-12-22 16:26:31 -05:00
xfrm6_protocol.c xfrm6: Properly handle unsupported protocols 2014-05-06 07:08:38 +02:00
xfrm6_state.c ipv6: White-space cleansing : Line Layouts 2014-08-24 22:37:52 -07:00
xfrm6_tunnel.c ipv6: White-space cleansing : gaps between function and symbol export 2014-08-24 22:37:52 -07:00