Merge tag 'gcc-plugins-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull structure randomization updates from Kees Cook: "Now that IPC and other changes have landed, enable manual markings for randstruct plugin, including the task_struct. This is the rest of what was staged in -next for the gcc-plugins, and comes in three patches, largest first: - mark "easy" structs with __randomize_layout - mark task_struct with an optional anonymous struct to isolate the __randomize_layout section - mark structs to opt _out_ of automated marking (which will come later) And, FWIW, this continues to pass allmodconfig (normal and patched to enable gcc-plugins) builds of x86_64, i386, arm64, arm, powerpc, and s390 for me" * tag 'gcc-plugins-v4.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: randstruct: opt-out externally exposed function pointer structs task_struct: Allow randomized layout randstruct: Mark various structs for randomization
This commit is contained in:
@@ -296,7 +296,7 @@ struct kiocb {
|
||||
void *private;
|
||||
int ki_flags;
|
||||
enum rw_hint ki_hint;
|
||||
};
|
||||
} __randomize_layout;
|
||||
|
||||
static inline bool is_sync_kiocb(struct kiocb *kiocb)
|
||||
{
|
||||
@@ -404,7 +404,7 @@ struct address_space {
|
||||
struct list_head private_list; /* ditto */
|
||||
void *private_data; /* ditto */
|
||||
errseq_t wb_err;
|
||||
} __attribute__((aligned(sizeof(long))));
|
||||
} __attribute__((aligned(sizeof(long)))) __randomize_layout;
|
||||
/*
|
||||
* On most architectures that alignment is already the case; but
|
||||
* must be enforced here for CRIS, to let the least significant bit
|
||||
@@ -447,7 +447,7 @@ struct block_device {
|
||||
int bd_fsfreeze_count;
|
||||
/* Mutex for freeze */
|
||||
struct mutex bd_fsfreeze_mutex;
|
||||
};
|
||||
} __randomize_layout;
|
||||
|
||||
/*
|
||||
* Radix-tree tags, for tagging dirty and writeback pages within the pagecache
|
||||
@@ -666,7 +666,7 @@ struct inode {
|
||||
#endif
|
||||
|
||||
void *i_private; /* fs or device private pointer */
|
||||
};
|
||||
} __randomize_layout;
|
||||
|
||||
static inline unsigned int i_blocksize(const struct inode *node)
|
||||
{
|
||||
@@ -883,7 +883,8 @@ struct file {
|
||||
#endif /* #ifdef CONFIG_EPOLL */
|
||||
struct address_space *f_mapping;
|
||||
errseq_t f_wb_err;
|
||||
} __attribute__((aligned(4))); /* lest something weird decides that 2 is OK */
|
||||
} __randomize_layout
|
||||
__attribute__((aligned(4))); /* lest something weird decides that 2 is OK */
|
||||
|
||||
struct file_handle {
|
||||
__u32 handle_bytes;
|
||||
@@ -1020,7 +1021,7 @@ struct file_lock {
|
||||
int state; /* state of grant or error if -ve */
|
||||
} afs;
|
||||
} fl_u;
|
||||
};
|
||||
} __randomize_layout;
|
||||
|
||||
struct file_lock_context {
|
||||
spinlock_t flc_lock;
|
||||
@@ -1412,7 +1413,7 @@ struct super_block {
|
||||
|
||||
spinlock_t s_inode_wblist_lock;
|
||||
struct list_head s_inodes_wb; /* writeback inodes */
|
||||
};
|
||||
} __randomize_layout;
|
||||
|
||||
/* Helper functions so that in most cases filesystems will
|
||||
* not need to deal directly with kuid_t and kgid_t and can
|
||||
@@ -1698,7 +1699,7 @@ struct file_operations {
|
||||
u64);
|
||||
ssize_t (*dedupe_file_range)(struct file *, u64, u64, struct file *,
|
||||
u64);
|
||||
};
|
||||
} __randomize_layout;
|
||||
|
||||
struct inode_operations {
|
||||
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
|
||||
|
Reference in New Issue
Block a user