Skip to contentSkip to conversation

Patch "cros_ec: fix nul-termination for firmware build info" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Mar 22, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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.14-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.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Mar 22 14:26:48 CET 2018

From: Arnd Bergmann <[email protected]>
Date: Mon, 4 Dec 2017 15:49:48 +0100
Subject: cros_ec: fix nul-termination for firmware build info

From: Arnd Bergmann <[email protected]>

[ 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")
---
 drivers/platform/chrome/cros_ec_sysfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_sysfs.c +1 -1
@@ -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 [email protected] are

queue-4.14/drm-tilcdc-ensure-nonatomic-iowrite64-is-not-used.patch queue-4.14/cros_ec-fix-nul-termination-for-firmware-build-info.patch