mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [kernel-hardening] [PATCH] arm: Always use REFCOUNT_FULL
@ 2018-01-04 12:28 Jinbum Park
  2018-01-04 18:32 ` Kees Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Jinbum Park @ 2018-01-04 12:28 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, kernel-hardening
  Cc: keescook, ard.biesheuvel, Dave.Martin, will.deacon

arm prefers to use REFCOUNT_FULL by default.
This enables it for arm.

Signed-off-by: Jinbum Park <jinb.park7@gmail.com>
---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3d349b4..ec80270 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -100,6 +100,7 @@ config ARM
 	select OLD_SIGACTION
 	select OLD_SIGSUSPEND3
 	select PERF_USE_VMALLOC
+	select REFCOUNT_FULL
 	select RTC_LIB
 	select SYS_SUPPORTS_APM_EMULATION
 	# Above selects are sorted alphabetically; please add new ones
-- 
1.9.1

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

* Re: [kernel-hardening] [PATCH] arm: Always use REFCOUNT_FULL
  2018-01-04 12:28 [kernel-hardening] [PATCH] arm: Always use REFCOUNT_FULL Jinbum Park
@ 2018-01-04 18:32 ` Kees Cook
  2018-01-04 18:35   ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2018-01-04 18:32 UTC (permalink / raw)
  To: Jinbum Park
  Cc: linux-arm-kernel, LKML, kernel-hardening, Ard Biesheuvel,
	Dave Martin, Will Deacon

On Thu, Jan 4, 2018 at 4:28 AM, Jinbum Park <jinb.park7@gmail.com> wrote:
> arm prefers to use REFCOUNT_FULL by default.
> This enables it for arm.
>
> Signed-off-by: Jinbum Park <jinb.park7@gmail.com>

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  arch/arm/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 3d349b4..ec80270 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -100,6 +100,7 @@ config ARM
>         select OLD_SIGACTION
>         select OLD_SIGSUSPEND3
>         select PERF_USE_VMALLOC
> +       select REFCOUNT_FULL
>         select RTC_LIB
>         select SYS_SUPPORTS_APM_EMULATION
>         # Above selects are sorted alphabetically; please add new ones
> --
> 1.9.1
>



-- 
Kees Cook
Pixel Security

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

* Re: [kernel-hardening] [PATCH] arm: Always use REFCOUNT_FULL
  2018-01-04 18:32 ` Kees Cook
@ 2018-01-04 18:35   ` Russell King - ARM Linux
  2018-01-04 18:42     ` Kees Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2018-01-04 18:35 UTC (permalink / raw)
  To: Kees Cook
  Cc: Jinbum Park, Ard Biesheuvel, kernel-hardening, Will Deacon, LKML,
	Dave Martin, linux-arm-kernel

On Thu, Jan 04, 2018 at 10:32:46AM -0800, Kees Cook wrote:
> On Thu, Jan 4, 2018 at 4:28 AM, Jinbum Park <jinb.park7@gmail.com> wrote:
> > arm prefers to use REFCOUNT_FULL by default.
> > This enables it for arm.
> >
> > Signed-off-by: Jinbum Park <jinb.park7@gmail.com>
> 
> Acked-by: Kees Cook <keescook@chromium.org>

I'd help if there was some kind of explanation about this.  Not
everyone knows what REFCOUNT_FULL is.

Also, why does "arm" "prefer" to use this?  Where does the preference
come from - and why is it a preference but being enforced by the
Kconfig ?

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

* Re: [kernel-hardening] [PATCH] arm: Always use REFCOUNT_FULL
  2018-01-04 18:35   ` Russell King - ARM Linux
