Commit be413fc7 authored by ZhaoLong Wang's avatar ZhaoLong Wang
Browse files

mtd: kabi: Reserve KABI slots for mtd_device_xxx_register() related structures

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: default avatarZhaoLong Wang <wangzhaolong1@huawei.com>
parent 00dbf42e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd)
+6 −1
Original line number Diff line number Diff line
@@ -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(1)
	KABI_RESERVE(2)
};

#define MTDPART_OFS_RETAIN	(-3)
@@ -68,6 +70,9 @@ struct device_node;
 */
struct mtd_part_parser_data {
	unsigned long origin;
	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
};