From patchwork Fri Jul 14 12:06:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 107783 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp888283obm; Fri, 14 Jul 2017 05:10:01 -0700 (PDT) X-Received: by 10.84.178.37 with SMTP id y34mr15913568plb.223.1500034201584; Fri, 14 Jul 2017 05:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500034201; cv=none; d=google.com; s=arc-20160816; b=vNKP9EDPUizUrfsBGCUDq+NaLRF9Gbc75E4Wq/bmzpR43ZxCUXOYsN2vSRK04+m2rt 5WknMenzixzhBdPHZDV6zb4hJVAROlO1/HJdwl0FQYyhBiea1AnR1mH/ZFSInEnFUPqY i9MqDk4+crQ3SCY8ONxfb/hV/LRmQU/J8FeI49YCWmsd/vkc/66BGWU7W1X+pOyfmbdO PFDicY46KxG423j98NqNO6bZgr3XQzMIAFVSb6E/KzxyBE7j42FoqUKtKljJKM3w1lF2 0GkP81qFXM0FkzxlWGHWBfP0kCuhQprBSh/gxhKdliX3SNAI+2tieDmdKGyxOOW6jBDw gNCg== 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=pfZXks67rIQ9wxOYRMVEPF4w/SClc/Uy3CWqbkpLjYc=; b=lCRgGiZbgNru2VTShhiCHutLtdW4h2JyN7LHHyzLS6kE2tgy0OO+MmkppZiYOLtEgL KhyqRObMkZ/oqTwXIESGM5vGI3IyEQACfPMvQxXNmE9HA9eZ4nm/sOZDfn4Av3aziUTY xST91eoUfFMGVOEr/YzyJIwoinOFxX+VhFrTqnAQKkyvR8FXhL3mh7kevgvpjIhhcVwr Bn1MT1HZt2BYLo4wbtZ/3/3e0xTEz1hRsvDxEmZgo12VtnVbHQNlEOGisikfiAJLmMzh QqZBxewA+oynKqYJSiMGZJn0m7yHZhx6UDDu8txuX/XtuSjCCSXebm1Sl7qkpyXePqF5 nEaw== 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: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g34si6873010pld.318.2017.07.14.05.10.01; Fri, 14 Jul 2017 05:10:01 -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 S1754112AbdGNMJp (ORCPT + 25 others); Fri, 14 Jul 2017 08:09:45 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:57895 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830AbdGNMJm (ORCPT ); Fri, 14 Jul 2017 08:09:42 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0ML7xp-1dWGVc20w5-000OMY; Fri, 14 Jul 2017 14:08:25 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Sathya Prakash , Chaitra P B , Suganath Prabu Subramani Cc: Greg Kroah-Hartman , Linus Torvalds , Guenter Roeck , akpm@linux-foundation.org, netdev@vger.kernel.org, "David S . Miller" , "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, x86@kernel.org, Arnd Bergmann , Helge Deller , MPT-FusionLinux.pdl@broadcom.com Subject: [PATCH 04/22] scsi: fusion: fix string overflow warning Date: Fri, 14 Jul 2017 14:06:56 +0200 Message-Id: <20170714120720.906842-5-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:UVzIsmaXaNQf4a2OpU3fXVKy43BKdOotfKbDtnh14Jcqh6/VxDn ox3Z2cCdf152REUYsL+3a0S3B59oGUgqo7uXzglfAkxT4HNreF9tM0j0xroeskpmmQcuak4 PJciPnNDqoyx/2bQmuGNxCaXRR/J0eRgGu0CIx40W7OTDZEnsyQ9uiQJ6WH6RIukKe0YyPH EdbnmE6vRgCrdvxhfcrSg== X-UI-Out-Filterresults: notjunk:1; V01:K0:5qEoCJeY+RM=:mn7c3G7v9YUntR/ywz908Q yZe33rqWmN93yH6EJ74C4vkOfztji7vcgqgRDazBk17G5MOPn0rKWzD+KR8o0/w8MC2ONn+jk 6NdRGjAqOOBl+sF1thISYTPbVQ3IxQgm9nJU068/ArPp7HDfXRNBfHOAXsVLNZYzk1Uvl5Zlj 1NlHlavEqzjcZldaHgpiMaogSnY4T+WDX1tTD7kWfgfNNsp+towpj7wd+nBN6qkywiaNcTE6E K/1F/aEDqpPOL3Uslj3UaPgP8Gg6590M3Eu0qkHDR1e3POHYx3Sp0vzuVH/A8ICLu4HKfYTXz D+d5+6IOVYiNXjfqvdwADvebbzpZepbEG5AShy/s/ilwM/RWn04pMszkfaZYp+x9+sQ+Wmjxb vjmhnrWGCQ0Mzbrlm69mFMXswcsXteNGDiQEjbgQiyAwXUi1iaXldv3T7wFuzC4yNgAf7n89E ROtR784HNAggbn1DpgjWyS2XfgpA4Naf7pa715e4+m2QPybbdTEwbwPqYzlu3uErg8Oghj5Qd TWOpwZujtnX6VX2sU4Jw68M1KNWTVLiLaSu0/x9qTu2be5NVHkXNnfy1DLicKLxvCCSYgS8JL uGEUV3ZzH1Ndxp9s1pyQqPOazYWwElxWntWP0oq+f8V37tX/Eu5kwAJto1Sy0ryk6+vzwpEIq P+Yx6JZVKGRZbpmUK5DObRK97khycsfWGkxc51+qPnrNzXd6G3Dt/SRh4JEf1Hp7GuxMCgXoq gciS8hXZLT/7PjGh7838bHpq4tdL3w7EmyliMg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc points out a theorerical string overflow: drivers/message/fusion/mptbase.c: In function 'mpt_detach': drivers/message/fusion/mptbase.c:2103:17: error: '%s' directive writing up to 31 bytes into a region of size 28 [-Werror=format-overflow=] sprintf(pname, MPT_PROCFS_MPTBASEDIR "/%s/summary", ioc->name); ^~~~~ drivers/message/fusion/mptbase.c:2103:2: note: 'sprintf' output between 13 and 44 bytes into a destination of size 32 We can simply double the size of the local buffer here to be on the safe side. Signed-off-by: Arnd Bergmann --- drivers/message/fusion/mptbase.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 62cff5afc6bd..46b67a67edc8 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -2079,7 +2079,7 @@ void mpt_detach(struct pci_dev *pdev) { MPT_ADAPTER *ioc = pci_get_drvdata(pdev); - char pname[32]; + char pname[64]; u8 cb_idx; unsigned long flags; struct workqueue_struct *wq;