hulk inclusion category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/14259 CVE: CVE-2026-31527 -------------------------------- Fixes: bcefa72923d5 ("driver core: generalize driver_override in struct device") Fixes: b7b6cc8f4378 ("driver core: platform: use generic driver_override infrastructure") Signed-off-by: Lin Ruifeng <linruifeng4@huawei.com> --- include/linux/device.h | 15 ++++++++++----- include/linux/platform_device.h | 6 ++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/linux/device.h b/include/linux/device.h index f6aef1f7171e..5bc8548486fe 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -147,8 +147,10 @@ struct bus_type { struct subsys_private *p; struct lock_class_key lock_key; - bool driver_override; bool need_parent_lock; +#ifndef __GENKSYMS__ + bool driver_override; +#endif }; extern int __must_check bus_register(struct bus_type *bus); @@ -1005,10 +1007,6 @@ struct device { core doesn't touch it */ void *driver_data; /* Driver data, set and get with dev_set/get_drvdata */ - struct { - const char *name; - spinlock_t lock; - } driver_override; struct dev_links_info links; struct dev_pm_info power; struct dev_pm_domain *pm_domain; @@ -1101,8 +1099,15 @@ struct device { #else KABI_RESERVE(2) #endif +#ifndef __GENKSYMS__ + struct { + const char *name; + spinlock_t lock; + } driver_override; +#else KABI_RESERVE(3) KABI_RESERVE(4) +#endif KABI_RESERVE(5) KABI_RESERVE(6) KABI_RESERVE(7) diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index eef1e77eb43b..5a2db0dc1ac1 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -30,6 +30,12 @@ struct platform_device { const struct platform_device_id *id_entry; +#ifndef __GENKSYMS__ + char *kabi_reserved_driver_override; +#else + char *driver_override; +#endif + /* MFD cell pointer */ struct mfd_cell *mfd_cell; -- 2.43.0