Skip to content

Commit 1c8fca1

Browse files
keestorvalds
authored andcommitted
crypto: sanitize argument for format string
The template lookup interface does not provide a way to use format strings, so make sure that the interface cannot be abused accidentally. Signed-off-by: Kees Cook <[email protected]> Cc: Herbert Xu <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ffc8b30 commit 1c8fca1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crypto/algapi.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ static struct crypto_template *__crypto_lookup_template(const char *name)
495495

496496
struct crypto_template *crypto_lookup_template(const char *name)
497497
{
498-
return try_then_request_module(__crypto_lookup_template(name), name);
498+
return try_then_request_module(__crypto_lookup_template(name), "%s",
499+
name);
499500
}
500501
EXPORT_SYMBOL_GPL(crypto_lookup_template);
501502

0 commit comments

Comments
 (0)