Skip to contentSkip to conversation

udf: fix nls leak on udf_fill_super() failure

PATCH Merged Al Viro 3 participants 4 messages Feb 11 – Jun 15

Subsystems (2)
lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

PATCH 1/1 udf: fix nls leak on udf_fill_super() failure

[in viro/vfs.git #fixes at the moment; if you want to put it through your tree, just say so]

On all failure exits that go to error_out there we have already moved the nls reference from uopt->nls_map to sbi->s_nls_map, leaving NULL behind.

Fixes c4e89cc674ac ("udf: convert to new mount API")

---

fs/udf/super.c +1 -1
index b2f168b0a0d1..97a51c64ad48 100644
@@ -2320,7 +2320,7 @@ static int udf_fill_super(struct super_block *sb, struct fs_context *fc)
 
 error_out:
 	iput(sbi->s_vat_inode);
-	unload_nls(uopt->nls_map);
+	unload_nls(sbi->s_nls_map);
 	if (lvid_open)
 		udf_close_lvid(sb);
 	brelse(sbi->s_lvid_bh);
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Al Viro

[in viro/vfs.git #fixes at the moment; if you want to put it through your tree, just say so]

On all failure exits that go to error_out there we have already moved the nls reference from uopt->nls_map to sbi->s_nls_map, leaving NULL behind.

Fixes c4e89cc674ac ("udf: convert to new mount API")

Thanks for catching this! It's fine if you merge it so feel free to add:

Honza

Quoted 14 lines

---

fs/udf/super.c +1 -1
index b2f168b0a0d1..97a51c64ad48 100644
@@ -2320,7 +2320,7 @@ static int udf_fill_super(struct super_block *sb, struct fs_context *fc)
 
 error_out:
 	iput(sbi->s_vat_inode);
-	unload_nls(uopt->nls_map);
+	unload_nls(sbi->s_nls_map);
 	if (lvid_open)
 		udf_close_lvid(sb);
 	brelse(sbi->s_lvid_bh);
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
author maintainer
#2 lore raw

[git pull] old udf fix

[just noticed that udf fix had been sitting in #fixes since February; still applicable, Jan's Acked-by applied, very belated pull request follows]

The following changes since commit 2005aabe94eaab8608879d98afb901bc99bc3a31:

functionfs: use spinlock for FFS_DEACTIVATED/FFS_CLOSING transitions (2026-02-05 13:53:12 -0500)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git tags/pull-fixes

for you to fetch changes up to 462bdd08fbdf41db223c6117d907c8fd68d666ea:

udf: fix nls leak on udf_fill_super() failure (2026-06-14 22:29:21 -0400)

----------------------------------------------------------------
old udf fix that had fallen through the cracks...

----------------------------------------------------------------
Al Viro (1):
udf: fix nls leak on udf_fill_super() failure

 fs/udf/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
merge bot Merged
#3 lore raw

Re: [git pull] old udf fix

The pull request you sent on Mon, 15 Jun 2026 03:36:21 +0100:

The pull request you sent on Mon, 15 Jun 2026 03:36:21 +0100:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git tags/pull-fixes

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/0e0611827f3349d0a2ac121c023a6d3260dcecdb

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html