hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/crypto/xts.c
....@@ -203,12 +203,12 @@
203203 if (!err) {
204204 struct xts_request_ctx *rctx = skcipher_request_ctx(req);
205205
206
- rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
206
+ rctx->subreq.base.flags &= CRYPTO_TFM_REQ_MAY_BACKLOG;
207207 err = xts_xor_tweak_post(req, true);
208208
209209 if (!err && unlikely(req->cryptlen % XTS_BLOCK_SIZE)) {
210210 err = xts_cts_final(req, crypto_skcipher_encrypt);
211
- if (err == -EINPROGRESS)
211
+ if (err == -EINPROGRESS || err == -EBUSY)
212212 return;
213213 }
214214 }
....@@ -223,12 +223,12 @@
223223 if (!err) {
224224 struct xts_request_ctx *rctx = skcipher_request_ctx(req);
225225
226
- rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
226
+ rctx->subreq.base.flags &= CRYPTO_TFM_REQ_MAY_BACKLOG;
227227 err = xts_xor_tweak_post(req, false);
228228
229229 if (!err && unlikely(req->cryptlen % XTS_BLOCK_SIZE)) {
230230 err = xts_cts_final(req, crypto_skcipher_decrypt);
231
- if (err == -EINPROGRESS)
231
+ if (err == -EINPROGRESS || err == -EBUSY)
232232 return;
233233 }
234234 }
....@@ -396,10 +396,10 @@
396396 * cipher name.
397397 */
398398 if (!strncmp(cipher_name, "ecb(", 4)) {
399
- unsigned len;
399
+ int len;
400400
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)
403403 goto err_free_inst;
404404
405405 if (ctx->name[len - 1] != ')')