[07/11] Kernel: Trigger BUG if data corruption is detected
Commit Message
Since we cannot trust the kernel to do the right thing (tm) in such a
situation anymore, triggering a BUG is less bad than running on a kernel
in an undefined state.
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
config/kernel/kernel.config.aarch64-ipfire | 4 ++--
config/kernel/kernel.config.armv6l-ipfire | 4 ++--
config/kernel/kernel.config.riscv64-ipfire | 4 ++--
config/kernel/kernel.config.x86_64-ipfire | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
Comments
I don’t quite follow what the benefit of this is.
The kernel would log something. That is it. Not bad, but I don’t see how this would help.
> On 19 Mar 2022, at 21:10, Peter Müller <peter.mueller@ipfire.org> wrote:
>
> Since we cannot trust the kernel to do the right thing (tm) in such a
> situation anymore, triggering a BUG is less bad than running on a kernel
> in an undefined state.
>
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> config/kernel/kernel.config.aarch64-ipfire | 4 ++--
> config/kernel/kernel.config.armv6l-ipfire | 4 ++--
> config/kernel/kernel.config.riscv64-ipfire | 4 ++--
> config/kernel/kernel.config.x86_64-ipfire | 4 ++--
> 4 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/config/kernel/kernel.config.aarch64-ipfire b/config/kernel/kernel.config.aarch64-ipfire
> index 356d9051d..06379d544 100644
> --- a/config/kernel/kernel.config.aarch64-ipfire
> +++ b/config/kernel/kernel.config.aarch64-ipfire
> @@ -8125,11 +8125,11 @@ CONFIG_STACKTRACE=y
> #
> # Debug kernel data structures
> #
> -# CONFIG_DEBUG_LIST is not set
> +CONFIG_DEBUG_LIST=y
Why did this have to be changed? CONFIG_BUG_ON_DATA_CORRUPTION does not depends on this as far as I can see.
> # CONFIG_DEBUG_PLIST is not set
> # CONFIG_DEBUG_SG is not set
> # CONFIG_DEBUG_NOTIFIERS is not set
> -# CONFIG_BUG_ON_DATA_CORRUPTION is not set
> +CONFIG_BUG_ON_DATA_CORRUPTION=y
> # end of Debug kernel data structures
>
> # CONFIG_DEBUG_CREDENTIALS is not set
> diff --git a/config/kernel/kernel.config.armv6l-ipfire b/config/kernel/kernel.config.armv6l-ipfire
> index 9dab473d4..68e37304a 100644
> --- a/config/kernel/kernel.config.armv6l-ipfire
> +++ b/config/kernel/kernel.config.armv6l-ipfire
> @@ -8091,11 +8091,11 @@ CONFIG_STACKTRACE=y
> #
> # Debug kernel data structures
> #
> -# CONFIG_DEBUG_LIST is not set
> +CONFIG_DEBUG_LIST=y
> # CONFIG_DEBUG_PLIST is not set
> # CONFIG_DEBUG_SG is not set
> # CONFIG_DEBUG_NOTIFIERS is not set
> -# CONFIG_BUG_ON_DATA_CORRUPTION is not set
> +CONFIG_BUG_ON_DATA_CORRUPTION=y
> # end of Debug kernel data structures
>
> # CONFIG_DEBUG_CREDENTIALS is not set
> diff --git a/config/kernel/kernel.config.riscv64-ipfire b/config/kernel/kernel.config.riscv64-ipfire
> index adef88dc9..8cec9a200 100644
> --- a/config/kernel/kernel.config.riscv64-ipfire
> +++ b/config/kernel/kernel.config.riscv64-ipfire
> @@ -6714,11 +6714,11 @@ CONFIG_STACKTRACE=y
> #
> # Debug kernel data structures
> #
> -# CONFIG_DEBUG_LIST is not set
> +CONFIG_DEBUG_LIST=y
> # CONFIG_DEBUG_PLIST is not set
> # CONFIG_DEBUG_SG is not set
> # CONFIG_DEBUG_NOTIFIERS is not set
> -# CONFIG_BUG_ON_DATA_CORRUPTION is not set
> +CONFIG_BUG_ON_DATA_CORRUPTION=y
> # end of Debug kernel data structures
>
> # CONFIG_DEBUG_CREDENTIALS is not set
> diff --git a/config/kernel/kernel.config.x86_64-ipfire b/config/kernel/kernel.config.x86_64-ipfire
> index 222b2dc53..0c6731bd1 100644
> --- a/config/kernel/kernel.config.x86_64-ipfire
> +++ b/config/kernel/kernel.config.x86_64-ipfire
> @@ -7556,11 +7556,11 @@ CONFIG_STACKTRACE=y
> #
> # Debug kernel data structures
> #
> -# CONFIG_DEBUG_LIST is not set
> +CONFIG_DEBUG_LIST=y
> # CONFIG_DEBUG_PLIST is not set
> # CONFIG_DEBUG_SG is not set
> # CONFIG_DEBUG_NOTIFIERS is not set
> -# CONFIG_BUG_ON_DATA_CORRUPTION is not set
> +CONFIG_BUG_ON_DATA_CORRUPTION=y
> # end of Debug kernel data structures
>
> # CONFIG_DEBUG_CREDENTIALS is not set
> --
> 2.34.1
@@ -8125,11 +8125,11 @@ CONFIG_STACKTRACE=y
#
# Debug kernel data structures
#
-# CONFIG_DEBUG_LIST is not set
+CONFIG_DEBUG_LIST=y
# CONFIG_DEBUG_PLIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
-# CONFIG_BUG_ON_DATA_CORRUPTION is not set
+CONFIG_BUG_ON_DATA_CORRUPTION=y
# end of Debug kernel data structures
# CONFIG_DEBUG_CREDENTIALS is not set
@@ -8091,11 +8091,11 @@ CONFIG_STACKTRACE=y
#
# Debug kernel data structures
#
-# CONFIG_DEBUG_LIST is not set
+CONFIG_DEBUG_LIST=y
# CONFIG_DEBUG_PLIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
-# CONFIG_BUG_ON_DATA_CORRUPTION is not set
+CONFIG_BUG_ON_DATA_CORRUPTION=y
# end of Debug kernel data structures
# CONFIG_DEBUG_CREDENTIALS is not set
@@ -6714,11 +6714,11 @@ CONFIG_STACKTRACE=y
#
# Debug kernel data structures
#
-# CONFIG_DEBUG_LIST is not set
+CONFIG_DEBUG_LIST=y
# CONFIG_DEBUG_PLIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
-# CONFIG_BUG_ON_DATA_CORRUPTION is not set
+CONFIG_BUG_ON_DATA_CORRUPTION=y
# end of Debug kernel data structures
# CONFIG_DEBUG_CREDENTIALS is not set
@@ -7556,11 +7556,11 @@ CONFIG_STACKTRACE=y
#
# Debug kernel data structures
#
-# CONFIG_DEBUG_LIST is not set
+CONFIG_DEBUG_LIST=y
# CONFIG_DEBUG_PLIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
-# CONFIG_BUG_ON_DATA_CORRUPTION is not set
+CONFIG_BUG_ON_DATA_CORRUPTION=y
# end of Debug kernel data structures
# CONFIG_DEBUG_CREDENTIALS is not set