hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZUFD
--------------------------------
The mtd_device_parse_register() and mtd_device_unregister() APIs are in the kabi trustlist. The involved structures are 'struct mtd_info', 'struct mtd_part_parser_data', and 'struct mtd_partition'.
These structures may still be changed. To prevent KABI incompatibility caused by CVE fixes in the future, these structures are reserved.
mtd_info: Important structure with a size of 1408 bytes. In the 2 slab objects, four KABI slots can be reserved for future expansion.
mtd_partition: Important structure with a size of 48 bytes. In 1 cache line space, two KABI slots can be reserved for future expansion.
mtd_part_parser_data: The size is 8 bytes. Three KABI slots can be reserved for future expansion.
Signed-off-by: ZhaoLong Wang wangzhaolong1@huawei.com --- include/linux/mtd/mtd.h | 5 +++++ include/linux/mtd/partitions.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 914a9f974baa..db3d3e6ec83f 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -13,6 +13,7 @@ #include <linux/device.h> #include <linux/of.h> #include <linux/nvmem-provider.h> +#include <linux/kabi.h>
#include <mtd/mtd-abi.h>
@@ -398,6 +399,10 @@ struct mtd_info {
struct mtd_part part; struct mtd_master master; + KABI_RESERVE(0) + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) };
static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd) diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index b74a539ec581..eb803128cef7 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h @@ -10,7 +10,7 @@ #define MTD_PARTITIONS_H
#include <linux/types.h> - +#include <linux/kabi.h>
/* * Partition definition structure: @@ -51,6 +51,8 @@ struct mtd_partition { uint32_t mask_flags; /* master MTD flags to mask out for this partition */ uint32_t add_flags; /* flags to add to the partition */ struct device_node *of_node; + KABI_RESERVE(0) + KABI_RESERVE(1) };
#define MTDPART_OFS_RETAIN (-3) @@ -68,6 +70,9 @@ struct device_node; */ struct mtd_part_parser_data { unsigned long origin; + KABI_RESERVE(0) + KABI_RESERVE(1) + KABI_RESERVE(2) };