From: Steve Magnani <steve.magnani@digidescorp.com>
To: jack@suse.com
Cc: linux-kernel@vger.kernel.org,
"Steven J . Magnani" <steve@digidescorp.com>
Subject: [PATCH] udf: disallow RW mount without valid integrity descriptor
Date: Mon, 11 Feb 2019 08:24:38 -0600 [thread overview]
Message-ID: <20190211142438.16599-1-steve@digidescorp.com> (raw)
Refuse to mount a volume read-write without a coherent Logical Volume
Integrity Descriptor, because we can't generate truly unique IDs without
one.
This fixes a bug where all inodes created on a UDF filesystem following
mount without a coherent LVID are assigned UID 0.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
---
--- a/fs/udf/super.c 2018-11-16 06:43:00.622344354 -0600
+++ b/fs/udf/super.c 2019-02-11 08:08:00.478331631 -0600
@@ -1474,6 +1474,17 @@ static int udf_load_logicalvol(struct su
if (lvd->integritySeqExt.extLength)
udf_load_logicalvolint(sb, leea_to_cpu(lvd->integritySeqExt));
ret = 0;
+
+ if (!sbi->s_lvid_bh) {
+ /* We can't generate UIDs without a valid LVID */
+ if (sb_rdonly(sb))
+ UDF_SET_FLAG(sb, UDF_FLAG_RW_INCOMPAT);
+ else {
+ udf_warn(sb, "Damaged or missing LVID, forcing "
+ "readonly mount\n");
+ ret = -EACCES;
+ }
+ }
out_bh:
brelse(bh);
return ret;
next reply other threads:[~2019-02-11 16:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 14:24 Steve Magnani [this message]
2019-02-11 17:32 ` [PATCH] udf: disallow RW mount without valid integrity descriptor Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190211142438.16599-1-steve@digidescorp.com \
--to=steve.magnani@digidescorp.com \
--cc=jack@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=steve@digidescorp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).