LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] udf: disallow RW mount without valid integrity descriptor
@ 2019-02-11 14:24 Steve Magnani
  2019-02-11 17:32 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Magnani @ 2019-02-11 14:24 UTC (permalink / raw)
  To: jack; +Cc: linux-kernel, Steven J . Magnani

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] udf: disallow RW mount without valid integrity descriptor
  2019-02-11 14:24 [PATCH] udf: disallow RW mount without valid integrity descriptor Steve Magnani
@ 2019-02-11 17:32 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2019-02-11 17:32 UTC (permalink / raw)
  To: Steve Magnani; +Cc: jack, linux-kernel, Steven J . Magnani

On Mon 11-02-19 08:24:38, Steve Magnani wrote:
> 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>

Thanks. Added to my tree.

								Honza

> ---
> --- 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;
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 14:24 [PATCH] udf: disallow RW mount without valid integrity descriptor Steve Magnani
2019-02-11 17:32 ` Jan Kara

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox