linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next 0/5] fs: fix possible null-ptr-deref when parsing param
@ 2022-10-23 16:39 Hawkins Jiawei
  2022-10-23 16:39 ` [PATCH -next 1/5] smb3: " Hawkins Jiawei
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Hawkins Jiawei @ 2022-10-23 16:39 UTC (permalink / raw)
  To: yin31149; +Cc: 18801353760, linux-kernel, linux-fsdevel

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, when fs parses its mount parameters, it will
dereferences the param->string, without checking whether it is a
null pointer, which may trigger a null-ptr-deref bug.

So this patchset reviews all functions for fs to parse parameters,
by using `git grep -n "\.parse_param" fs/*`, and adds sanity check
on param->string if its function will dereference param->string
without check.

Hawkins Jiawei (5):
  smb3: fix possible null-ptr-deref when parsing param
  nfs: fix possible null-ptr-deref when parsing param
  ceph: fix possible null-ptr-deref when parsing param
  gfs2: fix possible null-ptr-deref when parsing param
  proc: fix possible null-ptr-deref when parsing param

 fs/ceph/super.c      |  3 +++
 fs/cifs/fs_context.c | 58 +++++++++++++++++++++++++++++++++++++++++++-
 fs/gfs2/ops_fstype.c | 10 ++++++++
 fs/nfs/fs_context.c  |  6 +++++
 fs/proc/root.c       |  3 +++
 5 files changed, 79 insertions(+), 1 deletion(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-11-01  0:32 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-23 16:39 [PATCH -next 0/5] fs: fix possible null-ptr-deref when parsing param Hawkins Jiawei
2022-10-23 16:39 ` [PATCH -next 1/5] smb3: " Hawkins Jiawei
2022-10-23 16:39 ` [PATCH -next 2/5] nfs: " Hawkins Jiawei
2022-10-24 10:53   ` Jeff Layton
2022-10-23 16:39 ` [PATCH -next 3/5] ceph: " Hawkins Jiawei
2022-10-24  0:38   ` Xiubo Li
2022-10-24  0:55   ` Xiubo Li
2022-10-24  2:04     ` Hawkins Jiawei
2022-10-24  2:17       ` Xiubo Li
2022-10-23 16:39 ` [PATCH -next 4/5] gfs2: " Hawkins Jiawei
2022-10-24  9:42   ` Andreas Grünbacher
2022-10-23 16:39 ` [PATCH -next 5/5] proc: " Hawkins Jiawei
2022-10-23 16:48 ` [PATCH -next 0/5] fs: " Al Viro
2022-10-24  0:42   ` Hawkins Jiawei
2022-10-24  3:34     ` Ian Kent
2022-10-31 11:28       ` Tetsuo Handa
2022-11-01  0:32         ` Ian Kent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).