@ 2018-01-04 18:42     ` Kees Cook
  2018-01-04 18:47       ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2018-01-04 18:42 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Jinbum Park, Will Deacon, Ard Biesheuvel, kernel-hardening, LKML,
	Dave Martin, linux-arm-kernel

On Thu, Jan 4, 2018 at 10:35 AM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> On Thu, Jan 04, 2018 at 10:32:46AM -0800, Kees Cook wrote:
>> On Thu, Jan 4, 2018 at 4:28 AM, Jinbum Park <jinb.park7@gmail.com> wrote:
>> > arm prefers to use REFCOUNT_FULL by default.
>> > This enables it for arm.
>> >
>> > Signed-off-by: Jinbum Park <jinb.park7@gmail.com>
>>
>> Acked-by: Kees Cook <keescook@chromium.org>
>
> I'd help if there was some kind of explanation about this.  Not
> everyone knows what REFCOUNT_FULL is.
>
> Also, why does "arm" "prefer" to use this?  Where does the preference
> come from - and why is it a preference but being enforced by the
> Kconfig ?

This came from discussions with Will Deacon (and others) during the
Linux Security Summit. The arm64 side of this is in commit
4adcec1164de ("arm64: Always use REFCOUNT_FULL"). AIUI, Will said he
didn't want the specialized "fast but technically incomplete"
refcounting as seen with x86's fast refcount infrastructure, but
rather to keep refcounts always fully protected by default because no
one could point to real-world performance impacts with REFCOUNT_FULL
vs unprotected atomic_t infrastructure.

I'm fine leaving this choice up to the end user, but I think it makes
sense to be always-on. If that's no okay, maybe make it default-y for
arm32, and still let people turn it off if they want?

-Kees

-- 
Kees Cook
Pixel Security

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

* Re: [kernel-hardening] [PATCH] arm: Always use REFCOUNT_FULL
  2018-01-04 18:42     ` Kees Cook
@ 2018-01-04 18:47       ` Russell King - ARM Linux
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2018-01-04 18:47 UTC (permalink / raw)
  To: Kees Cook
  Cc: kernel-hardening, Ard Biesheuvel, Will Deacon, LKML, Jinbum Park,
	Dave Martin, linux-arm-kernel

On Thu, Jan 04, 2018 at 10:42:21AM -0800, Kees Cook wrote:
> On Thu, Jan 4, 2018 at 10:35 AM, Russell King - ARM Linux
> <linux@armlinux.org.uk> wrote:
> > On Thu, Jan 04, 2018 at 10:32:46AM -0800, Kees Cook wrote:
> >> On Thu, Jan 4, 2018 at 4:28 AM, Jinbum Park <jinb.park7@gmail.com> wrote:
> >> > arm prefers to use REFCOUNT_FULL by default.
> >> > This enables it for arm.
> >> >
> >> > Signed-off-by: Jinbum Park <jinb.park7@gmail.com>
> >>
> >> Acked-by: Kees Cook <keescook@chromium.org>
> >
> > I'd help if there was some kind of explanation about this.  Not
> > everyone knows what REFCOUNT_FULL is.
> >
> > Also, why does "arm" "prefer" to use this?  Where does the preference
> > come from - and why is it a preference but being enforced by the
> > Kconfig ?
> 
> This came from discussions with Will Deacon (and others) during the
> Linux Security Summit. The arm64 side of this is in commit
> 4adcec1164de ("arm64: Always use REFCOUNT_FULL"). AIUI, Will said he
> didn't want the specialized "fast but technically incomplete"
> refcounting as seen with x86's fast refcount infrastructure, but
> rather to keep refcounts always fully protected by default because no
> one could point to real-world performance impacts with REFCOUNT_FULL
> vs unprotected atomic_t infrastructure.
> 
> I'm fine leaving this choice up to the end user, but I think it makes
> sense to be always-on. If that's no okay, maybe make it default-y for
> arm32, and still let people turn it off if they want?

I'm not really asking for changes.

I'm basically asking for the commit message to do a better job of
explaining this - in years to come, the currently proposed commit
message contains very little information about why this commit exists.

Commit messages need to say what they're doing and why, and not assume
that someone's been to some conference and knows all the inside details
that were discussed there.  It's also best to avoid referencing papers -
conferences and their websites come and go, and links break, at which
point information gets lost.  If it's all properly explained in the
commit message, then it's there forever.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

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

end of thread, other threads:[~2018-01-04 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-04 12:28 [kernel-hardening] [PATCH] arm: Always use REFCOUNT_FULL Jinbum Park
2018-01-04 18:32 ` Kees Cook
2018-01-04 18:35   ` Russell King - ARM Linux
2018-01-04 18:42     ` Kees Cook
2018-01-04 18:47       ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®