Skip to contentSkip to conversation

xfs: deprecate the V4 format

PATCH Superseded Darrick J. Wong 3 participants 5 messages Sep 10, 2020 XFS filesystem

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: deprecate the V4 format

From: Darrick J. Wong <[email protected]>

The V4 filesystem format contains known weaknesses in the on-disk format that make metadata verification diffiult. In addition, the format will does not support dates past 2038 and will not be upgraded to do so. Therefore, we should start the process of retiring the old format to close off attack surfaces and to encourage users to migrate onto V5.

Therefore, make XFS V4 support a configurable option. For the first period it will be default Y in case some distributors want to withdraw support early; for the second period it will be default N so that anyone who wishes to continue support can do so; and after that, support will be removed from the kernel.

---
 fs/xfs/Kconfig     |   18 ++++++++++++++++++
 fs/xfs/xfs_mount.c |   11 +++++++++++
 2 files changed, 29 insertions(+)
fs/xfs/Kconfig +18 -0
index e685299eb3d2..db54ca9914c7 100644
@@ -22,6 +22,24 @@ config XFS_FS
 	  system of your root partition is compiled as a module, you'll need
 	  to use an initial ramdisk (initrd) to boot.
 
+config XFS_SUPPORT_V4
+	bool "Support deprecated V4 format"
+	default y
+	help
+	  The V4 filesystem format lacks certain features that are supported
+	  by the V5 format, such as metadata checksumming, strengthened
+	  metadata verification, and the ability to store timestamps past the
+	  year 2038.  Because of this, the V4 format is deprecated.  All users
+	  should upgrade by backing up their files, reformatting, and restoring
+	  from the backup.
+
+	  This option will become default N in September 2025.  Support for the
+	  V4 format will be removed entirely in September 2030.  Distributors
+	  can say N here to withdraw support earlier.
+
+	  To continue supporting the old V4 format, say Y.
+	  To close off an attack surface, say N.
+
 config XFS_QUOTA
 	bool "XFS Quota support"
 	depends on XFS_FS
fs/xfs/xfs_mount.c +11 -0
index ed69c4bfda71..48c0175b9457 100644
@@ -315,6 +315,17 @@ xfs_readsb(
 		goto release_buf;
 	}
 
+#ifndef CONFIG_XFS_SUPPORT_V4
+	/* V4 support is undergoing deprecation. */
+	if (!xfs_sb_version_hascrc(sbp)) {
+		if (loud)
+			xfs_warn(mp,
+	"Deprecated V4 format not supported by kernel.");
+		error = -EINVAL;
+		goto release_buf;
+	}
+#endif
+
 	/*
 	 * We must be able to do sector-sized and sector-aligned IO.
 	 */
#1 lore raw
Quoted 28 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

The V4 filesystem format contains known weaknesses in the on-disk format that make metadata verification diffiult. In addition, the format will does not support dates past 2038 and will not be upgraded to do so. Therefore, we should start the process of retiring the old format to close off attack surfaces and to encourage users to migrate onto V5.

Therefore, make XFS V4 support a configurable option. For the first period it will be default Y in case some distributors want to withdraw support early; for the second period it will be default N so that anyone who wishes to continue support can do so; and after that, support will be removed from the kernel.

---
 fs/xfs/Kconfig     |   18 ++++++++++++++++++
 fs/xfs/xfs_mount.c |   11 +++++++++++
 2 files changed, 29 insertions(+)
fs/xfs/Kconfig +0 -0
index e685299eb3d2..db54ca9914c7 100644
@@ -22,6 +22,24 @@ config XFS_FS
 	  system of your root partition is compiled as a module, you'll need
 	  to use an initial ramdisk (initrd) to boot.
 

fs/xfs/Kconfig config XFS_FS · line 34

Quoted 10 lines
fs/xfs/Kconfig +10 -0
+config XFS_SUPPORT_V4
+	bool "Support deprecated V4 format"
+	default y
+	help
+	  The V4 filesystem format lacks certain features that are supported
+	  by the V5 format, such as metadata checksumming, strengthened
+	  metadata verification, and the ability to store timestamps past the
+	  year 2038.  Because of this, the V4 format is deprecated.  All users
+	  should upgrade by backing up their files, reformatting, and restoring
+	  from the backup.

As Arekm pointed out, nobody outside of our clique knows what "V4" and "V5" means.

(there is no mention of such things in the mkfs.xfs(8) or xfs(5), for example)

admin-facing statements should probably reference CRC capability, not "V4/5"

-Eric

Quoted 33 lines
fs/xfs/Kconfig +7 -0
+	  This option will become default N in September 2025.  Support for the
+	  V4 format will be removed entirely in September 2030.  Distributors
+	  can say N here to withdraw support earlier.
+
+	  To continue supporting the old V4 format, say Y.
+	  To close off an attack surface, say N.
+
 config XFS_QUOTA
 	bool "XFS Quota support"
 	depends on XFS_FS
