From e8beb518cf4c6bcd4fe3ff1589b3b2bf18736343 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Mon, 11 Dec 2023 10:34:29 +0800 Subject: [PATCH] kabi: add paddings (part 2) Port padding from TK4, exclude: - bsg_ops, struct is gone - bsg_class_device, struct is gone - hd_struct, struct is gone - cgroup_cls_state, the new version is massive simplified, kabi adds too much overhead, padding done in cgroup_subsys_state instead Upstream: no Signed-off-by: Kairui Song --- block/blk-cgroup.h | 8 ++++++++ include/linux/backing-dev-defs.h | 5 +++++ include/linux/blk_types.h | 5 +++++ include/linux/blkdev.h | 5 +++++ include/linux/cgroup-defs.h | 10 ++++++++++ include/linux/cgroup_rdma.h | 3 +++ include/linux/dcache.h | 11 +++++++++++ include/linux/device/class.h | 5 +++++ include/linux/dma-map-ops.h | 7 +++++++ include/linux/ethtool.h | 9 +++++++++ include/linux/filelock.h | 6 ++++++ include/linux/fs.h | 19 +++++++++++++++++++ include/linux/fsnotify_backend.h | 5 +++++ include/linux/hugetlb_cgroup.h | 5 +++++ include/linux/ioport.h | 7 +++++++ include/linux/ipv6.h | 6 ++++++ include/linux/kernfs.h | 7 +++++++ include/linux/kobject.h | 8 ++++++++ include/linux/memcontrol.h | 5 +++++ include/linux/memremap.h | 2 ++ include/linux/mm.h | 1 + include/linux/mmu_notifier.h | 5 +++++ include/linux/mmzone.h | 6 ++++++ include/linux/module.h | 5 +++++ include/linux/net.h | 4 ++++ include/linux/netdevice.h | 32 ++++++++++++++++++++++++++++++++ include/linux/pci_hotplug.h | 7 +++++++ include/linux/perf_event.h | 5 +++++ include/linux/quota.h | 14 ++++++++++++++ include/linux/sched.h | 7 +++++++ include/linux/sched/signal.h | 1 + include/linux/stacktrace.h | 1 + include/linux/timer.h | 1 + include/linux/user_namespace.h | 5 +++++ include/linux/workqueue.h | 5 +++++ include/linux/writeback.h | 4 ++++ include/net/bond_3ad.h | 5 +++++ include/net/bonding.h | 3 +++ include/net/dcbnl.h | 6 ++++++ include/net/dst.h | 4 ++++ include/net/dst_ops.h | 6 ++++++ include/net/fib_rules.h | 6 ++++++ include/net/flow.h | 7 +++++++ include/net/genetlink.h | 9 +++++++++ include/net/l3mdev.h | 5 +++++ include/net/lwtunnel.h | 5 +++++ include/net/neighbour.h | 5 +++++ include/net/rtnetlink.h | 6 ++++++ include/net/sock.h | 11 +++++++++++ include/net/switchdev.h | 6 ++++++ include/net/tls.h | 4 ++++ include/net/xdp.h | 6 ++++++ include/net/xfrm.h | 6 ++++++ include/scsi/scsi_host.h | 1 - kernel/cgroup/cpuset.c | 5 +++++ kernel/cgroup/legacy_freezer.c | 5 +++++ kernel/cgroup/pids.c | 5 +++++ kernel/sched/sched.h | 8 ++++++++ security/device_cgroup.c | 5 +++++ 59 files changed, 369 insertions(+), 1 deletion(-) diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index fd482439afbc..dfce933bc9c3 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -114,6 +114,11 @@ struct blkcg { #ifdef CONFIG_CGROUP_WRITEBACK struct list_head cgwb_list; #endif + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; static inline struct blkcg *css_to_blkcg(struct cgroup_subsys_state *css) @@ -183,6 +188,9 @@ struct blkcg_policy { blkcg_pol_free_pd_fn *pd_free_fn; blkcg_pol_reset_pd_stats_fn *pd_reset_stats_fn; blkcg_pol_stat_pd_fn *pd_stat_fn; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; extern struct blkcg blkcg_root; diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h index 0c73242d5804..738ad224ef0f 100644 --- a/include/linux/backing-dev-defs.h +++ b/include/linux/backing-dev-defs.h @@ -203,6 +203,11 @@ struct backing_dev_info { #ifdef CONFIG_DEBUG_FS struct dentry *debug_dir; #endif + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; struct wb_lock_cookie { diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 2c1bbefd2ce1..b52febb082ee 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -75,6 +75,11 @@ struct block_device { * path */ struct device bd_device; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } __randomize_layout; #define bdev_whole(_bdev) \ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d63712824a54..1467a2fccd26 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -210,6 +210,11 @@ struct gendisk { * devices that do not have multiple independent access ranges. */ struct blk_independent_access_ranges *ia_ranges; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; static inline bool disk_live(struct gendisk *disk) diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 265da00a1a8b..97f5f0d48d72 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -200,6 +200,11 @@ struct cgroup_subsys_state { * fields of the containing structure. */ struct cgroup_subsys_state *parent; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; /* @@ -525,6 +530,11 @@ struct cgroup { struct bpf_local_storage __rcu *bpf_cgrp_storage; #endif + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); + /* All ancestors including self */ struct cgroup *ancestors[]; }; diff --git a/include/linux/cgroup_rdma.h b/include/linux/cgroup_rdma.h index 80edae03c313..b6c44a1083c0 100644 --- a/include/linux/cgroup_rdma.h +++ b/include/linux/cgroup_rdma.h @@ -24,6 +24,9 @@ struct rdma_cgroup { * that belongs to this cgroup. */ struct list_head rpools; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct rdmacg_device { diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 6b351e009f59..39d31a130376 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -14,6 +14,7 @@ #include #include #include +#include struct path; struct file; @@ -111,6 +112,11 @@ struct dentry { struct hlist_bl_node d_in_lookup_hash; /* only for in-lookup ones */ struct rcu_head d_rcu; } d_u; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } __randomize_layout; /* @@ -140,6 +146,11 @@ struct dentry_operations { struct vfsmount *(*d_automount)(struct path *); int (*d_manage)(const struct path *, bool); struct dentry *(*d_real)(struct dentry *, const struct inode *); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } ____cacheline_aligned; /* diff --git a/include/linux/device/class.h b/include/linux/device/class.h index abf3d3bfb6fe..0440487fbff0 100644 --- a/include/linux/device/class.h +++ b/include/linux/device/class.h @@ -19,6 +19,8 @@ #include #include +#include + struct device; struct fwnode_handle; @@ -69,6 +71,9 @@ struct class { void (*get_ownership)(const struct device *dev, kuid_t *uid, kgid_t *gid); const struct dev_pm_ops *pm; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct class_dev_iter { diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index f2fc203fb8a1..ef0296925336 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -10,6 +10,8 @@ #include #include +#include + struct cma; /* @@ -82,6 +84,11 @@ struct dma_map_ops { size_t (*max_mapping_size)(struct device *dev); size_t (*opt_mapping_size)(void); unsigned long (*get_merge_boundary)(struct device *dev); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; #ifdef CONFIG_DMA_OPS diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 1b523fd48586..369cd045c28a 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -912,6 +912,15 @@ struct ethtool_ops { int (*set_mm)(struct net_device *dev, struct ethtool_mm_cfg *cfg, struct netlink_ext_ack *extack); void (*get_mm_stats)(struct net_device *dev, struct ethtool_mm_stats *stats); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); + KABI_RESERVE(5); + KABI_RESERVE(6); + KABI_RESERVE(7); + KABI_RESERVE(8); }; int ethtool_check_ops(const struct ethtool_ops *ops); diff --git a/include/linux/filelock.h b/include/linux/filelock.h index 95e868e09e29..b5b14e17aab9 100644 --- a/include/linux/filelock.h +++ b/include/linux/filelock.h @@ -31,6 +31,9 @@ struct file_lock; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock *, struct file_lock *); void (*fl_release_private)(struct file_lock *); + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct lock_manager_operations { @@ -45,6 +48,9 @@ struct lock_manager_operations { bool (*lm_breaker_owns_lease)(struct file_lock *); bool (*lm_lock_expirable)(struct file_lock *cfl); void (*lm_expire_lock)(void); + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct lock_manager { diff --git a/include/linux/fs.h b/include/linux/fs.h index 227496acd5d1..d946bfce8b15 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -441,6 +441,9 @@ struct address_space_operations { sector_t *span); void (*swap_deactivate)(struct file *file); int (*swap_rw)(struct kiocb *iocb, struct iov_iter *iter); + + KABI_RESERVE(1); + KABI_RESERVE(2); }; extern const struct address_space_operations empty_aops; @@ -750,6 +753,9 @@ struct inode { struct fsverity_info *i_verity_info; #endif + KABI_RESERVE(1); + KABI_RESERVE(2); + void *i_private; /* fs or device private pointer */ } __randomize_layout; @@ -1897,6 +1903,11 @@ struct file_operations { int (*uring_cmd)(struct io_uring_cmd *ioucmd, unsigned int issue_flags); int (*uring_cmd_iopoll)(struct io_uring_cmd *, struct io_comp_batch *, unsigned int poll_flags); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } __randomize_layout; /* Wrap a directory iterator that needs exclusive inode access */ @@ -1947,6 +1958,11 @@ struct inode_operations { struct dentry *dentry, struct fileattr *fa); int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa); struct offset_ctx *(*get_offset_ctx)(struct inode *inode); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } ____cacheline_aligned; static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio, @@ -2329,6 +2345,9 @@ struct file_system_type { struct lock_class_key i_mutex_key; struct lock_class_key invalidate_lock_key; struct lock_class_key i_mutex_dir_key; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; #define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME) diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index c0892d75ce33..f4b29b3a6c9a 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -255,6 +255,11 @@ struct fsnotify_group { } fanotify_data; #endif /* CONFIG_FANOTIFY */ }; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; /* diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h index 3d82d91f49ac..0fbf036b094f 100644 --- a/include/linux/hugetlb_cgroup.h +++ b/include/linux/hugetlb_cgroup.h @@ -61,6 +61,11 @@ struct hugetlb_cgroup { /* Handle for "hugetlb.events.local" */ struct cgroup_file events_local_file[HUGE_MAX_HSTATE]; + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); + struct hugetlb_cgroup_per_node *nodeinfo[]; }; diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 25d768d48970..870ca579d606 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -14,6 +14,8 @@ #include #include #include + +#include /* * Resources are tree-like, allowing * nesting etc.. @@ -25,6 +27,11 @@ struct resource { unsigned long flags; unsigned long desc; struct resource *parent, *sibling, *child; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; /* diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index af8a771a053c..a0ccecd6b479 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -83,6 +83,12 @@ struct ipv6_devconf { __u8 ioam6_enabled; __u8 ndisc_evict_nocarrier; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); + struct ctl_table_header *sysctl_header; }; diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 2a36f3218b51..6b0cd3144fbb 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h @@ -242,6 +242,10 @@ struct kernfs_syscall_ops { const char *new_name); int (*show_path)(struct seq_file *sf, struct kernfs_node *kn, struct kernfs_root *root); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); }; struct kernfs_node *kernfs_root_to_node(struct kernfs_root *root); @@ -316,6 +320,9 @@ struct kernfs_ops { struct poll_table_struct *pt); int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma); + + KABI_RESERVE(1); + KABI_RESERVE(2); }; /* diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c30affcc43b4..ac3e8b3c13ec 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -79,6 +79,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 +123,8 @@ 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); }; struct kobj_uevent_env { @@ -170,6 +175,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); diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index e4e24da16d2c..8aa67b6bf91e 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -324,6 +324,11 @@ struct mem_cgroup { struct list_head event_list; spinlock_t event_list_lock; + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); + #ifdef CONFIG_TRANSPARENT_HUGEPAGE struct deferred_split deferred_split_queue; #endif diff --git a/include/linux/memremap.h b/include/linux/memremap.h index 68ce4ac56cac..822d72958c40 100644 --- a/include/linux/memremap.h +++ b/include/linux/memremap.h @@ -139,11 +139,13 @@ struct dev_pagemap { const struct dev_pagemap_ops *ops; void *owner; int nr_range; + KABI_RESERVE(1); KABI_RESERVE(2); KABI_RESERVE(3); KABI_RESERVE(4); KABI_RESERVE(5); + union { struct range range; DECLARE_FLEX_ARRAY(struct range, ranges); diff --git a/include/linux/mm.h b/include/linux/mm.h index 93aebbd51671..68b382a9036d 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -631,6 +631,7 @@ struct vm_operations_struct { */ struct page *(*find_special_page)(struct vm_area_struct *vma, unsigned long addr); + KABI_RESERVE(1); KABI_RESERVE(2); KABI_RESERVE(3); diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index 6e3c857606f1..14c2389f651b 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h @@ -221,6 +221,9 @@ struct mmu_notifier_ops { */ struct mmu_notifier *(*alloc_notifier)(struct mm_struct *mm); void (*free_notifier)(struct mmu_notifier *subscription); + + KABI_RESERVE(1); + KABI_RESERVE(2); }; /* @@ -240,6 +243,8 @@ struct mmu_notifier { struct mm_struct *mm; struct rcu_head rcu; unsigned int users; + + KABI_RESERVE(1); }; /** diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 4106fbc5b4b3..4174891f16f3 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -980,6 +980,9 @@ struct zone { /* Zone statistics */ atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; atomic_long_t vm_numa_event[NR_VM_NUMA_EVENT_ITEMS]; + + KABI_RESERVE(1); + KABI_RESERVE(2); } ____cacheline_internodealigned_in_smp; enum pgdat_flags { @@ -1398,6 +1401,9 @@ typedef struct pglist_data { #ifdef CONFIG_MEMORY_FAILURE struct memory_failure_stats mf_stats; #endif + + KABI_RESERVE(1); + KABI_RESERVE(2); } pg_data_t; #define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) diff --git a/include/linux/module.h b/include/linux/module.h index a98e188cf37b..b254feec517e 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -479,6 +479,11 @@ struct module { /* Section attributes */ struct module_sect_attrs *sect_attrs; + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); + /* Notes attributes */ struct module_notes_attrs *notes_attrs; #endif diff --git a/include/linux/net.h b/include/linux/net.h index c9b4a63791a4..dff3ccb603af 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -223,6 +223,10 @@ struct proto_ops { int (*sendmsg_locked)(struct sock *sk, struct msghdr *msg, size_t size); int (*set_rcvlowat)(struct sock *sk, int val); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); }; #define DECLARE_SOCKADDR(type, dst, src) \ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b8e60a20416b..722da431547f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -319,6 +319,9 @@ struct header_ops { const unsigned char *haddr); bool (*validate)(const char *ll_header, unsigned int len); __be16 (*parse_protocol)(const struct sk_buff *skb); + + KABI_RESERVE(1); + KABI_RESERVE(2); }; /* These flag bits are private to the generic network queueing @@ -380,6 +383,11 @@ struct napi_struct { /* control-path-only fields follow */ struct list_head dev_list; struct hlist_node napi_hash_node; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; enum { @@ -658,6 +666,10 @@ struct netdev_queue { #ifdef CONFIG_BQL struct dql dql; #endif + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } ____cacheline_aligned_in_smp; extern int sysctl_fb_tunnels_only_for_init_net; @@ -1038,6 +1050,11 @@ struct xfrmdev_ops { int (*xdo_dev_policy_add) (struct xfrm_policy *x, struct netlink_ext_ack *extack); void (*xdo_dev_policy_delete) (struct xfrm_policy *x); void (*xdo_dev_policy_free) (struct xfrm_policy *x); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; #endif @@ -1645,6 +1662,11 @@ struct net_device_ops { int (*ndo_hwtstamp_set)(struct net_device *dev, struct kernel_hwtstamp_config *kernel_config, struct netlink_ext_ack *extack); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; /** @@ -2417,6 +2439,11 @@ struct net_device { struct rtnl_hw_stats64 *offload_xstats_l3; struct devlink_port *devlink_port; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; #define to_net_dev(d) container_of(d, struct net_device, dev) @@ -2711,6 +2738,11 @@ struct packet_type { struct net *af_packet_net; void *af_packet_priv; struct list_head list; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; struct offload_callbacks { diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 3a10d6ec3ee7..84e8ad0fcd26 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h @@ -45,6 +45,10 @@ struct hotplug_slot_ops { int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); int (*reset_slot) (struct hotplug_slot *slot, bool probe); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); }; /** @@ -63,6 +67,9 @@ struct hotplug_slot { struct pci_slot *pci_slot; struct module *owner; const char *mod_name; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index e846f87e2d09..da572604d83e 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -1045,6 +1045,11 @@ struct perf_cgroup_info { struct perf_cgroup { struct cgroup_subsys_state css; struct perf_cgroup_info __percpu *info; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; /* diff --git a/include/linux/quota.h b/include/linux/quota.h index 07071e64abf3..d0920c08f9fc 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h @@ -306,6 +306,11 @@ struct dquot { loff_t dq_off; /* Offset of dquot on disk [dq_lock, stable once set] */ unsigned long dq_flags; /* See DQ_* */ struct mem_dqblk dq_dqb; /* Diskquota usage [dq_dqb_lock] */ + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; /* Operations which must be implemented by each quota format */ @@ -318,6 +323,9 @@ struct quota_format_ops { int (*commit_dqblk)(struct dquot *dquot); /* Write structure for one user */ int (*release_dqblk)(struct dquot *dquot); /* Called when last reference to dquot is being dropped */ int (*get_next_id)(struct super_block *sb, struct kqid *qid); /* Get next ID with existing structure in the quota file */ + + KABI_RESERVE(1); + KABI_RESERVE(2); }; /* Operations working with dquots */ @@ -337,6 +345,9 @@ struct dquot_operations { int (*get_inode_usage) (struct inode *, qsize_t *); /* Get next ID with active quota structure */ int (*get_next_id) (struct super_block *sb, struct kqid *qid); + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct path; @@ -440,6 +451,9 @@ struct quotactl_ops { int (*set_dqblk)(struct super_block *, struct kqid, struct qc_dqblk *); int (*get_state)(struct super_block *, struct qc_state *); int (*rm_xquota)(struct super_block *, unsigned int); + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct quota_format_type { diff --git a/include/linux/sched.h b/include/linux/sched.h index 2af5b490825f..a0a70331bbb6 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -612,6 +612,7 @@ struct sched_rt_entity { /* rq "owned" by this entity/group: */ struct rt_rq *my_q; #endif + KABI_RESERVE(1); KABI_RESERVE(2); } __randomize_layout; @@ -687,6 +688,7 @@ struct sched_dl_entity { */ struct sched_dl_entity *pi_se; #endif + KABI_RESERVE(1); KABI_RESERVE(2); KABI_RESERVE(3); @@ -1558,6 +1560,11 @@ struct task_struct { */ randomized_struct_fields_end + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); + /* CPU-specific state of this task: */ struct thread_struct thread; diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index e86cf6c39cbf..1eba5e1807f2 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -251,6 +251,7 @@ struct signal_struct { * creation time and not embedded directly into other structure. * So it is also safe to extend the size of the structure. */ + KABI_RESERVE(1); KABI_RESERVE(2); KABI_RESERVE(3); diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 97455880ac41..83d89897a2eb 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h @@ -83,6 +83,7 @@ struct stack_trace { unsigned int nr_entries, max_entries; unsigned long *entries; unsigned int skip; /* input argument: How many entries to skip */ + KABI_RESERVE(1); }; extern void save_stack_trace(struct stack_trace *trace); diff --git a/include/linux/timer.h b/include/linux/timer.h index ea19ae5479ad..bf8992384a1e 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -26,6 +26,7 @@ struct timer_list { KABI_RESERVE(1); KABI_RESERVE(2); + KABI_RESERVE(3); }; #ifdef CONFIG_LOCKDEP diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 45f09bec02c4..688585a99f97 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h @@ -102,6 +102,11 @@ struct user_namespace { struct ucounts *ucounts; long ucount_max[UCOUNT_COUNTS]; long rlimit_max[UCOUNT_RLIMIT_COUNTS]; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } __randomize_layout; struct ucounts { diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 24b1e5070f4d..0f78e6f7ae5d 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -102,6 +102,9 @@ struct work_struct { #ifdef CONFIG_LOCKDEP struct lockdep_map lockdep_map; #endif + + KABI_RESERVE(1); + KABI_RESERVE(2); }; #define WORK_DATA_INIT() ATOMIC_LONG_INIT((unsigned long)WORK_STRUCT_NO_POOL) @@ -115,6 +118,8 @@ struct delayed_work { /* target workqueue and CPU ->timer uses to queue ->work */ struct workqueue_struct *wq; int cpu; + + KABI_RESERVE(1); }; struct rcu_work { diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 083387c00f0c..5ba7a6aea416 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -89,6 +89,10 @@ struct writeback_control { size_t wb_lcand_bytes; /* bytes written by last candidate */ size_t wb_tcand_bytes; /* bytes written by this candidate */ #endif + + KABI_RESERVE(1); + KABI_RESERVE(2); + }; static inline blk_opf_t wbc_to_write_flags(struct writeback_control *wbc) diff --git a/include/net/bond_3ad.h b/include/net/bond_3ad.h index c5e57c6bd873..9d5f93ccff95 100644 --- a/include/net/bond_3ad.h +++ b/include/net/bond_3ad.h @@ -241,6 +241,11 @@ typedef struct port { struct port *next_port_in_aggregator; /* Next port on the linked list of the parent aggregator */ u32 transaction_id; /* continuous number for identification of Marker PDU's; */ struct lacpdu lacpdu; /* the lacpdu that will be sent for this port */ + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } port_t; /* system structure */ diff --git a/include/net/bonding.h b/include/net/bonding.h index 5b8b1b644a2d..6a53edaa2bf0 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h @@ -151,6 +151,9 @@ struct bond_params { /* 2 bytes of padding : see ether_addr_equal_64bits() */ u8 ad_actor_system[ETH_ALEN + 2]; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct slave { diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index 42207fc44660..de430967e650 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h @@ -9,6 +9,7 @@ #define __NET_DCBNL_H__ #include +#include struct net_device; @@ -131,6 +132,11 @@ struct dcbnl_rtnl_ops { /* rewrite */ int (*dcbnl_setrewr)(struct net_device *dev, struct dcb_app *app); int (*dcbnl_delrewr)(struct net_device *dev, struct dcb_app *app); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; #endif /* __NET_DCBNL_H__ */ diff --git a/include/net/dst.h b/include/net/dst.h index 78884429deed..c572f8b0589d 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -20,6 +20,7 @@ #include #include #include +#include struct sk_buff; @@ -92,6 +93,9 @@ struct dst_entry { #ifdef CONFIG_64BIT struct lwtunnel_state *lwtstate; #endif + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct dst_metrics { diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index 6d1c8541183d..489267a76e6b 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h @@ -4,6 +4,7 @@ #include #include #include +#include struct dst_entry; struct kmem_cachep; @@ -40,6 +41,11 @@ struct dst_ops { struct kmem_cache *kmem_cachep; + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); + struct percpu_counter pcpuc_entries ____cacheline_aligned_in_smp; }; diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 82da359bca03..3202ff674d59 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h @@ -11,6 +11,7 @@ #include #include #include +#include struct fib_kuid_range { kuid_t start; @@ -44,6 +45,11 @@ struct fib_rule { struct fib_rule_port_range sport_range; struct fib_rule_port_range dport_range; struct rcu_head rcu; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; struct fib_lookup_arg { diff --git a/include/net/flow.h b/include/net/flow.h index 335bbc52171c..ee72d4abf1d6 100644 --- a/include/net/flow.h +++ b/include/net/flow.h @@ -12,6 +12,7 @@ #include #include #include +#include struct flow_keys; @@ -42,6 +43,9 @@ struct flowi_common { kuid_t flowic_uid; __u32 flowic_multipath_hash; struct flowi_tunnel flowic_tun_key; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; union flowi_uli { @@ -88,6 +92,8 @@ struct flowi4 { #define fl4_icmp_code uli.icmpt.code #define fl4_mh_type uli.mht.type #define fl4_gre_key uli.gre_key + + KABI_RESERVE(1); } __attribute__((__aligned__(BITS_PER_LONG/8))); static inline void flowi4_init_output(struct flowi4 *fl4, int oif, @@ -149,6 +155,7 @@ struct flowi6 { #define fl6_mh_type uli.mht.type #define fl6_gre_key uli.gre_key __u32 mp_hash; + KABI_RESERVE(1); } __attribute__((__aligned__(BITS_PER_LONG/8))); struct flowi { diff --git a/include/net/genetlink.h b/include/net/genetlink.h index e18a4c0d69ee..fd5c88669752 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h @@ -5,6 +5,7 @@ #include #include #include +#include #define GENLMSG_DEFAULT_SIZE (NLMSG_DEFAULT_SIZE - GENL_HDRLEN) @@ -80,6 +81,10 @@ struct genl_family { const struct genl_small_ops *small_ops; const struct genl_split_ops *split_ops; const struct genl_multicast_group *mcgrps; + + KABI_RESERVE(1); + KABI_RESERVE(2); + struct module *module; /* private: internal use only */ @@ -193,6 +198,10 @@ struct genl_ops { u8 internal_flags; u8 flags; u8 validate; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); }; /** diff --git a/include/net/l3mdev.h b/include/net/l3mdev.h index 031c661aa14d..b48c93a70000 100644 --- a/include/net/l3mdev.h +++ b/include/net/l3mdev.h @@ -43,6 +43,11 @@ struct l3mdev_ops { /* IPv6 ops */ struct dst_entry * (*l3mdev_link_scope_lookup)(const struct net_device *dev, struct flowi6 *fl6); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; #ifdef CONFIG_NET_L3_MASTER_DEV diff --git a/include/net/lwtunnel.h b/include/net/lwtunnel.h index 53bd2d02a4f0..5aad2387019e 100644 --- a/include/net/lwtunnel.h +++ b/include/net/lwtunnel.h @@ -7,6 +7,7 @@ #include #include #include +#include #define LWTUNNEL_HASH_BITS 7 #define LWTUNNEL_HASH_SIZE (1 << LWTUNNEL_HASH_BITS) @@ -33,6 +34,10 @@ struct lwtunnel_state { int (*orig_output)(struct net *net, struct sock *sk, struct sk_buff *skb); int (*orig_input)(struct sk_buff *); struct rcu_head rcu; + + KABI_RESERVE(1); + KABI_RESERVE(2); + __u8 data[]; }; diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 0d28172193fa..0e7f0e9600ef 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -162,6 +163,10 @@ struct neighbour { struct rcu_head rcu; struct net_device *dev; netdevice_tracker dev_tracker; + + KABI_RESERVE(1); + KABI_RESERVE(2); + u8 primary_key[]; } __randomize_layout; diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index 6506221c5fe3..51496c02101d 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h @@ -4,6 +4,7 @@ #include #include +#include typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, struct netlink_ext_ack *); @@ -134,6 +135,11 @@ struct rtnl_link_ops { int (*fill_linkxstats)(struct sk_buff *skb, const struct net_device *dev, int *prividx, int attr); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; int __rtnl_link_register(struct rtnl_link_ops *ops); diff --git a/include/net/sock.h b/include/net/sock.h index 7753354d59c0..2b588ec727ed 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -69,6 +69,7 @@ #include #include #include +#include /* * This structure really needs to be cleaned up. @@ -545,6 +546,11 @@ struct sock { struct rcu_head sk_rcu; netns_tracker ns_tracker; struct hlist_node sk_bind2_node; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; enum sk_pacing { @@ -1367,6 +1373,11 @@ struct proto { struct list_head node; int (*diag_destroy)(struct sock *sk, int err); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } __randomize_layout; int proto_register(struct proto *prot, int alloc_slab); diff --git a/include/net/switchdev.h b/include/net/switchdev.h index a43062d4c734..3893b65ffb8b 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h @@ -11,6 +11,7 @@ #include #include #include +#include #define SWITCHDEV_F_NO_RECURSE BIT(0) #define SWITCHDEV_F_SKIP_EOPNOTSUPP BIT(1) @@ -90,6 +91,11 @@ struct switchdev_obj { u32 flags; void *complete_priv; void (*complete)(struct net_device *dev, int err, void *priv); + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; /* SWITCHDEV_OBJ_ID_PORT_VLAN */ diff --git a/include/net/tls.h b/include/net/tls.h index a2b44578dcb7..4ee2b6e83d0d 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -195,6 +196,9 @@ enum tls_context_flags { struct cipher_context { char *iv; char *rec_seq; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; union tls_crypto_context { diff --git a/include/net/xdp.h b/include/net/xdp.h index de08c8e0d134..11477ec86f2f 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -10,6 +10,7 @@ #include #include #include /* skb_shared_info */ +#include /** * DOC: XDP RX-queue information @@ -64,6 +65,11 @@ struct xdp_rxq_info { struct xdp_mem_info mem; unsigned int napi_id; u32 frag_size; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); } ____cacheline_aligned; /* perf critical, avoid false-sharing */ struct xdp_txq_info { diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 363c7d510554..65e671306320 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -124,6 +125,8 @@ struct xfrm_state_walk { u8 proto; u32 seq; struct xfrm_address_filter *filter; + + KABI_RESERVE(1); }; enum { @@ -150,6 +153,9 @@ struct xfrm_dev_offload { u8 dir : 2; u8 type : 2; u8 flags : 2; + + KABI_RESERVE(1); + KABI_RESERVE(2); }; struct xfrm_mode { diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index bb1cd0199745..ec24c3a543eb 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -715,7 +715,6 @@ struct Scsi_Host { */ struct device *dma_dev; - KABI_RESERVE(1); KABI_RESERVE(2); KABI_RESERVE(3); diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c index 4749e0c86c62..fad2047a8866 100644 --- a/kernel/cgroup/cpuset.c +++ b/kernel/cgroup/cpuset.c @@ -183,6 +183,11 @@ struct cpuset { /* Handle for cpuset.cpus.partition */ struct cgroup_file partition_file; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; /* diff --git a/kernel/cgroup/legacy_freezer.c b/kernel/cgroup/legacy_freezer.c index 122dacb3a443..0f119ef7452f 100644 --- a/kernel/cgroup/legacy_freezer.c +++ b/kernel/cgroup/legacy_freezer.c @@ -44,6 +44,11 @@ enum freezer_state_flags { struct freezer { struct cgroup_subsys_state css; unsigned int state; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; static DEFINE_MUTEX(freezer_mutex); diff --git a/kernel/cgroup/pids.c b/kernel/cgroup/pids.c index 7695e60bcb40..7c1665aae733 100644 --- a/kernel/cgroup/pids.c +++ b/kernel/cgroup/pids.c @@ -54,6 +54,11 @@ struct pids_cgroup { /* Number of times fork failed because limit was hit. */ atomic64_t events_limit; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; static struct pids_cgroup *css_pids(struct cgroup_subsys_state *css) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index eb03fc370ea0..c5d28a513675 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -316,6 +316,7 @@ struct dl_bw { raw_spinlock_t lock; u64 bw; u64 total_bw; + KABI_RESERVE(1); KABI_RESERVE(2); }; @@ -914,6 +915,7 @@ struct root_domain { KABI_RESERVE(1); KABI_RESERVE(2); KABI_RESERVE(3); + KABI_RESERVE(4); }; extern void init_defrootdomain(void); @@ -1938,6 +1940,9 @@ struct sched_group { int asym_prefer_cpu; /* CPU of highest priority in group */ int flags; + KABI_RESERVE(1); + KABI_RESERVE(2); + /* * The CPUs this group covers. * @@ -2320,6 +2325,9 @@ struct sched_class { #ifdef CONFIG_SCHED_CORE int (*task_is_throttled)(struct task_struct *p, int cpu); #endif + + KABI_RESERVE(1); + KABI_RESERVE(2); }; static inline void put_prev_task(struct rq *rq, struct task_struct *prev) diff --git a/security/device_cgroup.c b/security/device_cgroup.c index dc4df7475081..4b5279037dd9 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -44,6 +44,11 @@ struct dev_cgroup { struct cgroup_subsys_state css; struct list_head exceptions; enum devcg_behavior behavior; + + KABI_RESERVE(1); + KABI_RESERVE(2); + KABI_RESERVE(3); + KABI_RESERVE(4); }; static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s)