nfc: add missing attribute validation for vendor subcommand
authorJakub Kicinski <kuba@kernel.org>
Tue, 3 Mar 2020 05:05:26 +0000 (21:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 09:54:12 +0000 (10:54 +0100)
[ Upstream commit 6ba3da446551f2150fadbf8c7788edcb977683d3 ]

Add missing attribute validation for vendor subcommand attributes
to the netlink policy.

Fixes: 9e58095f9660 ("NFC: netlink: Implement vendor command support")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/nfc/netlink.c

index 587aea4ae8c09d0f0e6b55bbf1d9def0447613de..6199f4334fbd271c26726a482cc0bca74ebd9192 100644 (file)
@@ -57,6 +57,8 @@ static const struct nla_policy nfc_genl_policy[NFC_ATTR_MAX + 1] = {
                                     .len = NFC_FIRMWARE_NAME_MAXSIZE },
        [NFC_ATTR_SE_INDEX] = { .type = NLA_U32 },
        [NFC_ATTR_SE_APDU] = { .type = NLA_BINARY },
+       [NFC_ATTR_VENDOR_ID] = { .type = NLA_U32 },
+       [NFC_ATTR_VENDOR_SUBCMD] = { .type = NLA_U32 },
        [NFC_ATTR_VENDOR_DATA] = { .type = NLA_BINARY },
 
 };