RISC-V: Fix a race condition during kernel stack overflow
[platform/kernel/linux-starfive.git] / crypto / api.c
index 69508ae..64f2d36 100644 (file)
@@ -114,7 +114,7 @@ struct crypto_larval *crypto_larval_alloc(const char *name, u32 type, u32 mask)
        larval->alg.cra_priority = -1;
        larval->alg.cra_destroy = crypto_larval_destroy;
 
-       strlcpy(larval->alg.cra_name, name, CRYPTO_MAX_ALG_NAME);
+       strscpy(larval->alg.cra_name, name, CRYPTO_MAX_ALG_NAME);
        init_completion(&larval->completion);
 
        return larval;
@@ -321,7 +321,7 @@ struct crypto_alg *crypto_alg_mod_lookup(const char *name, u32 type, u32 mask)
 
        /*
         * If the internal flag is set for a cipher, require a caller to
-        * to invoke the cipher with the internal flag to use that cipher.
+        * invoke the cipher with the internal flag to use that cipher.
         * Also, if a caller wants to allocate a cipher that may or may
         * not be an internal cipher, use type | CRYPTO_ALG_INTERNAL and
         * !(mask & CRYPTO_ALG_INTERNAL).