]> git.baikalelectronics.ru Git - kernel.git/commit
fs: add vfs_parse_fs_param_source() helper
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 14 Jul 2021 13:47:50 +0000 (15:47 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Jul 2021 16:19:06 +0000 (09:19 -0700)
commita2ff46076c4dc2be870a3ff7781045a6b803f27a
treeb1115033156bb1945244b3000489d84a4b5a68ee
parentd68216e420f2d7ff7fa3322d0fc515cc5876a910
fs: add vfs_parse_fs_param_source() helper

Add a simple helper that filesystems can use in their parameter parser
to parse the "source" parameter. A few places open-coded this function
and that already caused a bug in the cgroup v1 parser that we fixed.
Let's make it harder to get this wrong by introducing a helper which
performs all necessary checks.

Link: https://syzkaller.appspot.com/bug?id=6312526aba5beae046fdae8f00399f87aab48b12
Cc: Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fs_context.c
include/linux/fs_context.h
kernel/cgroup/cgroup-v1.c