From 41d01b6ed2b3db65585dd45d7968a45049def0ec 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 a4b1170153b3..18f222c6d4cc 100644 --- a/fs/hmdfs/super.c +++ b/fs/hmdfs/super.c @@ -81,7 +81,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