Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 9caccd41541a ("fs: introduce MOUNT_ATTR_IDMAP")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christian Brauner and committed by
Linus Torvalds
012e3322 74c78b42

+4 -5
+4 -5
fs/namespace.c
··· 4263 4263 return err; 4264 4264 4265 4265 err = user_path_at(dfd, path, kattr.lookup_flags, &target); 4266 - if (err) 4267 - return err; 4268 - 4269 - err = do_mount_setattr(&target, &kattr); 4266 + if (!err) { 4267 + err = do_mount_setattr(&target, &kattr); 4268 + path_put(&target); 4269 + } 4270 4270 finish_mount_kattr(&kattr); 4271 - path_put(&target); 4272 4271 return err; 4273 4272 } 4274 4273