]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: Revert recent Spectre-v1 patches.
authorDavid S. Miller <davem@davemloft.net>
Mon, 24 Dec 2018 00:01:35 +0000 (16:01 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Dec 2018 00:01:35 +0000 (16:01 -0800)
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>
net/can/af_can.c
net/core/filter.c
net/nfc/af_nfc.c
net/phonet/af_phonet.c

index cade7250c6d46032ee684b723a981632e29441c2..1684ba5b51eb6c2f38a382b07e869d92d7907740 100644 (file)
@@ -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);
 
index 0c74c2f9776a33835b39307d03d4c1048be95742..8d2c629501e2df10b0b4113986cac71369863789 100644 (file)
@@ -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];
index 256f3c57059e6c4d44d88b12008667f8680e782b..d3e594eb36d0aaafebe63f439b0b5a7145657eed 100644 (file)
@@ -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)) {
index d4b2abd7885818fb07aba0c58afa4ccf93e568dc..3b0ef691f5b1ba532a19e74c910356ada9ac3b6c 100644 (file)
@@ -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]);