Thread (18 messages) 18 messages, 4 authors, 2017-11-25

Re: [PATCH] crypto: AF_ALG - remove locking in async callback

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2017-11-07 05:23:10
Also in: linux-arm-kernel

On Mon, Nov 06, 2017 at 05:06:09PM +0100, Stephan Mueller wrote:
Am Freitag, 3. November 2017, 14:20:16 CET schrieb Herbert Xu:
quoted
Are you sure about that? In particular is the callback function still
sane without the socket lock if a concurrent recvmsg/sendmsg call is
made?
I reviewed the code again and I cannot find a reason for keeping the lock. All 
we need to ensure is that the socket exists. This is ensured with the refcount 
of the socket released by __sock_put().
OK, I can't see why we need a lock there either.  However, the call
to __sock_put looks suspicious.  Why isn't this using sock_put?

Also the sock_hold on the caller side looks buggy.  Surely it needs
to be made before we even call the encrypt/decrypt functions rather
than after it returns EINPROGRESS at which point it may well be too
late?

Cheers,
-- 
Email: Herbert Xu [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help