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>
#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>
if (protocol < 0 || protocol >= CAN_NPROTO)
return -EINVAL;
- protocol = array_index_nospec(protocol, CAN_NPROTO);
cp = can_get_proto(protocol);
#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
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];
#include <linux/nfc.h>
#include <linux/module.h>
-#include <linux/nospec.h>
#include "nfc.h"
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)) {
#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;
if (protocol >= PHONET_NPROTO)
return NULL;
- protocol = array_index_nospec(protocol, PHONET_NPROTO);
rcu_read_lock();
pp = rcu_dereference(proto_tab[protocol]);