]> git.baikalelectronics.ru Git - kernel.git/commit
nfc: fix refcount leak in llcp_sock_bind()
authorXiaoming Ni <nixiaoming@huawei.com>
Thu, 25 Mar 2021 03:51:10 +0000 (11:51 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Mar 2021 00:02:01 +0000 (17:02 -0700)
commit72083265abc3f73ceb04eaf3a8519303d72f3d51
tree763ad4e04bee68f42c9402f163ddddffac129d8c
parent903061f737bcd421a279b69f4a40dca587918f6e
nfc: fix refcount leak in llcp_sock_bind()

nfc_llcp_local_get() is invoked in llcp_sock_bind(),
but nfc_llcp_local_put() is not invoked in subsequent failure branches.
As a result, refcount leakage occurs.
To fix it, add calling nfc_llcp_local_put().

fix CVE-2020-25670
Fixes: d74234add0aa ("NFC: Take a reference on the LLCP local pointer when creating a socket")
Reported-by: "kiyin(尹亮)" <kiyin@tencent.com>
Link: https://www.openwall.com/lists/oss-security/2020/11/01/1
Cc: <stable@vger.kernel.org> #v3.6
Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/nfc/llcp_sock.c