fs/xfs/xfs_mount.c +11 -0
index ed69c4bfda71..48c0175b9457 100644
@@ -315,6 +315,17 @@ xfs_readsb(
 		goto release_buf;
 	}
 
+#ifndef CONFIG_XFS_SUPPORT_V4
+	/* V4 support is undergoing deprecation. */
+	if (!xfs_sb_version_hascrc(sbp)) {
+		if (loud)
+			xfs_warn(mp,
+	"Deprecated V4 format not supported by kernel.");
+		error = -EINVAL;
+		goto release_buf;
+	}
+#endif
+
 	/*
 	 * We must be able to do sector-sized and sector-aligned IO.
 	 */
#2 lore raw
Quoted 42 lines · Eric Sandeen
Quoted 28 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

The V4 filesystem format contains known weaknesses in the on-disk format that make metadata verification diffiult. In addition, the format will does not support dates past 2038 and will not be upgraded to do so. Therefore, we should start the process of retiring the old format to close off attack surfaces and to encourage users to migrate onto V5.

Therefore, make XFS V4 support a configurable option. For the first period it will be default Y in case some distributors want to withdraw support early; for the second period it will be default N so that anyone who wishes to continue support can do so; and after that, support will be removed from the kernel.

---
 fs/xfs/Kconfig     |   18 ++++++++++++++++++
 fs/xfs/xfs_mount.c |   11 +++++++++++
 2 files changed, 29 insertions(+)
fs/xfs/Kconfig +0 -0
index e685299eb3d2..db54ca9914c7 100644
@@ -22,6 +22,24 @@ config XFS_FS
 	  system of your root partition is compiled as a module, you'll need
 	  to use an initial ramdisk (initrd) to boot.
 

fs/xfs/Kconfig config XFS_FS · line 34

Quoted 10 lines
fs/xfs/Kconfig +10 -0
+config XFS_SUPPORT_V4
+	bool "Support deprecated V4 format"
+	default y
+	help
+	  The V4 filesystem format lacks certain features that are supported
+	  by the V5 format, such as metadata checksumming, strengthened
+	  metadata verification, and the ability to store timestamps past the
+	  year 2038.  Because of this, the V4 format is deprecated.  All users
+	  should upgrade by backing up their files, reformatting, and restoring
+	  from the backup.

As Arekm pointed out, nobody outside of our clique knows what "V4" and "V5" means.

Quoted 3 lines

(there is no mention of such things in the mkfs.xfs(8) or xfs(5), for example)

admin-facing statements should probably reference CRC capability, not "V4/5"

Ok. "Deprecated V4 format (crc=0) not supported by kernel." then.

--D

Quoted 35 lines

-Eric

Quoted 33 lines
fs/xfs/Kconfig +7 -0
+	  This option will become default N in September 2025.  Support for the
+	  V4 format will be removed entirely in September 2030.  Distributors
+	  can say N here to withdraw support earlier.
+
+	  To continue supporting the old V4 format, say Y.
+	  To close off an attack surface, say N.
+
 config XFS_QUOTA
 	bool "XFS Quota support"
 	depends on XFS_FS
fs/xfs/xfs_mount.c +11 -0
index ed69c4bfda71..48c0175b9457 100644
@@ -315,6 +315,17 @@ xfs_readsb(
 		goto release_buf;
 	}
 
+#ifndef CONFIG_XFS_SUPPORT_V4
+	/* V4 support is undergoing deprecation. */
+	if (!xfs_sb_version_hascrc(sbp)) {
+		if (loud)
+			xfs_warn(mp,
+	"Deprecated V4 format not supported by kernel.");
+		error = -EINVAL;
+		goto release_buf;
+	}
+#endif
+
 	/*
 	 * We must be able to do sector-sized and sector-aligned IO.
 	 */
#3 lore raw
In reply to Darrick J. Wong
Quoted 57 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

The V4 filesystem format contains known weaknesses in the on-disk format that make metadata verification diffiult. In addition, the format will does not support dates past 2038 and will not be upgraded to do so. Therefore, we should start the process of retiring the old format to close off attack surfaces and to encourage users to migrate onto V5.

Therefore, make XFS V4 support a configurable option. For the first period it will be default Y in case some distributors want to withdraw support early; for the second period it will be default N so that anyone who wishes to continue support can do so; and after that, support will be removed from the kernel.

---
 fs/xfs/Kconfig     |   18 ++++++++++++++++++
 fs/xfs/xfs_mount.c |   11 +++++++++++
 2 files changed, 29 insertions(+)
fs/xfs/Kconfig +18 -0
index e685299eb3d2..db54ca9914c7 100644
@@ -22,6 +22,24 @@ config XFS_FS
 	  system of your root partition is compiled as a module, you'll need
 	  to use an initial ramdisk (initrd) to boot.
 
