Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757619Ab3FGXwq (ORCPT ); Fri, 7 Jun 2013 19:52:46 -0400 Received: from smtp.outflux.net ([198.145.64.163]:51979 "EHLO smtp.outflux.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755942Ab3FGXwo (ORCPT ); Fri, 7 Jun 2013 19:52:44 -0400 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Greg Kroah-Hartman , Jens Axboe , "David S. Miller" , Herbert Xu , David Woodhouse , Karsten Keil , Kees Cook , stable@vger.kernel.org Subject: [PATCH 2/6] crypto: sanitize argument for format string Date: Fri, 7 Jun 2013 16:50:51 -0700 Message-Id: <1370649055-12830-3-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1370649055-12830-1-git-send-email-keescook@chromium.org> References: <1370649055-12830-1-git-send-email-keescook@chromium.org> X-HELO: www.outflux.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1141 Lines: 33 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 Cc: stable@vger.kernel.org Cc: Herbert Xu Cc: "David S. Miller" --- crypto/algapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/algapi.c b/crypto/algapi.c index 6149a6e..7a1ae87 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -495,7 +495,8 @@ static struct crypto_template *__crypto_lookup_template(const char *name) struct crypto_template *crypto_lookup_template(const char *name) { - return try_then_request_module(__crypto_lookup_template(name), name); + return try_then_request_module(__crypto_lookup_template(name), "%s", + name); } EXPORT_SYMBOL_GPL(crypto_lookup_template); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/