crypto: chtls: wait for memory sendmsg, sendpage
authorAtul Gupta <atul.gupta@chelsio.com>
Sun, 27 May 2018 15:45:19 +0000 (21:15 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 May 2018 14:14:38 +0000 (10:14 -0400)
commitb7af47b33008c3558bd107de647be6f3e6c0dfc6
tree33cc3dd53c827daca02c3e268e8eabb462e8050b
parenta491b9321d486e69040b1ea186ad9b9a3a89f338
crypto: chtls: wait for memory sendmsg, sendpage

address suspicious code <gustavo@embeddedor.com>

1210       set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
1211       }

The issue is that in the code above, set_bit is never reached
due to the 'continue' statement at line 1208.

Also reported by bug report:<dan.carpenter@oracle.com>
1210       set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Not reachable.

Its required to wait for buffer in the send path and takes care of
unaddress and un-handled SOCK_NOSPACE.

v2: use csk_mem_free where appropriate
    proper indent of goto do_nonblock
    replace out with do_rm_wq

Reported-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/crypto/chelsio/chtls/chtls.h
drivers/crypto/chelsio/chtls/chtls_io.c
drivers/crypto/chelsio/chtls/chtls_main.c