Files
Linux/crypto
David Howells 0b7ec177b5 crypto: algif_hash - Fix race between MORE and non-MORE sends
The 'MSG_MORE' state of the previous sendmsg() is fetched without the
socket lock held, so two sendmsg calls can race.  This can be seen with a
large sendfile() as that now does a series of sendmsg() calls, and if a
write() comes in on the same socket at an inopportune time, it can flip the
state.

Fix this by moving the fetch of ctx->more inside the socket lock.

Fixes: c662b043cd ("crypto: af_alg/hash: Support MSG_SPLICE_PAGES")
Reported-by: [email protected]
Link: https://lore.kernel.org/r/[email protected]/
Signed-off-by: David Howells <[email protected]>
Tested-by: [email protected]
cc: Herbert Xu <[email protected]>
cc: Paolo Abeni <[email protected]>
cc: "David S. Miller" <[email protected]>
cc: Eric Dumazet <[email protected]>
cc: Jakub Kicinski <[email protected]>
cc: [email protected]
cc: [email protected]
Signed-off-by: Herbert Xu <[email protected]>
2023-07-08 22:48:42 +10:00
..
…
…
2023-06-23 16:15:36 +08:00
…
…
2022-03-03 10:49:20 +12:00
2023-05-24 18:12:33 +08:00
…
…
…
2023-02-14 13:39:33 +08:00
…
2023-06-16 20:30:35 +08:00
2023-06-27 15:40:24 +08:00
…
…
…
…
…
…
…
…
…
2023-02-14 13:39:33 +08:00
…
…
2022-12-02 18:12:40 +08:00
2023-06-27 15:40:24 +08:00
…
2022-04-08 16:12:46 +08:00
2022-12-02 18:12:40 +08:00
…
…
2022-06-10 16:40:16 +08:00
…
…