stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "cros_ec: fix nul-termination for firmware build info" has been added to the 4.4-stable tree
@ 2018-03-22 14:01 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-03-22 14:01 UTC (permalink / raw)
  To: arnd, alexander.levin, bleung, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    cros_ec: fix nul-termination for firmware build info

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cros_ec-fix-nul-termination-for-firmware-build-info.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Thu Mar 22 14:57:32 CET 2018
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 4 Dec 2017 15:49:48 +0100
Subject: cros_ec: fix nul-termination for firmware build info

From: Arnd Bergmann <arnd@arndb.de>


[ 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 <arnd@arndb.de>
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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);
 	}


Patches currently in stable-queue which might be from arnd@arndb.de are

queue-4.4/time-change-posix-clocks-ops-interfaces-to-use-timespec64.patch
queue-4.4/cros_ec-fix-nul-termination-for-firmware-build-info.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-22 14:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-22 14:01 Patch "cros_ec: fix nul-termination for firmware build info" has been added to the 4.4-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).