]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: Ensure presence of NFC_ATTR_FIRMWARE_NAME attribute in nfc_genl_fw_download()
authorDefang Bo <bodefang@126.com>
Mon, 19 Oct 2020 11:38:58 +0000 (19:38 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 Oct 2020 00:06:22 +0000 (17:06 -0700)
commitbe4087ce21cf34ceb92a738a9e84f395b76b9c32
treeeff2e1c1f6e5dead99c938c2b9d92485b569e705
parentac2136ecec593dcd41c4838e4be5c7f912b9cea2
nfc: Ensure presence of NFC_ATTR_FIRMWARE_NAME attribute in nfc_genl_fw_download()

Check that the NFC_ATTR_FIRMWARE_NAME attributes are provided by
the netlink client prior to accessing them.This prevents potential
unhandled NULL pointer dereference exceptions which can be triggered
by malicious user-mode programs, if they omit one or both of these
attributes.

Similar to commit bcebd9470998 ("nfc: Ensure presence of required attributes in the activate_target handler").

Fixes: 11314404620e ("NFC: Add firmware upload netlink command")
Signed-off-by: Defang Bo <bodefang@126.com>
Link: https://lore.kernel.org/r/1603107538-4744-1-git-send-email-bodefang@126.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/nfc/netlink.c