]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.10.1/crypto-sanitize-argument-for-format-string.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.1 / crypto-sanitize-argument-for-format-string.patch
1 From 1c8fca1d92e14859159a82b8a380d220139b7344 Mon Sep 17 00:00:00 2001
2 From: Kees Cook <keescook@chromium.org>
3 Date: Wed, 3 Jul 2013 15:01:15 -0700
4 Subject: crypto: sanitize argument for format string
5
6 From: Kees Cook <keescook@chromium.org>
7
8 commit 1c8fca1d92e14859159a82b8a380d220139b7344 upstream.
9
10 The template lookup interface does not provide a way to use format
11 strings, so make sure that the interface cannot be abused accidentally.
12
13 Signed-off-by: Kees Cook <keescook@chromium.org>
14 Cc: Herbert Xu <herbert@gondor.apana.org.au>
15 Cc: "David S. Miller" <davem@davemloft.net>
16 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
17 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20 ---
21 crypto/algapi.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24 --- a/crypto/algapi.c
25 +++ b/crypto/algapi.c
26 @@ -495,7 +495,8 @@ static struct crypto_template *__crypto_
27
28 struct crypto_template *crypto_lookup_template(const char *name)
29 {
30 - return try_then_request_module(__crypto_lookup_template(name), name);
31 + return try_then_request_module(__crypto_lookup_template(name), "%s",
32 + name);
33 }
34 EXPORT_SYMBOL_GPL(crypto_lookup_template);
35