From 878e0bf16241f01e853313f4aba01c0f705f41e3 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:17 +0800 Subject: [PATCH 1/9] kabi: reserve space for kobject related structures hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I908BZ CVE: NA ------------------------------- Reserve space for the structures in kobject subsystem. Signed-off-by: Yu Liao --- include/linux/kobject.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c30affcc43b4..7b7c4a0e7838 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -15,6 +15,7 @@ #ifndef _KOBJECT_H_ #define _KOBJECT_H_ +#include #include #include #include @@ -79,6 +80,11 @@ struct kobject { #ifdef CONFIG_DEBUG_KOBJECT_RELEASE struct delayed_work release; #endif + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; __printf(2, 3) int kobject_set_name(struct kobject *kobj, const char *name, ...); @@ -120,6 +126,11 @@ struct kobj_type { const struct kobj_ns_type_operations *(*child_ns_type)(const struct kobject *kobj); const void *(*namespace)(const struct kobject *kobj); void (*get_ownership)(const struct kobject *kobj, kuid_t *uid, kgid_t *gid); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; struct kobj_uevent_env { @@ -170,6 +181,11 @@ struct kset { spinlock_t list_lock; struct kobject kobj; const struct kset_uevent_ops *uevent_ops; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) } __randomize_layout; void kset_init(struct kset *kset); -- Gitee From afb486dc0623336f157654e4b68e8d215f685b6b Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:18 +0800 Subject: [PATCH 2/9] kabi: reserve space for hrtimer related structures hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9083Y CVE: NA ------------------------------- Reserve space for hrtimer related structures. Signed-off-by: Yu Liao --- include/linux/hrtimer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index f2044d5a652b..4ea2b1a56a4e 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -20,6 +20,7 @@ #include #include #include +#include struct hrtimer_clock_base; struct hrtimer_cpu_base; @@ -124,6 +125,9 @@ struct hrtimer { u8 is_rel; u8 is_soft; u8 is_hard; + + KABI_RESERVE(1) + KABI_RESERVE(2) }; /** @@ -165,6 +169,9 @@ struct hrtimer_clock_base { struct timerqueue_head active; ktime_t (*get_time)(void); ktime_t offset; + + KABI_RESERVE(1) + KABI_RESERVE(2) } __hrtimer_clock_base_align; enum hrtimer_base_type { @@ -235,6 +242,9 @@ struct hrtimer_cpu_base { ktime_t softirq_expires_next; struct hrtimer *softirq_next_timer; struct hrtimer_clock_base clock_base[HRTIMER_MAX_CLOCK_BASES]; + + KABI_RESERVE(1) + KABI_RESERVE(2) } ____cacheline_aligned; static inline void hrtimer_set_expires(struct hrtimer *timer, ktime_t time) -- Gitee From 2dfc9100b92a7ca9ba2df18a7f53028bf8eb3698 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:19 +0800 Subject: [PATCH 3/9] kabi: reserve space for posix clock related structure hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I907ZP CVE: NA ------------------------------- Reserve space for posix clock related structure. Signed-off-by: Yu Liao --- include/linux/posix-clock.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/posix-clock.h b/include/linux/posix-clock.h index 468328b1e1dd..63f857d58435 100644 --- a/include/linux/posix-clock.h +++ b/include/linux/posix-clock.h @@ -12,6 +12,7 @@ #include #include #include +#include struct posix_clock; @@ -62,6 +63,11 @@ struct posix_clock_operations { ssize_t (*read) (struct posix_clock *pc, uint flags, char __user *buf, size_t cnt); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /** @@ -88,6 +94,11 @@ struct posix_clock { struct device *dev; struct rw_semaphore rwsem; bool zombie; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /** -- Gitee From 4cc2aaa804b444b343cbe039754f71dd719db104 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:20 +0800 Subject: [PATCH 4/9] kabi: reserve space for workqueue subsystem related structure hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9089C CVE: NA ------------------------------- Reserve space for workqueue subsystem. Signed-off-by: Yu Liao --- include/linux/workqueue.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 571dd2ec4381..145744ea23b9 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -6,6 +6,7 @@ #ifndef _LINUX_WORKQUEUE_H #define _LINUX_WORKQUEUE_H +#include #include #include #include @@ -102,6 +103,11 @@ struct work_struct { #ifdef CONFIG_LOCKDEP struct lockdep_map lockdep_map; #endif + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; #define WORK_DATA_INIT() ATOMIC_LONG_INIT((unsigned long)WORK_STRUCT_NO_POOL) @@ -117,6 +123,11 @@ struct delayed_work { int cpu; /* delayed_work private data, only used in pciehp now */ unsigned long data; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; struct rcu_work { -- Gitee From c998c1e941494b59f0059024cf4888aaf294d7c1 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:21 +0800 Subject: [PATCH 5/9] kabi: reserve space for struct ptp_clock_info hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9087L CVE: NA ------------------------------- reserve space for struct ptp_clock_info. Signed-off-by: Yu Liao --- include/linux/ptp_clock_kernel.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h index 1ef4e0f9bd2a..3c58193f4b0f 100644 --- a/include/linux/ptp_clock_kernel.h +++ b/include/linux/ptp_clock_kernel.h @@ -13,6 +13,7 @@ #include #include #include +#include #define PTP_CLOCK_NAME_LEN 32 /** @@ -193,6 +194,11 @@ struct ptp_clock_info { int (*verify)(struct ptp_clock_info *ptp, unsigned int pin, enum ptp_pin_function func, unsigned int chan); long (*do_aux_work)(struct ptp_clock_info *ptp); + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; struct ptp_clock; -- Gitee From 58c4beca4aa91f37c8f9f78c1f0f7ebee0154eb2 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:22 +0800 Subject: [PATCH 6/9] kabi: reserve space for struct timer_list hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I908BC -------------------------------- reserve space for struct timer_list. Signed-off-by: Yu Liao --- include/linux/timer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/timer.h b/include/linux/timer.h index 9162f275819a..0c0493e2466a 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -7,6 +7,7 @@ #include #include #include +#include struct timer_list { /* @@ -21,6 +22,9 @@ struct timer_list { #ifdef CONFIG_LOCKDEP struct lockdep_map lockdep_map; #endif + + KABI_RESERVE(1) + KABI_RESERVE(2) }; #ifdef CONFIG_LOCKDEP -- Gitee From 9384668e23cc061f7de105630a63193b28496b40 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:23 +0800 Subject: [PATCH 7/9] kabi: reserve space for struct worker hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I90837 CVE: NA ------------------------------- Reserve space for struct worker. Signed-off-by: Yu Liao --- kernel/workqueue_internal.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h index f6275944ada7..1b57cd5fafa7 100644 --- a/kernel/workqueue_internal.h +++ b/kernel/workqueue_internal.h @@ -11,6 +11,7 @@ #include #include #include +#include struct worker_pool; @@ -59,6 +60,11 @@ struct worker { /* used only by rescuers to point to the target workqueue */ struct workqueue_struct *rescue_wq; /* I: the workqueue to rescue */ + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /** -- Gitee From 922b69d5bc654e5f154cb3cf12be7c424393c62e Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:24 +0800 Subject: [PATCH 8/9] kabi: reserve space for struct clocksource hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I907UN CVE: NA ------------------------------- Reserve space for posix clock related structure. Signed-off-by: Yu Liao --- include/linux/clocksource.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 6c1989c7bb81..0a14b187f53c 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -20,6 +20,7 @@ #include #include #include +#include struct clocksource; struct module; @@ -131,6 +132,11 @@ struct clocksource { u64 wd_last; #endif struct module *owner; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; /* -- Gitee From f0110d15b095758f33fe31597f75ff1841fcefca Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 1 Feb 2024 09:40:25 +0800 Subject: [PATCH 9/9] kabi: reserve space for struct vdso_image hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I907Y4 CVE: NA ------------------------------- Reserve space for struct vdso_image. Signed-off-by: Yu Liao --- arch/x86/include/asm/vdso.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/vdso.h b/arch/x86/include/asm/vdso.h index d7f6592b74a9..8111df3a2910 100644 --- a/arch/x86/include/asm/vdso.h +++ b/arch/x86/include/asm/vdso.h @@ -5,6 +5,7 @@ #include #include #include +#include #ifndef __ASSEMBLER__ @@ -31,6 +32,11 @@ struct vdso_image { long sym_int80_landing_pad; long sym_vdso32_sigreturn_landing_pad; long sym_vdso32_rt_sigreturn_landing_pad; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) }; #ifdef CONFIG_X86_64 -- Gitee