From f0ab4fc925a8e9d79f45a8aa5723ca7f4d14c22c Mon Sep 17 00:00:00 2001 From: zhangkaixiang Date: Tue, 17 Jan 2023 19:13:13 +0800 Subject: [PATCH] hmdfs: fix up the problem of param size limitation ohos inclusion category: bugfix issue: I6AX9W CVE: NA ---------------------------------------------- fix up the problem of param size limitation Signed-off-by: zhangkaixiang --- fs/hmdfs/super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/hmdfs/super.c b/fs/hmdfs/super.c index 52cc857f5e45..9b97e2f60e14 100644 --- a/fs/hmdfs/super.c +++ b/fs/hmdfs/super.c @@ -79,7 +79,13 @@ int hmdfs_parse_options(struct hmdfs_sb_info *sbi, const char *data) unsigned int user_id = 0; struct super_block *sb = sbi->sb; int err = 0; + size_t size = 0; + size = strlen(data); + if (size >= HMDFS_PAGE_SIZE) { + return -EINVAL; + } + options = kstrdup(data, GFP_KERNEL); if (data && !options) { err = -ENOMEM; -- Gitee