You need to sign in or sign up before continuing.
提交 0a7866f7 编写于 作者: T Tan Xiaojun 提交者: Xie XiuQi

kabi: reserve space for misc structure

hulk inclusion
category: feature
bugzilla: 13276
CVE: NA

-------------------------------

Reserve space for the structure in other subsystems.
Signed-off-by: NTan Xiaojun <tanxiaojun@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 afa79666
......@@ -162,6 +162,11 @@ struct bdi_writeback {
struct rcu_head rcu;
};
#endif
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
struct backing_dev_info {
......@@ -205,6 +210,11 @@ struct backing_dev_info {
struct dentry *debug_dir;
struct dentry *debug_stats;
#endif
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
enum {
......
......@@ -357,6 +357,9 @@ struct bio_integrity_payload {
struct bio_vec *bip_vec;
struct bio_vec bip_inline_vecs[0];/* embedded bvec array */
KABI_RESERVE(1)
KABI_RESERVE(2)
};
#if defined(CONFIG_BLK_DEV_INTEGRITY)
......@@ -761,6 +764,11 @@ struct bio_set {
struct bio_list rescue_list;
struct work_struct rescue_work;
struct workqueue_struct *rescue_workqueue;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
struct biovec_slab {
......
......@@ -67,6 +67,9 @@ struct bsg_job {
unsigned int reply_payload_rcv_len;
void *dd_data; /* Used for driver-specific storage */
KABI_RESERVE(1)
KABI_RESERVE(2)
};
void bsg_job_done(struct bsg_job *job, int result,
......
......@@ -13,6 +13,9 @@ struct bsg_ops {
fmode_t mode);
int (*complete_rq)(struct request *rq, struct sg_io_v4 *hdr);
void (*free_rq)(struct request *rq);
KABI_RESERVE(1)
KABI_RESERVE(2)
};
struct bsg_class_device {
......@@ -20,6 +23,9 @@ struct bsg_class_device {
int minor;
struct request_queue *queue;
const struct bsg_ops *ops;
KABI_RESERVE(1)
KABI_RESERVE(2)
};
int bsg_register_queue(struct request_queue *q, struct device *parent,
......
......@@ -2,6 +2,7 @@
#ifndef __LINUX_DCACHE_H
#define __LINUX_DCACHE_H
#include <linux/kabi.h>
#include <linux/atomic.h>
#include <linux/list.h>
#include <linux/rculist.h>
......@@ -117,6 +118,9 @@ 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)
} __randomize_layout;
/*
......@@ -146,6 +150,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;
/*
......
......@@ -12,6 +12,7 @@
#ifndef _DEVICE_H_
#define _DEVICE_H_
#include <linux/kabi.h>
#include <linux/ioport.h>
#include <linux/kobject.h>
#include <linux/klist.h>
......@@ -298,6 +299,11 @@ struct device_driver {
void (*coredump) (struct device *dev);
struct driver_private *p;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
......@@ -423,6 +429,11 @@ struct class {
const struct dev_pm_ops *pm;
struct subsys_private *p;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
struct class_dev_iter {
......@@ -1040,6 +1051,23 @@ struct device {
bool offline_disabled:1;
bool offline:1;
bool of_node_reused:1;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
KABI_RESERVE(5)
KABI_RESERVE(6)
KABI_RESERVE(7)
KABI_RESERVE(8)
KABI_RESERVE(9)
KABI_RESERVE(10)
KABI_RESERVE(11)
KABI_RESERVE(12)
KABI_RESERVE(13)
KABI_RESERVE(14)
KABI_RESERVE(15)
KABI_RESERVE(16)
};
static inline struct device *kobj_to_dev(struct kobject *kobj)
......
......@@ -118,6 +118,15 @@ struct elevator_mq_ops {
struct request *(*next_request)(struct request_queue *, struct request *);
void (*init_icq)(struct io_cq *);
void (*exit_icq)(struct io_cq *);
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
KABI_RESERVE(5)
KABI_RESERVE(6)
KABI_RESERVE(7)
KABI_RESERVE(8)
};
#define ELV_NAME_MAX (16)
......@@ -156,6 +165,11 @@ struct elevator_type
/* managed by elevator core */
char icq_cache_name[ELV_NAME_MAX + 6]; /* elvname + "_io_cq" */
struct list_head list;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
#define ELV_HASH_BITS 6
......
......@@ -2,6 +2,7 @@
#ifndef _LINUX_FS_H
#define _LINUX_FS_H
#include <linux/kabi.h>
#include <linux/linkage.h>
#include <linux/wait_bit.h>
#include <linux/kdev_t.h>
......@@ -393,6 +394,11 @@ struct address_space_operations {
int (*swap_activate)(struct swap_info_struct *sis, struct file *file,
sector_t *span);
void (*swap_deactivate)(struct file *file);
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
extern const struct address_space_operations empty_aops;
......@@ -427,6 +433,11 @@ struct address_space {
struct list_head private_list; /* for use by the address_space */
void *private_data; /* ditto */
errseq_t wb_err;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
} __attribute__((aligned(sizeof(long)))) __randomize_layout;
/*
* On most architectures that alignment is already the case; but
......@@ -471,6 +482,11 @@ struct block_device {
int bd_fsfreeze_count;
/* Mutex for freeze */
struct mutex bd_fsfreeze_mutex;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
} __randomize_layout;
/*
......@@ -690,6 +706,9 @@ struct inode {
#endif
void *i_private; /* fs or device private pointer */
KABI_RESERVE(1)
KABI_RESERVE(2)
} __randomize_layout;
static inline unsigned int i_blocksize(const struct inode *node)
......@@ -981,6 +1000,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 {
......@@ -993,6 +1015,9 @@ struct lock_manager_operations {
bool (*lm_break)(struct file_lock *);
int (*lm_change)(struct file_lock *, int, struct list_head *);
void (*lm_setup)(struct file_lock *, void **);
KABI_RESERVE(1)
KABI_RESERVE(2)
};
struct lock_manager {
......@@ -1773,6 +1798,11 @@ struct file_operations {
int (*dedupe_file_range)(struct file *, loff_t, struct file *, loff_t,
u64);
int (*fadvise)(struct file *, loff_t, loff_t, int);
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
} __randomize_layout;
struct inode_operations {
......@@ -1803,6 +1833,11 @@ struct inode_operations {
umode_t create_mode);
int (*tmpfile) (struct inode *, struct dentry *, umode_t);
int (*set_acl)(struct inode *, struct posix_acl *, int);
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,
......@@ -1883,6 +1918,11 @@ struct super_operations {
struct shrink_control *);
long (*free_cached_objects)(struct super_block *,
struct shrink_control *);
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
/*
......@@ -2142,6 +2182,11 @@ struct file_system_type {
struct lock_class_key i_lock_key;
struct lock_class_key i_mutex_key;
struct lock_class_key i_mutex_dir_key;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
#define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)
......
......@@ -130,6 +130,11 @@ struct hd_struct {
#endif
struct percpu_ref ref;
struct rcu_work rcu_work;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
#define GENHD_FL_REMOVABLE 1
......@@ -167,6 +172,9 @@ struct blk_integrity {
unsigned char tuple_size;
unsigned char interval_exp;
unsigned char tag_size;
KABI_RESERVE(1)
KABI_RESERVE(2)
};
#endif /* CONFIG_BLK_DEV_INTEGRITY */
......@@ -211,6 +219,11 @@ struct gendisk {
int node_id;
struct badblocks *bb;
struct lockdep_map lockdep_map;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
static inline struct gendisk *part_to_disk(struct hd_struct *part)
......
......@@ -2,6 +2,7 @@
#ifndef LINUX_IOMAP_H
#define LINUX_IOMAP_H 1
#include <linux/kabi.h>
#include <linux/atomic.h>
#include <linux/bitmap.h>
#include <linux/mm.h>
......@@ -99,6 +100,11 @@ struct iomap_ops {
*/
int (*iomap_end)(struct inode *inode, loff_t pos, loff_t length,
ssize_t written, unsigned flags, struct iomap *iomap);
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
/*
......
......@@ -10,6 +10,7 @@
#define _LINUX_IOPORT_H
#ifndef __ASSEMBLY__
#include <linux/kabi.h>
#include <linux/compiler.h>
#include <linux/types.h>
/*
......@@ -23,6 +24,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)
};
/*
......
......@@ -30,6 +30,7 @@
#ifndef _LINUX_IRQDOMAIN_H
#define _LINUX_IRQDOMAIN_H
#include <linux/kabi.h>
#include <linux/types.h>
#include <linux/irqhandler.h>
#include <linux/of.h>
......@@ -173,6 +174,11 @@ struct irq_domain {
struct dentry *debugfs_file;
#endif
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
/* reverse map data. The linear map gets appended to the irq_domain */
irq_hw_number_t hwirq_max;
unsigned int revmap_direct_max_irq;
......
......@@ -7,6 +7,7 @@
#ifndef __LINUX_KERNFS_H
#define __LINUX_KERNFS_H
#include <linux/kabi.h>
#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/list.h>
......@@ -177,6 +178,11 @@ 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)
KABI_RESERVE(4)
};
struct kernfs_root {
......@@ -266,6 +272,9 @@ struct kernfs_ops {
#ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lock_class_key lockdep_key;
#endif
KABI_RESERVE(1)
KABI_RESERVE(2)
};
#ifdef CONFIG_KERNFS
......
......@@ -15,6 +15,7 @@
#ifndef _KOBJECT_H_
#define _KOBJECT_H_
#include <linux/kabi.h>
#include <linux/types.h>
#include <linux/list.h>
#include <linux/sysfs.h>
......@@ -78,6 +79,11 @@ struct kobject {
unsigned int state_add_uevent_sent:1;
unsigned int state_remove_uevent_sent:1;
unsigned int uevent_suppress:1;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
extern __printf(2, 3)
......@@ -143,6 +149,11 @@ struct kobj_type {
const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj);
const void *(*namespace)(struct kobject *kobj);
void (*get_ownership)(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 {
......@@ -194,6 +205,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;
extern void kset_init(struct kset *kset);
......
......@@ -6,6 +6,7 @@
* Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
* Rewritten again by Rusty Russell, 2002
*/
#include <linux/kabi.h>
#include <linux/list.h>
#include <linux/stat.h>
#include <linux/compiler.h>
......@@ -486,6 +487,11 @@ struct module {
struct error_injection_entry *ei_funcs;
unsigned int num_ei_funcs;
#endif
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
} ____cacheline_aligned __randomize_layout;
#ifndef MODULE_ARCH_INIT
#define MODULE_ARCH_INIT {}
......
......@@ -32,6 +32,7 @@
#ifndef _LINUX_QUOTA_
#define _LINUX_QUOTA_
#include <linux/kabi.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/rwsem.h>
......@@ -316,6 +317,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 */
......@@ -335,6 +339,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;
......@@ -438,6 +445,11 @@ 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)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
struct quota_format_type {
......
......@@ -2,6 +2,7 @@
#ifndef __LINUX_STACKTRACE_H
#define __LINUX_STACKTRACE_H
#include <linux/kabi.h>
#include <linux/types.h>
struct task_struct;
......@@ -12,6 +13,9 @@ struct stack_trace {
unsigned int nr_entries, max_entries;
unsigned long *entries;
int skip; /* input argument: How many entries to skip */
KABI_RESERVE(1)
KABI_RESERVE(2)
};
extern void save_stack_trace(struct stack_trace *trace);
......
......@@ -2,6 +2,7 @@
#ifndef _LINUX_SWAP_H
#define _LINUX_SWAP_H
#include <linux/kabi.h>
#include <linux/spinlock.h>
#include <linux/linkage.h>
#include <linux/mmzone.h>
......@@ -272,6 +273,10 @@ struct swap_info_struct {
*/
struct work_struct discard_work; /* discard worker */
struct swap_cluster_list discard_clusters; /* discard clusters list */
KABI_RESERVE(1)
KABI_RESERVE(2)
struct plist_node avail_lists[0]; /*
* entries in swap_avail_heads, one
* entry per node.
......
......@@ -2,6 +2,7 @@
#ifndef _LINUX_TIMER_H
#define _LINUX_TIMER_H
#include <linux/kabi.h>
#include <linux/list.h>
#include <linux/ktime.h>
#include <linux/stddef.h>
......@@ -21,6 +22,11 @@ struct timer_list {
#ifdef CONFIG_LOCKDEP
struct lockdep_map lockdep_map;
#endif
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
#ifdef CONFIG_LOCKDEP
......
......@@ -2,6 +2,7 @@
#ifndef _LINUX_USER_NAMESPACE_H
#define _LINUX_USER_NAMESPACE_H
#include <linux/kabi.h>
#include <linux/kref.h>
#include <linux/nsproxy.h>
#include <linux/ns_common.h>
......@@ -76,6 +77,11 @@ struct user_namespace {
#endif
struct ucounts *ucounts;
int ucount_max[UCOUNT_COUNTS];
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
} __randomize_layout;
struct ucounts {
......
......@@ -6,6 +6,7 @@
#ifndef _LINUX_WORKQUEUE_H
#define _LINUX_WORKQUEUE_H
#include <linux/kabi.h>
#include <linux/timer.h>
#include <linux/linkage.h>
#include <linux/bitops.h>
......@@ -106,6 +107,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)
......@@ -119,6 +125,11 @@ struct delayed_work {
/* target workqueue and CPU ->timer uses to queue ->work */
struct workqueue_struct *wq;
int cpu;
KABI_RESERVE(1)
KABI_RESERVE(2)
KABI_RESERVE(3)
KABI_RESERVE(4)
};
struct rcu_work {
......
......@@ -5,6 +5,7 @@
#ifndef WRITEBACK_H
#define WRITEBACK_H
#include <linux/kabi.h>
#include <linux/sched.h>
#include <linux/workqueue.h>
#include <linux/fs.h>
......@@ -80,6 +81,9 @@ 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 int wbc_to_write_flags(struct writeback_control *wbc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册