+config XFS_SUPPORT_V4
+	bool "Support deprecated V4 format"
+	default y
+	help
+	  The V4 filesystem format lacks certain features that are supported
+	  by the V5 format, such as metadata checksumming, strengthened
+	  metadata verification, and the ability to store timestamps past the
+	  year 2038.  Because of this, the V4 format is deprecated.  All users
+	  should upgrade by backing up their files, reformatting, and restoring
+	  from the backup.
+
+	  This option will become default N in September 2025.  Support for the
+	  V4 format will be removed entirely in September 2030.  Distributors
+	  can say N here to withdraw support earlier.
+
+	  To continue supporting the old V4 format, say Y.
+	  To close off an attack surface, say N.
+
 config XFS_QUOTA
 	bool "XFS Quota support"
 	depends on XFS_FS
fs/xfs/xfs_mount.c +0 -0
index ed69c4bfda71..48c0175b9457 100644
@@ -315,6 +315,17 @@ xfs_readsb(
 		goto release_buf;
 	}
 

fs/xfs/xfs_mount.c xfs_readsb( · line 327

Quoted 10 lines
fs/xfs/xfs_mount.c +10 -0
+#ifndef CONFIG_XFS_SUPPORT_V4
+	/* V4 support is undergoing deprecation. */
+	if (!xfs_sb_version_hascrc(sbp)) {
+		if (loud)
+			xfs_warn(mp,
+	"Deprecated V4 format not supported by kernel.");
+		error = -EINVAL;
+		goto release_buf;
+	}
+#endif

Fine by me.

You forgot to add the V4 format to the deprecation schedule in Documentation/filesystems/.....

<nggggh>

(where TF has this bit of XFS documentation been moved to???)

in Documentation/admin-guide/xfs.rst.

-Dave.

[ Why did that file get moved rather than just linked from it's original spot in all the -filesystem- documentation? Can we move it back, please, like all the other <filesystem>.rst files in Documentation/filesystems/ ? ]

Signature · 2 lines
Dave Chinner
[email protected]
#4 lore raw
Quoted 71 lines · Dave Chinner
Quoted 57 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

The V4 filesystem format contains known weaknesses in the on-disk format that make metadata verification diffiult. In addition, the format will does not support dates past 2038 and will not be upgraded to do so. Therefore, we should start the process of retiring the old format to close off attack surfaces and to encourage users to migrate onto V5.

Therefore, make XFS V4 support a configurable option. For the first period it will be default Y in case some distributors want to withdraw support early; for the second period it will be default N so that anyone who wishes to continue support can do so; and after that, support will be removed from the kernel.

---
 fs/xfs/Kconfig     |   18 ++++++++++++++++++
 fs/xfs/xfs_mount.c |   11 +++++++++++
 2 files changed, 29 insertions(+)
fs/xfs/Kconfig +18 -0
index e685299eb3d2..db54ca9914c7 100644
@@ -22,6 +22,24 @@ config XFS_FS
 	  system of your root partition is compiled as a module, you'll need
 	  to use an initial ramdisk (initrd) to boot.
 
+config XFS_SUPPORT_V4
+	bool "Support deprecated V4 format"
+	default y
+	help
+	  The V4 filesystem format lacks certain features that are supported
+	  by the V5 format, such as metadata checksumming, strengthened
+	  metadata verification, and the ability to store timestamps past the
+	  year 2038.  Because of this, the V4 format is deprecated.  All users
+	  should upgrade by backing up their files, reformatting, and restoring
+	  from the backup.
+
+	  This option will become default N in September 2025.  Support for the
+	  V4 format will be removed entirely in September 2030.  Distributors
+	  can say N here to withdraw support earlier.
+
+	  To continue supporting the old V4 format, say Y.
+	  To close off an attack surface, say N.
+
 config XFS_QUOTA
 	bool "XFS Quota support"
 	depends on XFS_FS
fs/xfs/xfs_mount.c +0 -0
index ed69c4bfda71..48c0175b9457 100644
@@ -315,6 +315,17 @@ xfs_readsb(
 		goto release_buf;
 	}
 

fs/xfs/xfs_mount.c xfs_readsb( · line 327

Quoted 10 lines
fs/xfs/xfs_mount.c +10 -0
+#ifndef CONFIG_XFS_SUPPORT_V4
+	/* V4 support is undergoing deprecation. */
+	if (!xfs_sb_version_hascrc(sbp)) {
+		if (loud)
+			xfs_warn(mp,
+	"Deprecated V4 format not supported by kernel.");
+		error = -EINVAL;
+		goto release_buf;
+	}
+#endif

Fine by me.

Quoted 8 lines

You forgot to add the V4 format to the deprecation schedule in Documentation/filesystems/.....

<nggggh>

(where TF has this bit of XFS documentation been moved to???)

in Documentation/admin-guide/xfs.rst.

Aha, I knew I was missing something! I looked for that this morning but couldn't find the file.

Quoted 6 lines

-Dave.

[ Why did that file get moved rather than just linked from it's original spot in all the -filesystem- documentation? Can we move it back, please, like all the other <filesystem>.rst files in Documentation/filesystems/ ? ]

I think it got moved to the administration guide since mount options and feature discussion is an ... administrative concern?

--D

Quoted 4 lines
Signature · 3 lines
-- 
Dave Chinner
[email protected]