Skip to content
Commit 95e83e21 authored by Krzysztof Wilczyński's avatar Krzysztof Wilczyński Committed by Bjorn Helgaas
Browse files

PCI/sysfs: Check CAP_SYS_ADMIN before parsing user input

Check if the "CAP_SYS_ADMIN" capability flag is set before parsing user
input as it makes more sense to first check whether the current user
actually has the right permissions before accepting any input from such
user.

This will also make order in which enable_store() and msi_bus_store()
perform the "CAP_SYS_ADMIN" capability check consistent with other
PCI-related sysfs objects that first verify whether user has this
capability set.

Link: https://lore.kernel.org/r/20210915230127.2495723-1-kw@linux.com


Signed-off-by: default avatarKrzysztof Wilczyński <kw@linux.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent e4e737bb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment