All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] x86: mm: refer to the intended config STRICT_DEVMEM in a comment
@ 2022-07-07 11:54 Lukas Bulwahn
  2022-07-07 16:59 ` [tip: x86/cleanups] x86/mm: Refer " tip-bot2 for Lukas Bulwahn
  2022-07-08 17:49 ` [PATCH RESEND] x86: mm: refer " Kees Cook
  0 siblings, 2 replies; 3+ messages in thread
From: Lukas Bulwahn @ 2022-07-07 11:54 UTC (permalink / raw)
  To: Dave Hansen, Kees Cook
  Cc: Andy Lutomirski, Peter Zijlstra, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, H . Peter Anvin, kernel-janitors,
	linux-kernel, Lukas Bulwahn

Commit a4866aa81251 ("mm: Tighten x86 /dev/mem with zeroing reads") adds a
comment to the function devmem_is_allowed() referring to a non-existing
config STRICT_IOMEM, whereas the comment very likely intended to refer to
the config STRICT_DEVMEM, as the commit adds some behavior for the config
STRICT_DEVMEM.

Most of the initial analysis was actually done by Dave Hansen in the
email thread below (see Link).

Refer to the intended and existing config STRICT_DEVMEM.

Link: https://lore.kernel.org/r/f9074e8d-9314-9d7d-7bf5-5b5538c8be8d@intel.com/

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
v1: https://lore.kernel.org/all/20211222125347.13054-1-lukas.bulwahn@gmail.com/
 
 arch/x86/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index d8cfce221275..5d747a1923cb 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -846,7 +846,7 @@ int devmem_is_allowed(unsigned long pagenr)
 
 	/*
 	 * This must follow RAM test, since System RAM is considered a
-	 * restricted resource under CONFIG_STRICT_IOMEM.
+	 * restricted resource under CONFIG_STRICT_DEVMEM.
 	 */
 	if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) {
 		/* Low 1MB bypasses iomem restrictions. */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip: x86/cleanups] x86/mm: Refer to the intended config STRICT_DEVMEM in a comment
  2022-07-07 11:54 [PATCH RESEND] x86: mm: refer to the intended config STRICT_DEVMEM in a comment Lukas Bulwahn
@ 2022-07-07 16:59 ` tip-bot2 for Lukas Bulwahn
  2022-07-08 17:49 ` [PATCH RESEND] x86: mm: refer " Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Lukas Bulwahn @ 2022-07-07 16:59 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Dave Hansen, Lukas Bulwahn, Dave Hansen, x86, linux-kernel

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID:     9de76f41ea2188f2784f48352f9278819d249afc
Gitweb:        https://git.kernel.org/tip/9de76f41ea2188f2784f48352f9278819d249afc
Author:        Lukas Bulwahn <lukas.bulwahn@gmail.com>
AuthorDate:    Thu, 07 Jul 2022 13:54:42 +02:00
Committer:     Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Thu, 07 Jul 2022 09:51:36 -07:00

x86/mm: Refer to the intended config STRICT_DEVMEM in a comment

Commit a4866aa81251 ("mm: Tighten x86 /dev/mem with zeroing reads") adds a
comment to the function devmem_is_allowed() referring to a non-existing
config STRICT_IOMEM, whereas the comment very likely intended to refer to
the config STRICT_DEVMEM, as the commit adds some behavior for the config
STRICT_DEVMEM.

Most of the initial analysis was actually done by Dave Hansen in the
email thread below (see Link).

Refer to the intended and existing config STRICT_DEVMEM.

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/r/f9074e8d-9314-9d7d-7bf5-5b5538c8be8d@intel.com/
Link: https://lkml.kernel.org/r/20220707115442.21107-1-lukas.bulwahn@gmail.com
---
 arch/x86/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index d8cfce2..5d747a1 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -846,7 +846,7 @@ int devmem_is_allowed(unsigned long pagenr)
 
 	/*
 	 * This must follow RAM test, since System RAM is considered a
-	 * restricted resource under CONFIG_STRICT_IOMEM.
+	 * restricted resource under CONFIG_STRICT_DEVMEM.
 	 */
 	if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) {
 		/* Low 1MB bypasses iomem restrictions. */

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] x86: mm: refer to the intended config STRICT_DEVMEM in a comment
  2022-07-07 11:54 [PATCH RESEND] x86: mm: refer to the intended config STRICT_DEVMEM in a comment Lukas Bulwahn
  2022-07-07 16:59 ` [tip: x86/cleanups] x86/mm: Refer " tip-bot2 for Lukas Bulwahn
@ 2022-07-08 17:49 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2022-07-08 17:49 UTC (permalink / raw)
  To: lukas.bulwahn, dave.hansen
  Cc: Kees Cook, kernel-janitors, bp, peterz, linux-kernel, mingo,
	tglx, x86, hpa, luto

On Thu, 7 Jul 2022 13:54:42 +0200, Lukas Bulwahn wrote:
> Commit a4866aa81251 ("mm: Tighten x86 /dev/mem with zeroing reads") adds a
> comment to the function devmem_is_allowed() referring to a non-existing
> config STRICT_IOMEM, whereas the comment very likely intended to refer to
> the config STRICT_DEVMEM, as the commit adds some behavior for the config
> STRICT_DEVMEM.
> 
> Most of the initial analysis was actually done by Dave Hansen in the
> email thread below (see Link).
> 
> [...]

Applied to for-next/hardening, thanks!

[1/1] x86: mm: refer to the intended config STRICT_DEVMEM in a comment
      https://git.kernel.org/kees/c/c09327d5673e

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-08 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-07 11:54 [PATCH RESEND] x86: mm: refer to the intended config STRICT_DEVMEM in a comment Lukas Bulwahn
2022-07-07 16:59 ` [tip: x86/cleanups] x86/mm: Refer " tip-bot2 for Lukas Bulwahn
2022-07-08 17:49 ` [PATCH RESEND] x86: mm: refer " Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.