]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
NFC: llcp: Limit size of SDP URI
authorKees Cook <keescook@chromium.org>
Wed, 14 Feb 2018 23:45:07 +0000 (15:45 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commit3767558d99e99f7440eb0388e5d428ddb80054f9
treeeb6f9b1b393fef469584537c7715bfd156f262fa
parentf8d5df8899c4624a32ce33ea6df055538dbdc6d3
NFC: llcp: Limit size of SDP URI

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit fe9c842695e26d8116b61b80bfb905356f07834b ]

The tlv_len is u8, so we need to limit the size of the SDP URI. Enforce
this both in the NLA policy and in the code that performs the allocation
and copy, to avoid writing past the end of the allocated buffer.

Fixes: d9b8d8e19b073 ("NFC: llcp: Service Name Lookup netlink interface")
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/nfc/llcp_commands.c
net/nfc/netlink.c