Commit f2ab9581 authored by David S. Miller's avatar David S. Miller

net: Revert recent Spectre-v1 patches.

This reverts:

50d52586 ("net: core: Fix Spectre v1 vulnerability")
d686026b ("phonet: af_phonet: Fix Spectre v1 vulnerability")
a95386f0 ("nfc: af_nfc: Fix Spectre v1 vulnerability")
a3ac5817 ("can: af_can: Fix Spectre v1 vulnerability")

After some discussion with Alexei Starovoitov these all seem to
be completely unnecessary.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a3ac5817
......@@ -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);
......
......@@ -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];
......
......@@ -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)) {
......
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment