Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1596393 > unrolled thread

[PATCH v3] security/Kconfig: further restrict HARDENED_USERCOPY

Started byTycho Andersen <tycho@docker.com>
First post2017-03-09 22:30 +0100
Last post2017-03-09 22:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3] security/Kconfig: further restrict HARDENED_USERCOPY Tycho Andersen <tycho@docker.com> - 2017-03-09 22:30 +0100
    Re: [PATCH v3] security/Kconfig: further restrict HARDENED_USERCOPY Kees Cook <keescook@chromium.org> - 2017-03-09 22:40 +0100

#1596393 — [PATCH v3] security/Kconfig: further restrict HARDENED_USERCOPY

FromTycho Andersen <tycho@docker.com>
Date2017-03-09 22:30 +0100
Subject[PATCH v3] security/Kconfig: further restrict HARDENED_USERCOPY
Message-ID<tjdNf-2mg-3@gated-at.bofh.it>
It doesn't make sense to have HARDENED_USERCOPY when either /dev/kmem is
enabled or /dev/mem can be used to read kernel memory (i.e.
!STRICT_DEVMEM).

v2: add !MMU depend as well
v3: drop !MMU, s/ARCH_HAS_DEVMEM_IS_ALLOWED/DEVMEM, which makes the above
    commit message actually match the logic again

Signed-off-by: Tycho Andersen <tycho@docker.com>
CC: Kees Cook <keescook@chromium.org>
CC: "Serge E. Hallyn" <serge@hallyn.com>
CC: James Morris <james.l.morris@oracle.com>
---
 security/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/security/Kconfig b/security/Kconfig
index 3ff1bf9..4619cee 100644
--- a/security/Kconfig
+++ b/security/Kconfig
@@ -142,6 +142,8 @@ config HARDENED_USERCOPY
 	bool "Harden memory copies between kernel and userspace"
 	depends on HAVE_ARCH_HARDENED_USERCOPY
 	depends on HAVE_HARDENED_USERCOPY_ALLOCATOR
+	depends on !DEVKMEM
+	depends on !DEVMEM || STRICT_DEVMEM
 	select BUG
 	help
 	  This option checks for obviously wrong memory regions when
-- 
2.7.4

[toc] | [next] | [standalone]


#1596400

FromKees Cook <keescook@chromium.org>
Date2017-03-09 22:40 +0100
Message-ID<tjdWV-2rg-11@gated-at.bofh.it>
In reply to#1596393
On Thu, Mar 9, 2017 at 1:19 PM, Tycho Andersen <tycho@docker.com> wrote:
> It doesn't make sense to have HARDENED_USERCOPY when either /dev/kmem is
> enabled or /dev/mem can be used to read kernel memory (i.e.
> !STRICT_DEVMEM).
>
> v2: add !MMU depend as well
> v3: drop !MMU, s/ARCH_HAS_DEVMEM_IS_ALLOWED/DEVMEM, which makes the above
>     commit message actually match the logic again
>
> Signed-off-by: Tycho Andersen <tycho@docker.com>
> CC: Kees Cook <keescook@chromium.org>
> CC: "Serge E. Hallyn" <serge@hallyn.com>
> CC: James Morris <james.l.morris@oracle.com>

Awesome, thanks! I'll add this to the usercopy tree.

-Kees

> ---
>  security/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/security/Kconfig b/security/Kconfig
> index 3ff1bf9..4619cee 100644
> --- a/security/Kconfig
> +++ b/security/Kconfig
> @@ -142,6 +142,8 @@ config HARDENED_USERCOPY
>         bool "Harden memory copies between kernel and userspace"
>         depends on HAVE_ARCH_HARDENED_USERCOPY
>         depends on HAVE_HARDENED_USERCOPY_ALLOCATOR
> +       depends on !DEVKMEM
> +       depends on !DEVMEM || STRICT_DEVMEM
>         select BUG
>         help
>           This option checks for obviously wrong memory regions when
> --
> 2.7.4
>



-- 
Kees Cook
Pixel Security

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web