Commit e87029a0 authored by ZhaoLong Wang's avatar ZhaoLong Wang Committed by Zheng Zengkai
Browse files

ubi: Reserve sufficient buffer length for the input mask

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I60L5U


CVE: NA

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

Because the mask received by the emulate_failures interface
is a 32-bit unsigned integer, ensure that there is sufficient
buffer length to receive and display this value.

Signed-off-by: default avatarZhaoLong Wang <wangzhaolong1@huawei.com>
Reviewed-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 43f32cb1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ static ssize_t dfs_file_read(struct file *file, char __user *user_buf,
	struct dentry *dent = file->f_path.dentry;
	struct ubi_device *ubi;
	struct ubi_debug_info *d;
	char buf[8];
	char buf[12];
	int val;

	ubi = ubi_get_device(ubi_num);
@@ -382,7 +382,7 @@ static ssize_t dfs_file_write(struct file *file, const char __user *user_buf,
	struct ubi_device *ubi;
	struct ubi_debug_info *d;
	size_t buf_size;
	char buf[8] = {0};
	char buf[14] = {0};
	int val;

	ubi = ubi_get_device(ubi_num);