Skip to contentSkip to conversation

hardening fixes for v5.18-rc1

GIT PULL Merged Kees Cook 4 participants 7 messages Mar 31, 2022

Subsystems (4)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

Hi Linus,

Please pull these hardening fixes for v5.18-rc1. This addresses an -Warray-bounds warning found under a few ARM defconfigs, and disables long-broken CONFIG_HARDENED_USERCOPY_PAGESPAN.

Thanks!

-Kees

The following changes since commit afcf5441b9ff22ac57244cd45ff102ebc2e32d1a:

arm64: Add gcc Shadow Call Stack support (2022-03-10 09:22:09 -0800)

are available in the Git repository at:

https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/hardening-v5.18-rc1-fix1

for you to fetch changes up to 229a08a4f4e4f9949801cc39b6480ddc9c487183:

ARM/dma-mapping: Remove CMA code when not built with CMA (2022-03-31 11:19:25 -0700)

----------------------------------------------------------------
hardening updates for v5.18-rc1-fix1

- Disable CONFIG_HARDENED_USERCOPY_PAGESPAN

- DMA: remove CMA code when not buiding CMA

----------------------------------------------------------------
Kees Cook (2):
usercopy: Disable CONFIG_HARDENED_USERCOPY_PAGESPAN ARM/dma-mapping: Remove CMA code when not built with CMA

 arch/arm/mm/dma-mapping.c | 2 ++
 arch/arm/mm/mm.h          | 4 ++++
 include/linux/cma.h       | 4 ----
 security/Kconfig          | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)
Signature · 6 lines
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw
Quoted 5 lines · Kees Cook

Hi Linus,

Please pull these hardening fixes for v5.18-rc1. This addresses an -Warray-bounds warning found under a few ARM defconfigs, and disables long-broken CONFIG_HARDENED_USERCOPY_PAGESPAN.

I don't see these patches on linux-arm-kernel... are we doing away with patch review now? :D

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#3 lore raw
In reply to Kees Cook
Quoted 4 lines · Kees Cook

Please pull these hardening fixes for v5.18-rc1. This addresses an -Warray-bounds warning found under a few ARM defconfigs, and disables long-broken CONFIG_HARDENED_USERCOPY_PAGESPAN.

Can't we just remove that HARDENED_USERCOPY_PAGESPAN thing entirely?

Yes, yes, I know Matthew did that as part of other patches that is too late to go in any more in this merge window, but just the removal patch is a no-brainer.

IOW, why not just do the attached?

Linus

 arch/powerpc/configs/skiroot_defconfig |  1 -
 mm/usercopy.c                          | 67 ----------------------------------
 security/Kconfig                       | 11 ------
 3 files changed, 79 deletions(-)
arch/powerpc/configs/skiroot_defconfig +0 -1
index f491875700e8..64176cc12d0e 100644
@@ -274,7 +274,6 @@ CONFIG_NLS_UTF8=y
 CONFIG_ENCRYPTED_KEYS=y
 CONFIG_SECURITY=y
 CONFIG_HARDENED_USERCOPY=y
-CONFIG_HARDENED_USERCOPY_PAGESPAN=y
 CONFIG_FORTIFY_SOURCE=y
 CONFIG_SECURITY_LOCKDOWN_LSM=y
 CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
mm/usercopy.c +0 -67

79 lines not on this page · raw message

security/Kconfig +0 -11
index 9b2c4925585a..7d639f1b0c4a 100644
@@ -163,17 +163,6 @@ config HARDENED_USERCOPY
 	  or are part of the kernel text. This kills entire classes
 	  of heap overflow exploits and similar kernel memory exposures.
 
-config HARDENED_USERCOPY_PAGESPAN
-	bool "Refuse to copy allocations that span multiple pages"
-	depends on HARDENED_USERCOPY
-	depends on BROKEN
-	help
-	  When a multi-page allocation is done without __GFP_COMP,
-	  hardened usercopy will reject attempts to copy it. There are,
-	  however, several cases of this in the kernel that have not all
-	  been removed. This config is intended to be used only while
-	  trying to find such users.
-
 config FORTIFY_SOURCE
 	bool "Harden common str/mem functions against buffer overflows"
 	depends on ARCH_HAS_FORTIFY_SOURCE
author
#2 lore raw
In reply to Russell King (Oracle)
Quoted 9 lines · Russell King (Oracle)
Quoted 5 lines · Kees Cook

Hi Linus,

Please pull these hardening fixes for v5.18-rc1. This addresses an -Warray-bounds warning found under a few ARM defconfigs, and disables long-broken CONFIG_HARDENED_USERCOPY_PAGESPAN.

I don't see these patches on linux-arm-kernel... are we doing away with patch review now? :D

Uh, what? The links in the patches show the reviews, even. I assume you're mainly talking about the DMA one; it's right here:
https://lore.kernel.org/linux-arm-kernel/[email protected]/

I had thought hch was going to take this patch, but the dma tree didn't have it, so I sent it in.

And the usercopy patch was here, with references to the discussion around it too:
https://lore.kernel.org/all/[email protected]/

Signature · 1 line
Kees Cook
author
#4 lore raw
In reply to Linus Torvalds
Quoted 11 lines · Linus Torvalds
Quoted 4 lines · Kees Cook

Please pull these hardening fixes for v5.18-rc1. This addresses an -Warray-bounds warning found under a few ARM defconfigs, and disables long-broken CONFIG_HARDENED_USERCOPY_PAGESPAN.

Can't we just remove that HARDENED_USERCOPY_PAGESPAN thing entirely?

Yes, yes, I know Matthew did that as part of other patches that is too late to go in any more in this merge window, but just the removal patch is a no-brainer.

I can do that, but it seemed like more work for folks: a larger diff to look at, and a rebase for Matthew or me. It's not MUCH more work, but given the timing of the merge window, I wanted to have a minimal diff.

Quoted 1 line

IOW, why not just do the attached?

But I can certainly respin it, if you'd prefer?

Signature · 1 line
Kees Cook
#5 lore raw
Quoted 4 lines · Kees Cook

I can do that, but it seemed like more work for folks: a larger diff to look at, and a rebase for Matthew or me. It's not MUCH more work, but given the timing of the merge window, I wanted to have a minimal diff.

Stuff that just does obvious code removal may _look_ big, but I actually think it's conceptually a smaller patch than the subtle one that just made the code impossible to enable.

Marking something broken implies that maybe we'll be able to fix it.

This seems to be more of a "let's just get rid of it".

Linus

merge bot Merged
#6 lore raw
In reply to Kees Cook
The pull request you sent on Thu, 31 Mar 2022 11:35:40 -0700:

The pull request you sent on Thu, 31 Mar 2022 11:35:40 -0700:

Quoted 1 line

https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/hardening-v5.18-rc1-fix1

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/f87cbd0565eb7e2fa15296c74210658db1346431

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html