From 976db620644d94c0ca0226fc0ef34051bcb85d3f Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Sun, 18 Feb 2024 16:51:02 +0800 Subject: [PATCH 1/6] 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c30affcc43b4..505dee42aaae 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,9 @@ struct kobject { #ifdef CONFIG_DEBUG_KOBJECT_RELEASE struct delayed_work release; #endif + + KABI_RESERVE(1) + KABI_RESERVE(2) }; __printf(2, 3) int kobject_set_name(struct kobject *kobj, const char *name, ...); @@ -120,6 +124,9 @@ 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) }; struct kobj_uevent_env { @@ -170,6 +177,9 @@ struct kset { spinlock_t list_lock; struct kobject kobj; const struct kset_uevent_ops *uevent_ops; + + KABI_RESERVE(1) + KABI_RESERVE(2) } __randomize_layout; void kset_init(struct kset *kset); -- Gitee From 5198aff39ac8b9d89328025381164ccc90d48465 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Sun, 18 Feb 2024 16:51:03 +0800 Subject: [PATCH 2/6] 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 6d47059d6823b1e87fd52c538bacefd416809530 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Sun, 18 Feb 2024 16:51:04 +0800 Subject: [PATCH 3/6] 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 8199aa8b5de2431aa6573a500dad2243af1d842f Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Sun, 18 Feb 2024 16:51:05 +0800 Subject: [PATCH 4/6] 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 c62b4b676683d2721a541d61f9a58fab14fa1e57 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Sun, 18 Feb 2024 16:51:06 +0800 Subject: [PATCH 5/6] 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..d7248545b2f6 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 654c3b93f6de242ac8780e5b528b8c05e0ef8c5d Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Sun, 18 Feb 2024 16:51:07 +0800 Subject: [PATCH 6/6] 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..df4a42f117e2 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