Message ID | 20170714120720.906842-8-arnd@arndb.de |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp897590obm; Fri, 14 Jul 2017 05:17:43 -0700 (PDT) X-Received: by 10.99.94.194 with SMTP id s185mr14838551pgb.82.1500034663476; Fri, 14 Jul 2017 05:17:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500034663; cv=none; d=google.com; s=arc-20160816; b=H9gJ1kjvQ12HDrLy4IqfWeqtiJuiyUPSpGP8bPi1hMSftTbEOuUICWBMH8VNVQMNM+ U9BiveP7zIRYmNZ3y629YLYSlH2vtc7hmxEddgPuG/KXeCpQRogWuQeR/zxeHz+K3ere hXlRZ22B1Lv+1Zneu07ne9++i7uTZB1/YwnC71DHoaHUxYXlCevINDmN52VA6POcco44 pwX0eDz/kWlObDBxbWcBjqxPvOfsdEM5qpfWucYd+zLNF5Ju1Ov8AKqvVaXtgr6eExJD itmeTWQ2L8TvEWAH4D4Mb598eKP4DTFxPuEHjZfSD3jfYMGJ50vptnKfipsG/O5vm6U5 r5Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Xy4HFD+7eSCkZv3FwJM8ZXk+P0HuxjcIH2pkUjtggIU=; b=CySuSkPRgPo8Lvsus5IIc0bhCuSjDmIyPwwiV/P+cKRgsbFhL5oG9vl5fWrQqZMR8k KxweFffQECqrVu/XmhFJtVpztTsvhpxg1m3+u918DwfBw6j/DU+ZRycQDaaDR6Ejh8cU anSlumDaV0Ysms9pgetYH3TY1wyvWwziqpZeSlS9vldjzkaNd4Ndtn/xF1kxjhOIlIT5 0ZS7mSRdjoeV9WZD3UlhEJhmMPyKqvSQiiqEgF0kB8dXiBvOXjmLmVKWW340GKjlngq+ lIWOdCr5iRu4/aHZY+aHWFFKUydjpsY0zWIWH1qFioHof1elbrTdEU04MgCyFGOGebnN ONKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x7si6510136pge.177.2017.07.14.05.17.43; Fri, 14 Jul 2017 05:17:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754052AbdGNMR0 (ORCPT <rfc822;georgi.djakov@linaro.org> + 25 others); Fri, 14 Jul 2017 08:17:26 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:56663 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753984AbdGNMK2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 14 Jul 2017 08:10:28 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0M1od8-1dlsfE0WcM-00tiwP; Fri, 14 Jul 2017 14:09:10 +0200 From: Arnd Bergmann <arnd@arndb.de> To: linux-kernel@vger.kernel.org, Achim Leubner <achim_leubner@adaptec.com>, "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>, "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Linus Torvalds <torvalds@linux-foundation.org>, Guenter Roeck <linux@roeck-us.net>, akpm@linux-foundation.org, netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>, linux-scsi@vger.kernel.org, x86@kernel.org, Arnd Bergmann <arnd@arndb.de> Subject: [PATCH 07/22] scsi: gdth: increase the procfs event buffer size Date: Fri, 14 Jul 2017 14:06:59 +0200 Message-Id: <20170714120720.906842-8-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714120720.906842-1-arnd@arndb.de> References: <20170714120720.906842-1-arnd@arndb.de> X-Provags-ID: V03:K0:b4vmksQ/9v8c2ubGZ2/juhgzRZwJ9ZyUQHa9fl68wCSJDbMN/iG JUBzKHqMCpga/I0bUrHnOIuya4nQH+PgnPlJ0YqWLfopxGDKNGDA3p0+CJmTcSccMnkugfc bwmMgJoO9CQzKzNxFW57brOJizmXHPJEWnfkK+rzM5h7ABerykChOAmaNhLN+3AhskVnvlQ FPum6+2DR26t6aCCXmWkw== X-UI-Out-Filterresults: notjunk:1; V01:K0:vvuHXynTeqk=:LKGYQZjHj+zHvaODUPOemU 7vJ6XETOyZUMtzMeDLmYeABAFRGGjHh78WFQJ3X3gJ+TU4WGOlbD1kQJ1mfA04kUJWTCimCpr vgun6VEGcQUpLz6yp06OobI4xaVOgK0kys4lF41aNDg/buHJWjDv6kGkpdUjiRQJVJu1eAZdQ xWxnDqJ9fOVHWdbqTBhRd0wjSC/hH0vltLyWxGcWiTL6OEepit6gFbNq6MZBQWevJklntAxfJ qRb1rxuhKjWCPQRyHvjGHwZIhCZz3YFrLeIlfu/qfeWm4La2ET7XKkcaAXnzL4qYmQt+xgDbv I+zaafzL/9oa1dvk4ZpqczrZjvdbJB5O51GXKWwa6ks7Yb8lLiiDKHZ2I2dfw3hCQDfeJQcwk FNOpfS/b1TjyKsQvJFm4cSGMnH4z1aVxC1zYK86KqzEmO/txyrP66uJaEGoXAIAx/hFLZjqWc 17vlZtbF9Qtv9a3REATPEuTihPprCU0YL0RrVSVZSB7M8pcqAaJBL5XjRDhFERKIktzeYjl6E UrEf8QupVElFPqFkj2vaHYS0A1zzw+LbFPfMBRsS3Ihf5gqnLO2/ucPPzwOUoO+Y2rEbdJa7M 6pE8sVRdZqfq4g0XEdywnUHjgp5EwA38Mj2+aLXgbr+6ZA5P2JjqQJefb05P5Vl619XgN6bL7 OW1S8t+iIvGaxovuMQNsgbsU/13iZVz72yrqHgcACPNMWAan1EeB241WalHvymK4k/WQtpaJw OxqZnS/CwPdEyhz5ulL37281qNXcXHlII1yXQA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
gcc-7 -Wformat-* warnings
|
expand
|
diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c index be609db66807..d08b2716752c 100644 --- a/drivers/scsi/gdth_proc.c +++ b/drivers/scsi/gdth_proc.c @@ -147,7 +147,7 @@ int gdth_show_info(struct seq_file *m, struct Scsi_Host *host) gdth_cmd_str *gdtcmd; gdth_evt_str *estr; - char hrec[161]; + char hrec[277]; char *buf; gdth_dskstat_str *pds;
We print a 256 byte event string into a buffer that is only 161 bytes long, this is clearly wrong: drivers/scsi/gdth_proc.c: In function 'gdth_show_info': drivers/scsi/gdth.c:3660:41: error: '%s' directive writing up to 255 bytes into a region of size between 141 and 150 [-Werror=format-overflow=] sprintf(buffer,"Adapter %d: %s\n", ^~ /git/arm-soc/drivers/scsi/gdth.c:3660:13: note: 'sprintf' output between 13 and 277 bytes into a destination of size 161 sprintf(buffer,"Adapter %d: %s\n", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dvr->eu.async.ionode,dvr->event_string); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gcc calculates that the worst case buffer size would be 277 bytes, so we can use that. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/scsi/gdth_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0