crypto: xts - Handle EBUSY correctly
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 22 Jan 2023 08:07:37 +0000 (16:07 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 27 Jan 2023 10:58:09 +0000 (18:58 +0800)
commit51c082514c2dedf2711c99d93c196cc4eedceb40
tree6c57ecf45ec5048aabdf8709d81d030bc029ca9d
parent4bc713a49d7f97f7328e5a595b8f5d231d9ebfca
crypto: xts - Handle EBUSY correctly

As it is xts only handles the special return value of EINPROGRESS,
which means that in all other cases it will free data related to the
request.

However, as the caller of xts may specify MAY_BACKLOG, we also need
to expect EBUSY and treat it in the same way.  Otherwise backlogged
requests will trigger a use-after-free.

Fixes: 8083b1bf8163 ("crypto: xts - add support for ciphertext stealing")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/xts.c