|
@@ -63,6 +63,7 @@
|
|
#include <linux/hash.h>
|
|
#include <linux/hash.h>
|
|
#include <linux/genetlink.h>
|
|
#include <linux/genetlink.h>
|
|
#include <linux/net_namespace.h>
|
|
#include <linux/net_namespace.h>
|
|
|
|
+#include <linux/nospec.h>
|
|
|
|
|
|
#include <net/net_namespace.h>
|
|
#include <net/net_namespace.h>
|
|
#include <net/netns/generic.h>
|
|
#include <net/netns/generic.h>
|
|
@@ -679,6 +680,7 @@ static int netlink_create(struct net *net, struct socket *sock, int protocol,
|
|
|
|
|
|
if (protocol < 0 || protocol >= MAX_LINKS)
|
|
if (protocol < 0 || protocol >= MAX_LINKS)
|
|
return -EPROTONOSUPPORT;
|
|
return -EPROTONOSUPPORT;
|
|
|
|
+ protocol = array_index_nospec(protocol, MAX_LINKS);
|
|
|
|
|
|
netlink_lock_table();
|
|
netlink_lock_table();
|
|
#ifdef CONFIG_MODULES
|
|
#ifdef CONFIG_MODULES
|