]> git.baikalelectronics.ru Git - kernel.git/commit
fs/mount_setattr: always cleanup mount_kattr
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 30 Dec 2021 19:23:09 +0000 (20:23 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 30 Dec 2021 23:12:13 +0000 (15:12 -0800)
commitc3097a2343f9ff942bfb8eb6c2079c76ce573e70
tree498edad3b725579e666efa4bec12762c9a071a13
parentc9d8496c08a8be7bdc6ecd03fbae9d6445569c5b
fs/mount_setattr: always cleanup mount_kattr

Make sure that finish_mount_kattr() is called after mount_kattr was
succesfully built in both the success and failure case to prevent
leaking any references we took when we built it.  We returned early if
path lookup failed thereby risking to leak an additional reference we
took when building mount_kattr when an idmapped mount was requested.

Cc: linux-fsdevel@vger.kernel.org
Cc: stable@vger.kernel.org
Fixes: f26c8433e409 ("fs: introduce MOUNT_ATTR_IDMAP")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namespace.c