* [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
@ 2024-04-29 23:55 classabbyamp
2024-04-30 0:26 ` classabbyamp
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: classabbyamp @ 2024-04-29 23:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
There is a new pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages no-write-for-you
https://github.com/void-linux/void-packages/pull/50124
[RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
protects against writing directly to block device nodes while they are mounted
A patch file from https://github.com/void-linux/void-packages/pull/50124.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-no-write-for-you-50124.patch --]
[-- Type: text/x-diff, Size: 2026 bytes --]
From 63313ee3f34f76fb1877972a9c57d99010a44f01 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Mon, 29 Apr 2024 19:50:20 -0400
Subject: [PATCH] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
protects against writing directly to block device nodes while they are mounted
---
srcpkgs/linux6.8/files/arm64-dotconfig | 2 +-
srcpkgs/linux6.8/files/i386-dotconfig | 2 +-
srcpkgs/linux6.8/files/x86_64-dotconfig | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/srcpkgs/linux6.8/files/arm64-dotconfig b/srcpkgs/linux6.8/files/arm64-dotconfig
index 0eea6c711dad1b..f179c61ef61c24 100644
--- a/srcpkgs/linux6.8/files/arm64-dotconfig
+++ b/srcpkgs/linux6.8/files/arm64-dotconfig
@@ -926,7 +926,7 @@ CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLK_DEV_INTEGRITY_T10=y
-CONFIG_BLK_DEV_WRITE_MOUNTED=y
+CONFIG_BLK_DEV_WRITE_MOUNTED=n
CONFIG_BLK_DEV_ZONED=y
CONFIG_BLK_DEV_THROTTLING=y
# CONFIG_BLK_DEV_THROTTLING_LOW is not set
diff --git a/srcpkgs/linux6.8/files/i386-dotconfig b/srcpkgs/linux6.8/files/i386-dotconfig
index 7694b33cdd9fa7..7e6c3f359f2748 100644
--- a/srcpkgs/linux6.8/files/i386-dotconfig
+++ b/srcpkgs/linux6.8/files/i386-dotconfig
@@ -892,7 +892,7 @@ CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLK_DEV_INTEGRITY_T10=y
-CONFIG_BLK_DEV_WRITE_MOUNTED=y
+CONFIG_BLK_DEV_WRITE_MOUNTED=n
CONFIG_BLK_DEV_ZONED=y
CONFIG_BLK_DEV_THROTTLING=y
# CONFIG_BLK_DEV_THROTTLING_LOW is not set
diff --git a/srcpkgs/linux6.8/files/x86_64-dotconfig b/srcpkgs/linux6.8/files/x86_64-dotconfig
index 9d35674fffd80f..de14554aae0499 100644
--- a/srcpkgs/linux6.8/files/x86_64-dotconfig
+++ b/srcpkgs/linux6.8/files/x86_64-dotconfig
@@ -969,7 +969,7 @@ CONFIG_BLK_ICQ=y
CONFIG_BLK_DEV_BSGLIB=y
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLK_DEV_INTEGRITY_T10=y
-CONFIG_BLK_DEV_WRITE_MOUNTED=y
+CONFIG_BLK_DEV_WRITE_MOUNTED=n
CONFIG_BLK_DEV_ZONED=y
CONFIG_BLK_DEV_THROTTLING=y
# CONFIG_BLK_DEV_THROTTLING_LOW is not set
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
2024-04-29 23:55 [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED classabbyamp
@ 2024-04-30 0:26 ` classabbyamp
2024-05-01 9:07 ` [PR PATCH] [Merged]: " classabbyamp
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: classabbyamp @ 2024-04-30 0:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 310 bytes --]
New comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/50124#issuecomment-2083934658
Comment:
cmdline option to reënable this is `bdev_allow_write_mounted`
also, more info on the option is [here](https://www.kernelconfig.io/CONFIG_BLK_DEV_WRITE_MOUNTED)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PR PATCH] [Merged]: [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
2024-04-29 23:55 [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED classabbyamp
2024-04-30 0:26 ` classabbyamp
@ 2024-05-01 9:07 ` classabbyamp
2024-05-04 10:53 ` dkwo
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: classabbyamp @ 2024-05-01 9:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
There's a merged pull request on the void-packages repository
[RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
https://github.com/void-linux/void-packages/pull/50124
Description:
protects against writing directly to block device nodes while they are mounted
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
2024-04-29 23:55 [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED classabbyamp
2024-04-30 0:26 ` classabbyamp
2024-05-01 9:07 ` [PR PATCH] [Merged]: " classabbyamp
@ 2024-05-04 10:53 ` dkwo
2024-05-04 12:02 ` ahesford
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dkwo @ 2024-05-04 10:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 820 bytes --]
New comment by dkwo on void-packages repository
https://github.com/void-linux/void-packages/pull/50124#issuecomment-2094118572
Comment:
With this, in linux 6.8.9 the runit boot scripts drop to an emergency shell when checking, as at this point it's still mounted ro I think:
```
=> Checking filesystems:
fsck.ext4: Device or resource busy while trying to open /dev/mapper/cryptroot-root
Filesystem mounted or opened exclusively by another program?
Cannot continue due to errors above, starting emergency shell.
```
Typing exit resumes the boot flow. The link above mentions this case:
> However there are some setups that need this capability
> like running fsck on read-only mounted root device, modifying some
> features on mounted ext4 filesystem, and similar.
What's the best way to address this?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
2024-04-29 23:55 [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED classabbyamp
` (2 preceding siblings ...)
2024-05-04 10:53 ` dkwo
@ 2024-05-04 12:02 ` ahesford
2024-05-04 13:42 ` classabbyamp
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: ahesford @ 2024-05-04 12:02 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/50124#issuecomment-2094139054
Comment:
Does `fsck` return a different value when it fails to open the device than when it detects errors? If so, we should make the core-service script aware of that and not panic if we can't run the check.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
2024-04-29 23:55 [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED classabbyamp
` (3 preceding siblings ...)
2024-05-04 12:02 ` ahesford
@ 2024-05-04 13:42 ` classabbyamp
2024-05-04 16:07 ` dkwo
2024-05-04 19:10 ` classabbyamp
6 siblings, 0 replies; 8+ messages in thread
From: classabbyamp @ 2024-05-04 13:42 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 260 bytes --]
New comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/50124#issuecomment-2094205535
Comment:
we could use fsck -M
> Do not check mounted filesystems and return an exit status of 0 for mounted filesystems.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
2024-04-29 23:55 [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED classabbyamp
` (4 preceding siblings ...)
2024-05-04 13:42 ` classabbyamp
@ 2024-05-04 16:07 ` dkwo
2024-05-04 19:10 ` classabbyamp
6 siblings, 0 replies; 8+ messages in thread
From: dkwo @ 2024-05-04 16:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
New comment by dkwo on void-packages repository
https://github.com/void-linux/void-packages/pull/50124#issuecomment-2094279822
Comment:
I think it's returining value 8.
That's an option. Alternatively, could the check be performed before mounting the filesystem?
For now, I added the option `bdev_allow_write_mounted=true` to my cmdline, as I think it's still valuable to check the root filesystem.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED
2024-04-29 23:55 [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED classabbyamp
` (5 preceding siblings ...)
2024-05-04 16:07 ` dkwo
@ 2024-05-04 19:10 ` classabbyamp
6 siblings, 0 replies; 8+ messages in thread
From: classabbyamp @ 2024-05-04 19:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 347 bytes --]
New comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/50124#issuecomment-2094350357
Comment:
8 indicates that *only* operational errors happened
and:
> The exit status returned when multiple filesystems are checked is the bit-wise OR of the exit statuses for each filesystem that is checked.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-05-04 19:10 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-29 23:55 [PR PATCH] [RFC] linux6.8: disable CONFIG_BLK_DEV_WRITE_MOUNTED classabbyamp
2024-04-30 0:26 ` classabbyamp
2024-05-01 9:07 ` [PR PATCH] [Merged]: " classabbyamp
2024-05-04 10:53 ` dkwo
2024-05-04 12:02 ` ahesford
2024-05-04 13:42 ` classabbyamp
2024-05-04 16:07 ` dkwo
2024-05-04 19:10 ` classabbyamp
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).