Bug 4370 - [ANCK 5.10] nfs: fix possible null-ptr-deref when parsing param
Summary: [ANCK 5.10] nfs: fix possible null-ptr-deref when parsing param
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: fs (show other bugs) fs
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: zhangyue5
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-06 14:54 UTC by zhangyue5
Modified: 2023-03-07 09:52 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhangyue5 2023-03-06 14:54:23 UTC
Description of problem:


According to commit "vfs: parse: deal with zero length string value",
kernel will set the param->string to null pointer in vfs_parse_fs_string()
if fs string has zero length.

Yet the problem is that, nfs_fs_context_parse_param() will dereferences the
param->string, without checking whether it is a null pointer, which may
trigger a null-ptr-deref bug.

This patch solves it by adding sanity check on param->string
in nfs_fs_context_parse_param().

Signed-off-by: Hawkins Jiawei <yin31149@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Comment 1 Joseph Qi alibaba_cloud_group 2023-03-07 09:52:56 UTC
Merge.
https://gitee.com/anolis/cloud-kernel/pulls/1370