aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-12-23 16:01:35 -0800
committerDavid S. Miller <davem@davemloft.net>2018-12-23 16:01:35 -0800
commitf2ab95814103314af3239d322e382c61c69a788d (patch)
tree31237d0953b926070b862c93f19247536dba3b29 /net
parentcan: af_can: Fix Spectre v1 vulnerability (diff)
downloadwireguard-linux-f2ab95814103314af3239d322e382c61c69a788d.tar.xz
wireguard-linux-f2ab95814103314af3239d322e382c61c69a788d.zip
net: Revert recent Spectre-v1 patches.
This reverts: 50d5258634ae ("net: core: Fix Spectre v1 vulnerability") d686026b1e6e ("phonet: af_phonet: Fix Spectre v1 vulnerability") a95386f0390a ("nfc: af_nfc: Fix Spectre v1 vulnerability") a3ac5817ffe8 ("can: af_can: Fix Spectre v1 vulnerability") After some discussion with Alexei Starovoitov these all seem to be completely unnecessary. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/can/af_can.c2
-rw-r--r--net/core/filter.c2
-rw-r--r--net/nfc/af_nfc.c2
-rw-r--r--net/phonet/af_phonet.c3
4 files changed, 0 insertions, 9 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c
index cade7250c6d4..1684ba5b51eb 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -59,7 +59,6 @@
#include <linux/can/core.h>
#include <linux/can/skb.h>
#include <linux/ratelimit.h>
-#include <linux/nospec.h>
#include <net/net_namespace.h>
#include <net/sock.h>
@@ -137,7 +136,6 @@ static int can_create(struct net *net, struct socket *sock, int protocol,
if (protocol < 0 || protocol >= CAN_NPROTO)
return -EINVAL;
- protocol = array_index_nospec(protocol, CAN_NPROTO);
cp = can_get_proto(protocol);
diff --git a/net/core/filter.c b/net/core/filter.c
index 0c74c2f9776a..8d2c629501e2 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -73,7 +73,6 @@
#include <linux/seg6_local.h>
#include <net/seg6.h>
#include <net/seg6_local.h>
-#include <linux/nospec.h>
/**
* sk_filter_trim_cap - run a packet through a socket filter
@@ -1039,7 +1038,6 @@ static int bpf_check_classic(const struct sock_filter *filter,
bool anc_found;
int pc;
- flen = array_index_nospec(flen, BPF_MAXINSNS + 1);
/* Check the filter code now */
for (pc = 0; pc < flen; pc++) {
const struct sock_filter *ftest = &filter[pc];
diff --git a/net/nfc/af_nfc.c b/net/nfc/af_nfc.c
index 256f3c57059e..d3e594eb36d0 100644
--- a/net/nfc/af_nfc.c
+++ b/net/nfc/af_nfc.c
@@ -21,7 +21,6 @@
#include <linux/nfc.h>
#include <linux/module.h>
-#include <linux/nospec.h>
#include "nfc.h"
@@ -38,7 +37,6 @@ static int nfc_sock_create(struct net *net, struct socket *sock, int proto,
if (proto < 0 || proto >= NFC_SOCKPROTO_MAX)
return -EINVAL;
- proto = array_index_nospec(proto, NFC_SOCKPROTO_MAX);
read_lock(&proto_tab_lock);
if (proto_tab[proto] && try_module_get(proto_tab[proto]->owner)) {
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index d4b2abd78858..3b0ef691f5b1 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -34,8 +34,6 @@
#include <net/phonet/phonet.h>
#include <net/phonet/pn_dev.h>
-#include <linux/nospec.h>
-
/* Transport protocol registration */
static const struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
@@ -45,7 +43,6 @@ static const struct phonet_protocol *phonet_proto_get(unsigned int protocol)
if (protocol >= PHONET_NPROTO)
return NULL;
- protocol = array_index_nospec(protocol, PHONET_NPROTO);
rcu_read_lock();
pp = rcu_dereference(proto_tab[protocol]);