]> git.baikalelectronics.ru Git - kernel.git/commit
debugfs: fix refcount imbalance in start_creating
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 4 Nov 2015 23:01:51 +0000 (00:01 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 11 Nov 2015 07:04:44 +0000 (02:04 -0500)
commit00f5c0aa56392bf74e2f58ea5ed85facd7f8c7e6
tree97cf1ee6fd2d9e07839529c4fb2befc926ad93f7
parentc1b89c894e3289eed7dce1684ee507530e4953ba
debugfs: fix refcount imbalance in start_creating

In debugfs' start_creating(), we pin the file system to safely access
its root. When we failed to create a file, we unpin the file system via
failed_creating() to release the mount count and eventually the reference
of the vfsmount.

However, when we run into an error during lookup_one_len() when still
in start_creating(), we only release the parent's mutex but not so the
reference on the mount. Looks like it was done in the past, but after
splitting portions of __create_file() into start_creating() and
end_creating() via 3b59c02f85a1 ("debugfs: split the beginning and the
end of __create_file() off"), this seemed missed. Noticed during code
review.

Fixes: 3b59c02f85a1 ("debugfs: split the beginning and the end of __create_file() off")
Cc: stable@vger.kernel.org # v4.0+
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/debugfs/inode.c