]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/pci/pci-sysfs.c
PCI: Prevent out of bounds access in numa_node override
[karo-tx-linux.git] / drivers / pci / pci-sysfs.c
index 312f23a8429cd9331b45afaf72a278e84bd41d83..92618686604cb9d314aa1e6bf833363cfbaaa1b5 100644 (file)
@@ -216,7 +216,7 @@ static ssize_t numa_node_store(struct device *dev,
        if (ret)
                return ret;
 
-       if (!node_online(node))
+       if (node >= MAX_NUMNODES || !node_online(node))
                return -EINVAL;
 
        add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);