diff options
| author | 2021-03-25 11:51:13 +0800 | |
|---|---|---|
| committer | 2021-03-25 17:02:01 -0700 | |
| commit | 4b5db93e7f2afbdfe3b78e37879a85290187e6f1 (patch) | |
| tree | 2be8fea7f9a3038986c1d018655b23abf4e9a225 /include/linux/perf/git:/ssh:/git@git.zx2c4.com | |
| parent | nfc: fix memory leak in llcp_sock_connect() (diff) | |
| download | linux-dev-4b5db93e7f2afbdfe3b78e37879a85290187e6f1.tar.xz linux-dev-4b5db93e7f2afbdfe3b78e37879a85290187e6f1.zip | |
nfc: Avoid endless loops caused by repeated llcp_sock_connect()
When sock_wait_state() returns -EINPROGRESS, "sk->sk_state" is
LLCP_CONNECTING. In this case, llcp_sock_connect() is repeatedly invoked,
nfc_llcp_sock_link() will add sk to local->connecting_sockets twice.
sk->sk_node->next will point to itself, that will make an endless loop
and hang-up the system.
To fix it, check whether sk->sk_state is LLCP_CONNECTING in
llcp_sock_connect() to avoid repeated invoking.
Fixes: b4011239a08e ("NFC: llcp: Fix non blocking sockets connections")
Reported-by: "kiyin(尹亮)" <kiyin@tencent.com>
Link: https://www.openwall.com/lists/oss-security/2020/11/01/1
Cc: <stable@vger.kernel.org> #v3.11
Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/perf/git:/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
