Orabug:
28968102
8bd274934987 adds a new element at the end of struct backing_dev_info.
struct backing_dev_info is embedded inside struct request_queue
and is usually allocated during request_queue allocation. However, some
out of tree modules also allocate this struct separately using
sizeof() or via direct inclusion in their own structs. This patch
essentially breaks KABI for such modules and can cause a mismatch in the
size of the allocated struct and lead to kernel crashes.
Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
Reviewed-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Reviewed-by: Shan Hai <shan.hai@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
/* Register BDI before referencing it from bdev */
bdi = &disk->queue->backing_dev_info;
- bdi_register_owner(bdi, disk_to_dev(disk));
+ bdi_register_dev(bdi, disk_devt(disk));
blk_register_region(disk_devt(disk), disk->minors, NULL,
exact_match, exact_lock, disk);
#include <linux/atomic.h>
#include <linux/sysctl.h>
#include <linux/workqueue.h>
-#include <linux/uek_kabi.h>
struct page;
struct device;
struct dentry *debug_dir;
struct dentry *debug_stats;
#endif
- UEK_KABI_EXTEND(struct device *owner)
};
struct backing_dev_info *inode_to_bdi(struct inode *inode);
int bdi_register(struct backing_dev_info *bdi, struct device *parent,
const char *fmt, ...);
int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
-int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner);
int __must_check bdi_setup_and_register(struct backing_dev_info *, char *);
void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages,
enum wb_reason reason);
}
EXPORT_SYMBOL(bdi_register_dev);
-int bdi_register_owner(struct backing_dev_info *bdi, struct device *owner)
-{
- int rc;
-
- rc = bdi_register(bdi, NULL, "%u:%u", MAJOR(owner->devt),
- MINOR(owner->devt));
- if (rc)
- return rc;
- bdi->owner = owner;
- get_device(owner);
- return 0;
-}
-EXPORT_SYMBOL(bdi_register_owner);
-
/*
* Remove bdi from the global list and shutdown any threads we have running
*/
bdi->dev = NULL;
}
- if (bdi->owner) {
- put_device(bdi->owner);
- bdi->owner = NULL;
- }
-
for (i = 0; i < NR_BDI_STAT_ITEMS; i++)
percpu_counter_destroy(&bdi->bdi_stat[i]);
fprop_local_destroy_percpu(&bdi->completions);