Received: by 10.223.185.116 with SMTP id b49csp5965727wrg; Wed, 7 Mar 2018 22:49:36 -0800 (PST) X-Google-Smtp-Source: AG47ELsu9yz+NA5MsEKPfI6ptPcLdIH+4cpr+KJcCPLZI8zolRYUqIpvu+jY2rRlIyuKrLF0G1Yz X-Received: by 2002:a17:902:9002:: with SMTP id a2-v6mr22903006plp.412.1520491776513; Wed, 07 Mar 2018 22:49:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491776; cv=none; d=google.com; s=arc-20160816; b=bA+q1AQB9AFqHFFGxAI6hhlj8FcClWkdGO53NJ4WGIMZ55H8Jx66uDbQCVN5AKP1tQ 0yPuBFd8JCOfTM7poaDR2aDY09r3pJXsxJzisUI62Qe0VE6WJ/kSz79o+5cu/vQr0jUs +fpKxKN7jIC1l78EoV2y05TR8/QdAzMDJCrifYrJUhCMBdokL3c+0Lfh+ewJOOcT/HNb Us6YDHEXNXF4jDFv1VlulcCMr8ccgYdHaMgVvt0gDQoNsc5ms/789oAbnhCJL4WUyg97 b0L5MU316lpCT17MTcEVc/0FRrvvXgNtKUIAtEFJsvZm7N+wx22yqSvkLZ5GDWED0yse RLgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=AkJhVfJ1nAur6Od7PlwDuH0UJiq+I5seQQeV+TnQWkY=; b=YuY+WidE1ECsUfQokywZV/lVp8c83KGIgLkf+j4zEQhEa+2xNWJcgSqxFjbCco10to CEFwox5SSHN3YvkO/JvuHJRRWvB+seauRfztM9a92A7S13DfNMCIwJpH33Kyd9j/GbCn YEj7pApNlj8iVKe1jCUT2dXwqqi3OPKJZ7JTMAWdzH7eAn5NdNLozDtSISfxgEfvACpm 7pfH3f9ZphfA0oXArmMMJ2ZXdS3JN4os1YVzaCZ1Nl52GG7DPqpejZ9BbRQ6KpUOacMd /0lQz51GUkPNfrRujRpDqnCXVK/wKNmq3tvXSDWzanxopArFi0OySESB7zt2VGlT0jX7 B0ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=nai6UNSw; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8-v6si14269165plh.219.2018.03.07.22.49.22; Wed, 07 Mar 2018 22:49:36 -0800 (PST) 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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=nai6UNSw; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965323AbeCHGse (ORCPT + 99 others); Thu, 8 Mar 2018 01:48:34 -0500 Received: from mail-by2nam03on0100.outbound.protection.outlook.com ([104.47.42.100]:51511 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965081AbeCHE6Q (ORCPT ); Wed, 7 Mar 2018 23:58:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AkJhVfJ1nAur6Od7PlwDuH0UJiq+I5seQQeV+TnQWkY=; b=nai6UNSwzzlxoN0zECHxwxDWoBQn7H5mxk+1kBnvL3FlzTiTRS8CZlTTDhzN1QiVcnNrhwTMeXoA58pK8dNJ64MbVvj/LhiQRH1g8kU2GtCUOPfVUnRFHAQj8hL2KncXCV/TTORBIBKz4ZjxqS68igHzSjbdH70kEuwyx8HZAoI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1080.namprd21.prod.outlook.com (52.132.130.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Thu, 8 Mar 2018 04:58:14 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:58:14 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Arnd Bergmann , Benson Leung , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 22/67] cros_ec: fix nul-termination for firmware build info Thread-Topic: [PATCH AUTOSEL for 4.14 22/67] cros_ec: fix nul-termination for firmware build info Thread-Index: AQHTtpn8NZfzmEJMo0mQQ6AKYueXJw== Date: Thu, 8 Mar 2018 04:57:41 +0000 Message-ID: <20180308045641.7814-22-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1080;20:eLYrs0UkF7kdJ6oUlB9WdA/nlwqEVFa59/0UInfUnHQ+tMjNsCehByHCEbRV732FjPmPb5PQYzRlMvThMvKAg2oWVQtU4mlZBV3ln/reWzqD2LAHc3yU6Po+zc1yxPTH+TLriTuYYriVWIDCeETPzyaUh9WKlVDnmMOd7LZvsD8= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 67921cd6-1585-4abe-252b-08d584b1331b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1080; x-ms-traffictypediagnostic: DM5PR2101MB1080: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(20558992708506)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(3231220)(944501244)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB1080;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1080; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(376002)(366004)(39380400002)(346002)(39860400002)(189003)(199004)(6116002)(1076002)(5250100002)(26005)(102836004)(2501003)(3846002)(59450400001)(186003)(6506007)(25786009)(3280700002)(4326008)(2906002)(68736007)(66066001)(86612001)(3660700001)(22452003)(6486002)(6436002)(14454004)(8676002)(81166006)(2900100001)(72206003)(81156014)(8936002)(478600001)(10090500001)(105586002)(10290500003)(53936002)(6512007)(6666003)(107886003)(2950100002)(106356001)(76176011)(316002)(7736002)(86362001)(575784001)(36756003)(97736004)(54906003)(110136005)(5660300001)(99286004)(305945005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1080;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Y8h066lhHBk7M/vcEULl7yxZtCA4jWDszoBsN28ELDXYyT9+5QCwpEY9z7dxqr5cy+JSGFxl0KrG8JQcR/lIeOw24eRId/mWQ0poscun4Ia1ENy+p4662djOPasCxujbVHNv4Ts8L743pwcDc90GPp2/QQbaI4F3PcSfbIg1Bir/wKBfth0zJzSMOBDtdVWxwSCisofugh8ibm8K70yjgTvHNahqpVXBv/UsQLWxmhh4HGctXEXyexL/wc91SBeUUJz98QxR1rasqGmxMfYt8+Q5wAJ0sICe9jJBQRrcQ2/SvP4cPgcXbw8k/qHxvcDCbJFNSiTwrUC1kkUiWINNCw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67921cd6-1585-4abe-252b-08d584b1331b X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:41.0655 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1080 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 50a0d71a5d20e1d3eff1d974fdc8559ad6d74892 ] As gcc-8 reports, we zero out the wrong byte: drivers/platform/chrome/cros_ec_sysfs.c: In function 'show_ec_version': drivers/platform/chrome/cros_ec_sysfs.c:190:12: error: array subscript 4294= 967295 is above array bounds of 'uint8_t[]' [-Werror=3Darray-bounds] This changes the code back to what it did before changing to a zero-length array structure. Fixes: a841178445bb ("mfd: cros_ec: Use a zero-length array for command dat= a") Signed-off-by: Arnd Bergmann Signed-off-by: Benson Leung Signed-off-by: Sasha Levin --- drivers/platform/chrome/cros_ec_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec_sysfs.c b/drivers/platform/chr= ome/cros_ec_sysfs.c index f3baf9973989..24f1630a8b3f 100644 --- a/drivers/platform/chrome/cros_ec_sysfs.c +++ b/drivers/platform/chrome/cros_ec_sysfs.c @@ -187,7 +187,7 @@ static ssize_t show_ec_version(struct device *dev, count +=3D scnprintf(buf + count, PAGE_SIZE - count, "Build info: EC error %d\n", msg->result); else { - msg->data[sizeof(msg->data) - 1] =3D '\0'; + msg->data[EC_HOST_PARAM_SIZE - 1] =3D '\0'; count +=3D scnprintf(buf + count, PAGE_SIZE - count, "Build info: %s\n", msg->data); } --=20 2.14.1