Skip to content

Commit f9793e3

Browse files
committed
Merge tag 'pci-v4.3-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fix from Bjorn Helgaas: "Sorry for this last-minute update; it's been in -next for quite a while, but I forgot about it until I started getting ready for the merge window. It's small and fixes a way a user could cause a panic via sysfs, so I think it's worth getting it in v4.3. NUMA: - Prevent out of bounds access in sysfs numa_node override (Sasha Levin)" * tag 'pci-v4.3-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Prevent out of bounds access in numa_node override
2 parents 9b971e7 + 1266963 commit f9793e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/pci-sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static ssize_t numa_node_store(struct device *dev,
216216
if (ret)
217217
return ret;
218218

219-
if (!node_online(node))
219+
if (node >= MAX_NUMNODES || !node_online(node))
220220
return -EINVAL;
221221

222222
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);

0 commit comments

Comments
 (0)