2020-05-11 06:31:22

by Zong Li

[permalink] [raw]
Subject: [PATCH 0/2] Bugs fix up for DEBUG_WX

These patches fix some bugs of DEBUG_WX. The first one is removing the
name of arm64 page talbe use. The second one is adding MMU dependency,
otherwise, it causes build error on NOMMU system, which reported by
kbuild test.

Zong Li (2):
mm: remove the specific name of arm64
mm: add MMU dependency for DEBUG_WX

mm/Kconfig.debug | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--
2.26.2


2020-05-11 06:32:02

by Zong Li

[permalink] [raw]
Subject: [PATCH 1/2] mm: remove the specific name of arm64

UXN is the name of arm64 page-table descriptors.

Signed-off-by: Zong Li <[email protected]>
CC: Will Deacon <[email protected]>
---
mm/Kconfig.debug | 2 --
1 file changed, 2 deletions(-)

diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug
index e19f94c6df90..b8cbe035247f 100644
--- a/mm/Kconfig.debug
+++ b/mm/Kconfig.debug
@@ -130,8 +130,6 @@ config DEBUG_WX

This is useful for discovering cases where the kernel is leaving W+X
mappings after applying NX, as such mappings are a security risk.
- This check also includes UXN, which should be set on all kernel
- mappings.

Look for a message in dmesg output like this:

--
2.26.2

2020-05-11 06:33:25

by Zong Li

[permalink] [raw]
Subject: [PATCH 2/2] mm: add MMU dependency for DEBUG_WX

DEBUG_WX should be enabled on MMU system. It had got build error when
enabling DEBUG_WX on NOMMU.

Signed-off-by: Zong Li <[email protected]>
Reported-by: kbuild test robot <[email protected]>
---
mm/Kconfig.debug | 1 +
1 file changed, 1 insertion(+)

diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug
index b8cbe035247f..2409f7fc1567 100644
--- a/mm/Kconfig.debug
+++ b/mm/Kconfig.debug
@@ -124,6 +124,7 @@ config ARCH_HAS_DEBUG_WX
config DEBUG_WX
bool "Warn on W+X mappings at boot"
depends on ARCH_HAS_DEBUG_WX
+ depends on MMU
select PTDUMP_CORE
help
Generate a warning if any W+X mappings are found at boot.
--
2.26.2

2020-05-11 10:47:44

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH 1/2] mm: remove the specific name of arm64

On Mon, May 11, 2020 at 02:28:19PM +0800, Zong Li wrote:
> UXN is the name of arm64 page-table descriptors.
>
> Signed-off-by: Zong Li <[email protected]>
> CC: Will Deacon <[email protected]>
> ---
> mm/Kconfig.debug | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug
> index e19f94c6df90..b8cbe035247f 100644
> --- a/mm/Kconfig.debug
> +++ b/mm/Kconfig.debug
> @@ -130,8 +130,6 @@ config DEBUG_WX
>
> This is useful for discovering cases where the kernel is leaving W+X
> mappings after applying NX, as such mappings are a security risk.
> - This check also includes UXN, which should be set on all kernel
> - mappings.
>
> Look for a message in dmesg output like this:

Acked-by: Will Deacon <[email protected]>

The commit message needs help, but I'm assuming Andrew will just fold this
into the other patch so it doesn't matter.

Will