From patchwork Thu Mar 8 05:02:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130936 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6049406lja; Wed, 7 Mar 2018 21:25:35 -0800 (PST) X-Google-Smtp-Source: AG47ELsAkEvgO42oHxuE8O7KYzLgOLeLZ1e8YZpZFyb18sQjBiyRC/407McSfc1rrjcMPY/3mZhW X-Received: by 10.98.103.69 with SMTP id b66mr25290322pfc.114.1520486735486; Wed, 07 Mar 2018 21:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520486735; cv=none; d=google.com; s=arc-20160816; b=oC8qT34XUX/SJUUqOuZkkBogipDv29dlByoPpGgEgvwhQ+e1/FM783nmY7hy1x48JJ KysSfS6mLM+Ta9DVs+UH1BBiDur9IJCmLRi/nU2dX//K1nervE0p1qGlEht1aUPl4JPW 4tlg9Er0oZJwhQQ/4JeZwsAMaWQoVnNlEutTRhGa2AFVuVSIUdn/InnazRtVCELLNNGi 7d3f71Pcs/AT746GmD5XYj1pfqEuYWvO7UVXH70NeXLEyT94sfctNSAuDMeQbgkvYqrL 0j4KjsNo2cUCEWP2cZhS8Z1+iCSzHUpMn3kBxAr846XaDCzeqS/5T4JhFPE6WQRKoPk2 pIFw== 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=VDtuXUtVKOhSLFufFh06Vt0h0aL31wO9c+MA+KU5NDxsy1ogZ6Tou0E1CHwLDqkfDE F2DGaMrEoahbuJbCMg5MDrNKuuONsfp0tRooHLmHlk0oiuCTT679RTzIYb6T71QTMwUS ICc/PfXgPrIwUJt/f/2YJWpD/TBA3YVEa8/eaLBKiJHHcHz2KXQDuqn7JEx0B2adtT67 9xANNT/g2+FLgXjw8zo56HRgNKQK18yuFjBaW5qOboW1uTkGAKC1c2fMVTmmtNzIGrLK wOT/5MI00uJIX82Uy3o6Jk8y5ZQD0GJT+jUjELq0vSoljKeBgAkib9ooU+3FGObxpjCy hgdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=GkDRSsmM; 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 r15-v6si14712782pli.431.2018.03.07.21.25.34; Wed, 07 Mar 2018 21:25:35 -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=GkDRSsmM; 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 S966675AbeCHFZc (ORCPT + 28 others); Thu, 8 Mar 2018 00:25:32 -0500 Received: from mail-bn3nam01on0110.outbound.protection.outlook.com ([104.47.33.110]:54752 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966589AbeCHFHU (ORCPT ); Thu, 8 Mar 2018 00:07:20 -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=GkDRSsmMOtoSWLEzlobPPiuJfVu2xkKbbdNPJ2B3C6cWI1M2TE0G5bxe8DsppWy7JeUDbJUVCI3xoo8FNtGsgnDvw2L3n5ySsrLFh15ZoKoPOc/VxBX9KLmpeyNEhIcNW+SOXtiyxtOMSFiGVFdPx5/ceUDyEfcpIFb3IL7kT3M= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1077.namprd21.prod.outlook.com (52.132.130.11) 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 05:07:15 +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 05:07:15 +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.4 085/101] cros_ec: fix nul-termination for firmware build info Thread-Topic: [PATCH AUTOSEL for 4.4 085/101] cros_ec: fix nul-termination for firmware build info Thread-Index: AQHTtpqda72hFANWRUqQdTnYsn7hFQ== Date: Thu, 8 Mar 2018 05:02:10 +0000 Message-ID: <20180308050023.8548-85-alexander.levin@microsoft.com> References: <20180308050023.8548-1-alexander.levin@microsoft.com> In-Reply-To: <20180308050023.8548-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; DM5PR2101MB1077; 20:QG+dO7+KZcg8Qw6yGdkGmDqjv5DhxphPPUJi7w6kgkc/PX4EoAKgeyU5VPGxb/WdlECqZYqqtKCXwYZlOFeUWQyKob5s8OfBnDW8IWFm8rzDviPrZ5pQaxdCNniEzXyHdZ2Eq19r51/hxW15iqpBPYgMWuEPHbDusE5DKx+j86o= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 06e43d71-c231-4272-7bde-08d584b275cb x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1077; x-ms-traffictypediagnostic: DM5PR2101MB1077: 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)(93006095)(93001095)(3231220)(944501244)(52105095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB1077; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1077; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(376002)(346002)(39380400002)(396003)(39860400002)(199004)(189003)(86362001)(102836004)(575784001)(6506007)(59450400001)(22452003)(2950100002)(186003)(68736007)(26005)(106356001)(105586002)(66066001)(6666003)(86612001)(3846002)(3280700002)(2900100001)(25786009)(53936002)(5660300001)(2906002)(3660700001)(10090500001)(6512007)(1076002)(4326008)(6116002)(305945005)(110136005)(107886003)(54906003)(2501003)(5250100002)(8676002)(8936002)(81156014)(81166006)(14454004)(76176011)(7736002)(72206003)(10290500003)(478600001)(6486002)(6436002)(99286004)(36756003)(97736004)(316002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1077; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: pEBPY6RKR9G6zG1xfevwU0GMZjGEDq/TiWhyKJNiWMTM14lXrzjK3lZKQH96/wpeq82Jx7MAhnJZA4+CbrDT9g7d0WwfMb4uj+uunxcKL+yPMfADaqTV4RG5D4zktbVCPQwsfLDIK/xyEfGd87MTrPgQtJDGxt7u86iiVAMpU/j34+k3j6OTUQ1lyVh/MauySG9CW61wVZFsWCkL4qWw3y68iKx6kKqj0nDBqCuo2PBHAYXoMadaURhsTO9wZ/ok04QQPnBPs+yOifnYu1nxuZ78z7Hc5x7uLraeEpevFJeAgG8MOJmljkdZp1s8dAE+wgbscArkM56FvwNPORBRaA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06e43d71-c231-4272-7bde-08d584b275cb X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 05:02:10.4977 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1077 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 4294967295 is above array bounds of 'uint8_t[]' [-Werror=array-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 data") 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(-) -- 2.14.1 diff --git a/drivers/platform/chrome/cros_ec_sysfs.c b/drivers/platform/chrome/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 += scnprintf(buf + count, PAGE_SIZE - count, "Build info: EC error %d\n", msg->result); else { - msg->data[sizeof(msg->data) - 1] = '\0'; + msg->data[EC_HOST_PARAM_SIZE - 1] = '\0'; count += scnprintf(buf + count, PAGE_SIZE - count, "Build info: %s\n", msg->data); }