linux/net
Eric Dumazet 188da790e1 netns: provide pure entropy for net_hash_mix()
commit 355b985537 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>
History 2019-07-09 22:04:22 +01:00
..
9p 9p/net: fix memory leak in p9_client_create 2019-04-04 16:14:06 +01:00
802 neigh: use NEIGH_VAR_INIT in ndo_neigh_setup functions. 2014-01-16 11:31:58 -08:00
8021q 8021q: fix a memory leak for VLAN 0 device 2018-03-03 15:52:21 +00:00
appletalk appletalk: Fix socket referencing in skb 2014-07-08 19:39:43 -07:00
atm net: atm: Fix potential Spectre v1 2018-10-21 08:45:54 +01:00
ax25 Revert "ax25: add link layer header validation function" 2016-06-15 21:29:20 +01:00
batman-adv batman-adv: fix uninit-value in batadv_interface_tx() 2019-05-02 21:41:52 +01:00
bluetooth Bluetooth: hidp: fix buffer overflow 2019-06-20 18:11:27 +01:00
bridge net: bridge: Fix ethernet header pointer before check skb forwardable 2019-05-02 21:41:25 +01:00
caif net: caif: Add a missing rcu_read_unlock() in caif_flow_cb 2018-11-20 18:05:46 +00:00
can can: bcm: check timer values before ktime conversion 2019-05-02 21:41:27 +01:00
ceph libceph: validate con->state at the top of try_write() 2018-10-21 08:45:46 +01:00
core netns: provide pure entropy for net_hash_mix() 2019-07-09 22:04:22 +01:00
dcb net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-04-24 13:44:54 -04:00
dccp dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart() 2018-11-20 18:05:55 +00:00
decnet dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock 2018-06-16 22:22:18 +01:00
dns_resolver KEYS: DNS: fix parsing multiple options 2018-11-20 18:05:43 +00:00
dsa net: dsa: slave: Don't propagate flag changes on down slave interfaces 2019-05-02 21:41:39 +01:00
ethernet net: eth_type_trans() should use skb_header_pointer() 2014-01-16 15:30:31 -08:00
hsr net/hsr: fix possible crash in add_timer() 2019-07-09 22:04:13 +01:00
ieee802154 net: 6lowpan: fix reserved space for single frames 2018-12-16 22:08:35 +00:00
ipv4 tcp: refine memory limit test in tcp_fragment() 2019-07-09 22:04:18 +01:00
ipv6 ip6mr: Do not call __IP6_INC_STATS() from preemptible context 2019-07-09 22:04:11 +01:00
ipx ipx: call ipxitf_put() in ioctl error path 2017-06-05 21:17:23 +01:00
irda irda: Only insert new objects into the global database via setsockopt 2018-10-03 04:10:07 +01:00
iucv af_iucv: Move sockaddr length checks to before accessing sa_family in bind and connect handlers 2017-10-12 15:27:52 +01:00
key af_key: fix buffer overread in parse_exthdrs() 2018-03-03 15:52:08 +00:00
l2tp l2tp: fix infoleak in l2tp_ip6_recvmsg() 2019-07-09 22:04:18 +01:00
lapb net/lapb: re-send packets on timeout 2013-09-23 16:52:45 -04:00
llc llc: do not use sk_eat_skb() 2019-02-11 17:53:39 +00:00
mac80211 mac80211: ensure that mgmt tx skbs have tailroom for encryption 2019-05-02 21:41:33 +01:00
mac802154 net: mac802154: tx: expand tailroom if necessary 2018-12-16 22:08:36 +00:00
mpls net: gso: use feature flag argument in all protocol gso handlers 2015-08-27 14:27:14 +01:00
netfilter netfilter: nf_tables: fix flush after rule deletion in the same batch 2019-05-02 21:41:55 +01:00
netlabel cipso: don't use IPCB() to locate the CIPSO IP option 2019-02-11 17:53:21 +00:00
netlink netlink: Don't shift on 64 for ngroups 2018-11-20 18:05:54 +00:00
netrom net: Fix use after free by removing length arg from sk_data_ready callbacks. 2014-04-11 16:15:36 -04:00
nfc net: nfc: Fix NULL dereference on nfc_llcp_build_tlv fails 2019-05-02 21:42:00 +01:00
openvswitch ovs: do not allocate memory from offline numa node 2015-10-28 10:33:20 +00:00
packet net/packet: Set __GFP_NOWARN upon allocation in alloc_pg_vec 2019-05-02 21:41:53 +01:00
phonet phonet: properly unshare skbs in phonet_rcv() 2016-01-28 10:51:50 +00:00
rds rds: Fix NULL pointer dereference in __rds_rdma_map 2018-03-03 15:52:35 +00:00
rfkill rfkill: gpio: fix memory leak in probe error path 2018-10-21 08:45:56 +01:00
rose rose: limit sk_filter trim to payload 2017-02-23 03:54:46 +00:00
rxrpc rxrpc: Fix several cases where a padded len isn't checked in ticket decode 2017-07-02 17:13:03 +01:00
sched net: netem: fix skb length BUG_ON in __skb_to_sgvec 2019-05-02 21:42:02 +01:00
sctp sctp: fix identification of new acks for SFR-CACC 2018-11-20 18:04:50 +00:00
sunrpc sunrpc: use SVC_NET() in svcauth_gss_* functions 2019-04-04 16:14:07 +01:00
tipc tipc: check minimum bearer MTU 2017-02-23 03:54:42 +00:00
unix net/unix: don't show information about sockets from other namespaces 2018-01-01 20:51:59 +00:00
vmw_vsock vsock: cope with memory allocation failure at socket creation time 2019-05-02 21:41:50 +01:00
wimax wimax: remove dead code 2013-11-21 13:09:42 -05:00
wireless cfg80211: reg: Init wiphy_idx in regulatory_hint_core() 2018-12-16 22:09:04 +00:00
x25 net/x25: fix a race in x25_bind() 2019-05-02 21:41:59 +01:00
xfrm xfrm: Fix bucket count reported to userspace 2019-02-11 17:53:48 +00:00
compat.c net: support compat 64-bit time in {s,g}etsockopt 2018-10-21 08:45:49 +01:00
Kconfig Merge branch 'for-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2014-04-03 13:05:42 -07:00
Makefile net: move 6lowpan compression code to separate module 2014-01-15 15:36:38 -08:00
nonet.c llseek: automatically add .llseek fop 2010-10-15 15:53:27 +02:00
socket.c net: socket: fix potential spectre v1 gadget in socketcall 2018-11-20 18:05:51 +00:00
sysctl_net.c net: Update the sysctl permissions handler to test effective uid/gid 2013-10-07 15:57:56 -04:00