OSDN Git Service

NFC: add necessary privilege flags in netlink layer
authorLin Ma <linma@zju.edu.cn>
Tue, 2 Nov 2021 08:10:21 +0000 (16:10 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Nov 2021 11:15:18 +0000 (11:15 +0000)
commitaedddb4e45b34426cfbfa84454b6f203712733c5
treeb35ad72b1b616ee4890c0ea63f54b8312563baf2
parent2bd080b0961d776f90e7b1ef9788c56da3638c73
NFC: add necessary privilege flags in netlink layer

The CAP_NET_ADMIN checks are needed to prevent attackers faking a
device under NCIUARTSETDRIVER and exploit privileged commands.

This patch add GENL_ADMIN_PERM flags in genl_ops to fulfill the check.
Except for commands like NFC_CMD_GET_DEVICE, NFC_CMD_GET_TARGET,
NFC_CMD_LLC_GET_PARAMS, and NFC_CMD_GET_SE, which are mainly information-
read operations.

Signed-off-by: Lin Ma <linma@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/nfc/netlink.c