| .. | .. |
|---|
| 203 | 203 | if (!err) { |
|---|
| 204 | 204 | struct xts_request_ctx *rctx = skcipher_request_ctx(req); |
|---|
| 205 | 205 | |
|---|
| 206 | | - rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; |
|---|
| 206 | + rctx->subreq.base.flags &= CRYPTO_TFM_REQ_MAY_BACKLOG; |
|---|
| 207 | 207 | err = xts_xor_tweak_post(req, true); |
|---|
| 208 | 208 | |
|---|
| 209 | 209 | if (!err && unlikely(req->cryptlen % XTS_BLOCK_SIZE)) { |
|---|
| 210 | 210 | err = xts_cts_final(req, crypto_skcipher_encrypt); |
|---|
| 211 | | - if (err == -EINPROGRESS) |
|---|
| 211 | + if (err == -EINPROGRESS || err == -EBUSY) |
|---|
| 212 | 212 | return; |
|---|
| 213 | 213 | } |
|---|
| 214 | 214 | } |
|---|
| .. | .. |
|---|
| 223 | 223 | if (!err) { |
|---|
| 224 | 224 | struct xts_request_ctx *rctx = skcipher_request_ctx(req); |
|---|
| 225 | 225 | |
|---|
| 226 | | - rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; |
|---|
| 226 | + rctx->subreq.base.flags &= CRYPTO_TFM_REQ_MAY_BACKLOG; |
|---|
| 227 | 227 | err = xts_xor_tweak_post(req, false); |
|---|
| 228 | 228 | |
|---|
| 229 | 229 | if (!err && unlikely(req->cryptlen % XTS_BLOCK_SIZE)) { |
|---|
| 230 | 230 | err = xts_cts_final(req, crypto_skcipher_decrypt); |
|---|
| 231 | | - if (err == -EINPROGRESS) |
|---|
| 231 | + if (err == -EINPROGRESS || err == -EBUSY) |
|---|
| 232 | 232 | return; |
|---|
| 233 | 233 | } |
|---|
| 234 | 234 | } |
|---|
| .. | .. |
|---|
| 396 | 396 | * cipher name. |
|---|
| 397 | 397 | */ |
|---|
| 398 | 398 | if (!strncmp(cipher_name, "ecb(", 4)) { |
|---|
| 399 | | - unsigned len; |
|---|
| 399 | + int len; |
|---|
| 400 | 400 | |
|---|
| 401 | | - len = strlcpy(ctx->name, cipher_name + 4, sizeof(ctx->name)); |
|---|
| 402 | | - if (len < 2 || len >= sizeof(ctx->name)) |
|---|
| 401 | + len = strscpy(ctx->name, cipher_name + 4, sizeof(ctx->name)); |
|---|
| 402 | + if (len < 2) |
|---|
| 403 | 403 | goto err_free_inst; |
|---|
| 404 | 404 | |
|---|
| 405 | 405 | if (ctx->name[len - 1] != ')') |
|---|