android_kernel_samsung_msm8226/net/core
Eric Dumazet 2ce486cc69 netns: provide pure entropy for net_hash_mix()
commit 355b98553789b646ed97ad801a619ff898471b92 upstream.

net_hash_mix() currently uses kernel address of a struct net,
and is used in many places that could be used to reveal this
address to a patient attacker, thus defeating KASLR, for
the typical case (initial net namespace, &init_net is
not dynamically allocated)

I believe the original implementation tried to avoid spending
too many cycles in this function, but security comes first.

Also provide entropy regardless of CONFIG_NET_NS.

Fixes: 0b4419162a ("netns: introduce the net_hash_mix "salt" for hashes")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Amit Klein <aksecurity@gmail.com>
Reported-by: Benny Pinkas <benny@pinkas.net>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
CVE-2019-10638
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
Change-Id: Iefa96bd40b5918e3e878182f9de7e978ea975fb0
2020-04-18 17:55:14 +02:00
..
Makefile net: sockev: Initial Commit 2014-07-22 14:33:44 -06:00
datagram.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
dev.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
dev_addr_lists.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
drop_monitor.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
dst.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
ethtool.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
fib_rules.c net: core: add UID to flows, rules, and routes 2019-08-08 15:08:49 +02:00
filter.c sk_run_filter: add BPF_S_ANC_SECCOMP_LD_W 2019-08-05 14:21:58 +02:00
flow.c
flow_dissector.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
gen_estimator.c
gen_stats.c
iovec.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
kmap_skb.h
link_watch.c
neighbour.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
net-sysfs.c
net-sysfs.h
net-traces.c
net_namespace.c netns: provide pure entropy for net_hash_mix() 2020-04-18 17:55:14 +02:00
netevent.c
netpoll.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
netprio_cgroup.c
pktgen.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
request_sock.c
rtnetlink.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
scm.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
secure_seq.c netfilter: ipv6: add IPv6 NAT support 2020-01-06 08:40:33 +01:00
skbuff.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
sock.c net: Set sk_prot_creator when cloning sockets to the right proto 2020-01-06 08:40:36 +01:00
sock_diag.c net: diag: Add the ability to destroy a socket. 2019-08-05 09:12:31 +02:00
sockev_nlmcast.c net: sockev: Initial Commit 2014-07-22 14:33:44 -06:00
stream.c
sysctl_net_core.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
timestamping.c
user_dma.c
utils.c net: core: add function for incremental IPv6 pseudo header checksum updates 2020-01-06 08:40:33 +01:00