From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Herbert Xu <herbert@gondor.apana.org.au>,
Daniel Borkmann <dborkman@redhat.com>,
Thomas Graf <tgraf@suug.ch>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.18 11/19] netlink: use jhash as hashfn for rhashtable
Date: Sun, 14 Dec 2014 12:21:22 -0800 [thread overview]
Message-ID: <20141214201823.865902905@linuxfoundation.org> (raw)
In-Reply-To: <20141214201823.543296369@linuxfoundation.org>
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <dborkman@redhat.com>
[ Upstream commit 7f19fc5e0b617593dcda0d9956adc78b559ef1f5 ]
For netlink, we shouldn't be using arch_fast_hash() as a hashing
discipline, but rather jhash() instead.
Since netlink sockets can be opened by any user, a local attacker
would be able to easily create collisions with the DPDK-derived
arch_fast_hash(), which trades off performance for security by
using crc32 CPU instructions on x86_64.
While it might have a legimite use case in other places, it should
be avoided in netlink context, though. As rhashtable's API is very
flexible, we could later on still decide on other hashing disciplines,
if legitimate.
Reference: http://thread.gmane.org/gmane.linux.kernel/1844123
Fixes: e341694e3eb5 ("netlink: Convert netlink_lookup() to use RCU protected hash table")
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/netlink/af_netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -3130,7 +3130,7 @@ static int __init netlink_proto_init(voi
.head_offset = offsetof(struct netlink_sock, node),
.key_offset = offsetof(struct netlink_sock, portid),
.key_len = sizeof(u32), /* portid */
- .hashfn = arch_fast_hash,
+ .hashfn = jhash,
.max_shift = 16, /* 64K */
.grow_decision = rht_grow_above_75,
.shrink_decision = rht_shrink_below_30,
next prev parent reply other threads:[~2014-12-14 20:21 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-14 20:21 [PATCH 3.18 00/19] 3.18.1-stable review Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 01/19] Fix race condition between vxlan_sock_add and vxlan_sock_release Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 02/19] gre: Set inner mac header in gro complete Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 03/19] openvswitch: Fix flow mask validation Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 04/19] mips: bpf: Fix broken BPF_MOD Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 05/19] net: mvneta: fix Tx interrupt delay Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 06/19] net: mvneta: fix race condition in mvneta_tx() Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 08/19] tcp: fix more NULL deref after prequeue changes Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 09/19] xen-netfront: use correct linear area after linearizing an skb Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 10/19] net: fix suspicious rcu_dereference_check in net/sched/sch_fq_codel.c Greg Kroah-Hartman
2014-12-14 20:21 ` Greg Kroah-Hartman [this message]
2014-12-14 20:21 ` [PATCH 3.18 12/19] rtlwifi: rtl8192ce: Fix editing error that causes silent memory corruption Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 13/19] rtlwifi: rtl8192ce: Fix kernel crashes due to missing callback entry Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 14/19] rtlwifi: rtl8192ce: Fix missing interrupt ready flag Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 15/19] move d_rcu from overlapping d_child to overlapping d_alias Greg Kroah-Hartman
2014-12-15 15:46 ` Josh Boyer
2014-12-15 16:34 ` Greg Kroah-Hartman
2014-12-15 16:38 ` Josh Boyer
2014-12-15 21:21 ` Josh Boyer
2014-12-15 21:34 ` Al Viro
2014-12-15 21:44 ` Josh Boyer
2014-12-16 13:25 ` Josh Boyer
2014-12-15 21:33 ` Al Viro
2014-12-14 20:21 ` [PATCH 3.18 16/19] deal with deadlock in d_walk() Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 17/19] ALSA: hda - Add EAPD fixup for ASUS Z99He laptop Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 18/19] ALSA: hda - Fix built-in mic at resume on Lenovo Ideapad S210 Greg Kroah-Hartman
2014-12-14 20:21 ` [PATCH 3.18 19/19] ALSA: usb-audio: Dont resubmit pending URBs at MIDI error recovery Greg Kroah-Hartman
2014-12-15 3:33 ` [PATCH 3.18 00/19] 3.18.1-stable review Guenter Roeck
2014-12-15 4:24 ` Greg Kroah-Hartman
2014-12-16 3:08 ` Shuah Khan
2014-12-16 16:12 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141214201823.865902905@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=hannes@stressinduktion.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tgraf@suug.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).