Skip to contentSkip to conversation

Patch "x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const"" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Feb 28, 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

x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const"

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:
x86-platform-intel-mid-revert-make-bt_sfi_data-const.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 Wed Feb 28 16:23:28 CET 2018

From: Andy Shevchenko <[email protected]>
Date: Thu, 28 Dec 2017 14:25:23 +0200
Subject: x86/platform/intel-mid: Revert "Make 'bt_sfi_data' const"

From: Andy Shevchenko <[email protected]>

[ Upstream commit 9d0513d82f1a8fe17b41f113ac5922fa57dbaf5c ]

So one of the constification patches unearthed a type casting fragility of the underlying code:

276c87054751 ("x86/platform/intel-mid: Make 'bt_sfi_data' const")

converted the struct to be const while it is also used as a temporary container for important data that is used to fill 'parent' and 'name' fields in struct platform_device_info.

The compiler doesn't notice this due to an explicit type cast that loses the const - which fragility will be fixed separately.

This type cast turned a seemingly trivial const propagation patch into a hard to debug data corruptor and crasher bug.

---
 arch/x86/platform/intel-mid/device_libs/platform_bt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/platform/intel-mid/device_libs/platform_bt.c +1 -1
@@ -60,7 +60,7 @@ static int __init tng_bt_sfi_setup(struc
 	return 0;
 }
 
-static const struct bt_sfi_data tng_bt_sfi_data __initdata = {
+static struct bt_sfi_data tng_bt_sfi_data __initdata = {
 	.setup	= tng_bt_sfi_setup,
 };
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/x86-platform-intel-mid-revert-make-bt_sfi_data-const.patch queue-4.14/genirq-guard-handle_bad_irq-log-messages.patch