kcov: remove stale RANDOMIZE_BASE text

Message ID 20231204171807.3313022-1-mark.rutland@arm.com
State New
Headers
Series kcov: remove stale RANDOMIZE_BASE text |

Commit Message

Mark Rutland Dec. 4, 2023, 5:18 p.m. UTC
  The Kconfig help text for CONFIG_KCOV describes that recorded PC values
will not be stable across machines or reboots when RANDOMIZE_BASE is
selected. This was the case when KCOV was introduced in commit:

  5c9a8750a6409c63 ("kernel: add kcov code coverage")

However, this changed in commit:

  4983f0ab7ffaad1e ("kcov: make kcov work properly with KASLR enabled")

Since that commit KCOV always subtracts the KASLR offset from PC values,
which ensures that these are stable across machines and across reboots
even when RANDOMIZE_BASE is selected.

Unfortunately, that commit failed to update the Kconfig help text, which
still suggests disabling RANDOMIZE_BASE even though this is no longer
necessary.

Remove the stale Kconfig text.

Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Popov <alex.popov@linux.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
---
 lib/Kconfig.debug | 4 ----
 1 file changed, 4 deletions(-)
  

Comments

Dmitry Vyukov Dec. 4, 2023, 5:58 p.m. UTC | #1
On Mon, 4 Dec 2023 at 18:18, Mark Rutland <mark.rutland@arm.com> wrote:
>
> The Kconfig help text for CONFIG_KCOV describes that recorded PC values
> will not be stable across machines or reboots when RANDOMIZE_BASE is
> selected. This was the case when KCOV was introduced in commit:
>
>   5c9a8750a6409c63 ("kernel: add kcov code coverage")
>
> However, this changed in commit:
>
>   4983f0ab7ffaad1e ("kcov: make kcov work properly with KASLR enabled")
>
> Since that commit KCOV always subtracts the KASLR offset from PC values,
> which ensures that these are stable across machines and across reboots
> even when RANDOMIZE_BASE is selected.
>
> Unfortunately, that commit failed to update the Kconfig help text, which
> still suggests disabling RANDOMIZE_BASE even though this is no longer
> necessary.
>
> Remove the stale Kconfig text.
>
> Reported-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Alexander Popov <alex.popov@linux.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Andrey Konovalov <andreyknvl@gmail.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>

Reviewed-by: Dmitry Vyukov <dvyukov@google.com>

Thanks for fixing this.

> ---
>  lib/Kconfig.debug | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index cc7d53d9dc019..e77873cf85c78 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -2103,10 +2103,6 @@ config KCOV
>           KCOV exposes kernel code coverage information in a form suitable
>           for coverage-guided fuzzing (randomized testing).
>
> -         If RANDOMIZE_BASE is enabled, PC values will not be stable across
> -         different machines and across reboots. If you need stable PC values,
> -         disable RANDOMIZE_BASE.
> -
>           For more details, see Documentation/dev-tools/kcov.rst.
>
>  config KCOV_ENABLE_COMPARISONS
> --
> 2.30.2
>
  

Patch

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index cc7d53d9dc019..e77873cf85c78 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2103,10 +2103,6 @@  config KCOV
 	  KCOV exposes kernel code coverage information in a form suitable
 	  for coverage-guided fuzzing (randomized testing).
 
-	  If RANDOMIZE_BASE is enabled, PC values will not be stable across
-	  different machines and across reboots. If you need stable PC values,
-	  disable RANDOMIZE_BASE.
-
 	  For more details, see Documentation/dev-tools/kcov.rst.
 
 config KCOV_ENABLE_COMPARISONS