Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754928Ab3IKEjt (ORCPT ); Wed, 11 Sep 2013 00:39:49 -0400 Received: from smtp.outflux.net ([198.145.64.163]:55952 "EHLO smtp.outflux.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754854Ab3IKEjr (ORCPT ); Wed, 11 Sep 2013 00:39:47 -0400 Date: Tue, 10 Sep 2013 21:38:48 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Bradley Grove , "James E.J. Bottomley" , linux-scsi@vger.kernel.org Subject: [PATCH] scsi: esas2r: fix potential format string flaw Message-ID: <20130911043848.GA17221@www.outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-HELO: www.outflux.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 33 This makes sure format strings cannot leak into the printk call via the constructed buffer. Signed-off-by: Kees Cook --- drivers/scsi/esas2r/esas2r_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c index 9bf285d..61fc19d 100644 --- a/drivers/scsi/esas2r/esas2r_log.c +++ b/drivers/scsi/esas2r/esas2r_log.c @@ -171,7 +171,7 @@ static int esas2r_log_master(const long level, if (strlen(event_buffer) < buflen) strcat(buffer, "\n"); - printk(event_buffer); + printk("%s", event_buffer); spin_unlock_irqrestore(&event_buffer_lock, flags); } -- 1.7.9.5 -- Kees Cook Chrome OS Security -- 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/