Received: by 10.213.65.68 with SMTP id h4csp240839imn; Fri, 23 Mar 2018 03:41:58 -0700 (PDT) X-Google-Smtp-Source: AG47ELuy/cDGV8OBHrXePPHp98QhG6tisk5AUB+Nn0KA8fKkjBdZUQY5HfiXRGM6QLXmde8Is2/e X-Received: by 2002:a17:902:66e6:: with SMTP id e93-v6mr29178740plk.312.1521801718712; Fri, 23 Mar 2018 03:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521801718; cv=none; d=google.com; s=arc-20160816; b=XoRtjz/Ze8haHOP6m+bFStPqyy6Av1kzu0cRAaWlATKMrX4DFUEBeSpUj3+9kNRQba qDCdX/Nw7a28tOfNiWMDJpKNQ5Cnplezb17vMtxaw+OcyvbfTG8+5jKgFpLdA8PQngXz Mfi4jlhCelfu9cLgxj6lX/MZ5laj5phaJkT6VfeUA3v9AGtt8dqVb8vhjidnBm1DCxfK XGRecw3SuV4r7iZ6axakxqX01I6A1qULkdLsCXJzMa8ry1xtZbbSRJOVvR31BXK4dB6m OJR1qcKeZlQ8rRm4Brkec7e9lrV0sC86GjxF3wsCl8lvCzrQBmeuiuogTKpFYhD0pmHv tM4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=qKVSDdVqrT7mBlAuCXa+4eEBWnnrnHuW+9lp8fAjTqc=; b=OXTSZby/44JSsUa6OmOpsnfz1dPdzxYWBqDsxvSZtBPNuvdEvGE+rlK3E7+A4zRy4S 6LKouEgu7gazsOndptSOuhM5PYLKOW7of4+7xuH7QpMTN6WLl/WLLx+Eqe5VCpNzn9gz 1KBOaV0ijz+au9jKfbhef/6kci0EttMcuImDB5tEFZh7qdRG0c1TmgMr7iucRXDc8Qu6 hISUwi2JEyzQ3/0Vk8wiWfqqe90LAtuU3sS7zIfQAS+ITEaQQkxYgb2+i9oDj+2WONtQ kkCCKLwdwxmtWGNac7PPAG+KYje+zmOSyDRUpLVAOj9Qxz4Yu7tNRQiEDWSgDJotD0mY wb4A== 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 m9-v6si8092634plk.464.2018.03.23.03.41.44; Fri, 23 Mar 2018 03:41:58 -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 S933661AbeCWKQd (ORCPT + 99 others); Fri, 23 Mar 2018 06:16:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46704 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933618AbeCWKQ3 (ORCPT ); Fri, 23 Mar 2018 06:16:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E22C9C7B; Fri, 23 Mar 2018 10:16:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Benson Leung , Sasha Levin Subject: [PATCH 4.4 80/97] cros_ec: fix nul-termination for firmware build info Date: Fri, 23 Mar 2018 10:55:07 +0100 Message-Id: <20180323094202.035094099@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/platform/chrome/cros_ec_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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 de 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); }