mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL] hardening updates for v6.18-rc1
@ 2025-09-29 19:15 Kees Cook
  2025-09-30  0:59 ` Linus Torvalds
  2025-09-30  1:13 ` pr-tracker-bot
  0 siblings, 2 replies; 4+ messages in thread
From: Kees Cook @ 2025-09-29 19:15 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Andy Shevchenko, Christopher Fore,
	Gustavo A. R. Silva, Junjie Cao, Kees Cook, Lad Prabhakar,
	Linus Walleij, Nathan Chancellor, Philipp Zabel, Vegard Nossum

Hi Linus,

Please pull these hardening updates for v6.18-rc1. One notable addition
is the creation of the "transitional" keyword for kconfig so CONFIG
renaming can go more smoothly. This has been a long-standing deficiency,
and with the renaming of CONFIG_CFI_CLANG to CONFIG_CFI (since GCC will
soon have KCFI support), this came up again. The breadth of the diffstat
is mainly this renaming.

Thanks!

-Kees

The following changes since commit c17b750b3ad9f45f2b6f7e6f7f4679844244f0b9:

  Linux 6.17-rc2 (2025-08-17 15:22:10 -0700)

are available in the Git repository at:

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

for you to fetch changes up to c8a935a31bc787db52296944890f300ba9479088:

  lib/string_choices: Add str_assert_deassert() helper (2025-09-28 20:42:29 -0700)

----------------------------------------------------------------
hardening updates for v6.18-rc1

- Clean up usage of TRAILING_OVERLAP() (Gustavo A. R. Silva)

- lkdtm: fortify: Fix potential NULL dereference on kmalloc failure
  (Junjie Cao)

- Add str_assert_deassert() helper (Lad Prabhakar)

- gcc-plugins: Remove TODO_verify_il for GCC >= 16

- kconfig: Fix BrokenPipeError warnings in selftests

- kconfig: Add transitional symbol attribute for migration support

- kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI

----------------------------------------------------------------
Gustavo A. R. Silva (2):
      stddef: Remove token-pasting in TRAILING_OVERLAP()
      stddef: Introduce __TRAILING_OVERLAP()

Junjie Cao (1):
      lkdtm: fortify: Fix potential NULL dereference on kmalloc failure

Kees Cook (4):
      gcc-plugins: Remove TODO_verify_il for GCC >= 16
      kconfig: Fix BrokenPipeError warnings in selftests
      kconfig: Add transitional symbol attribute for migration support
      kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI

Lad Prabhakar (1):
      lib/string_choices: Add str_assert_deassert() helper

 arch/Kconfig                                       |  36 +++++---
 arch/arm/Kconfig                                   |   2 +-
 arch/arm64/Kconfig                                 |   4 +-
 arch/riscv/Kconfig                                 |   6 +-
 arch/x86/Kconfig                                   |  12 +--
 init/Kconfig                                       |   4 +-
 kernel/module/Kconfig                              |   2 +-
 scripts/kconfig/tests/err_transitional/Kconfig     |  52 +++++++++++
 scripts/kconfig/tests/transitional/Kconfig         | 100 +++++++++++++++++++++
 lib/Kconfig.debug                                  |   2 +-
 Makefile                                           |   2 +-
 arch/arm/mm/Makefile                               |   2 +-
 arch/riscv/kernel/Makefile                         |   2 +-
 arch/riscv/purgatory/Makefile                      |   2 +-
 arch/x86/kernel/Makefile                           |   2 +-
 arch/x86/purgatory/Makefile                        |   2 +-
 kernel/Makefile                                    |   2 +-
 scripts/gcc-plugins/gcc-common.h                   |   7 ++
 scripts/kconfig/expr.h                             |   1 +
 scripts/kconfig/lexer.l                            |   1 +
 scripts/kconfig/parser.y                           |  47 ++++++++++
 scripts/kconfig/symbol.c                           |   7 +-
 scripts/kconfig/tests/conftest.py                  |  17 +++-
 scripts/kconfig/tests/err_transitional/__init__.py |  14 +++
 .../kconfig/tests/err_transitional/expected_stderr |   7 ++
 scripts/kconfig/tests/transitional/__init__.py     |  18 ++++
 scripts/kconfig/tests/transitional/expected_config |  12 +++
 scripts/kconfig/tests/transitional/initial_config  |  16 ++++
 Documentation/kbuild/kconfig-language.rst          |  32 +++++++
 arch/riscv/include/asm/cfi.h                       |   4 +-
 arch/x86/include/asm/cfi.h                         |   4 +-
 include/asm-generic/vmlinux.lds.h                  |   2 +-
 include/linux/cfi.h                                |   6 +-
 include/linux/cfi_types.h                          |   8 +-
 include/linux/compiler.h                           |   2 +-
 include/linux/stddef.h                             |  24 ++++-
 include/linux/string_choices.h                     |   6 ++
 tools/include/linux/cfi_types.h                    |   6 +-
 tools/perf/util/include/linux/linkage.h            |   2 +-
 arch/arm/mm/cache-fa.S                             |   2 +-
 arch/arm/mm/cache-v4.S                             |   2 +-
 arch/arm/mm/cache-v4wb.S                           |   4 +-
 arch/arm/mm/cache-v4wt.S                           |   2 +-
 arch/arm/mm/cache-v6.S                             |   2 +-
 arch/arm/mm/cache-v7.S                             |   2 +-
 arch/arm/mm/cache-v7m.S                            |   2 +-
 arch/arm/mm/proc-arm1020.S                         |   2 +-
 arch/arm/mm/proc-arm1020e.S                        |   2 +-
 arch/arm/mm/proc-arm1022.S                         |   2 +-
 arch/arm/mm/proc-arm1026.S                         |   2 +-
 arch/arm/mm/proc-arm920.S                          |   2 +-
 arch/arm/mm/proc-arm922.S                          |   2 +-
 arch/arm/mm/proc-arm925.S                          |   2 +-
 arch/arm/mm/proc-arm926.S                          |   2 +-
 arch/arm/mm/proc-arm940.S                          |   2 +-
 arch/arm/mm/proc-arm946.S                          |   2 +-
 arch/arm/mm/proc-feroceon.S                        |   2 +-
 arch/arm/mm/proc-mohawk.S                          |   2 +-
 arch/arm/mm/proc-xsc3.S                            |   2 +-
 arch/arm/mm/tlb-v4.S                               |   2 +-
 arch/arm/kernel/hw_breakpoint.c                    |   2 +-
 arch/arm64/kernel/debug-monitors.c                 |   2 +-
 arch/arm64/kernel/traps.c                          |   4 +-
 arch/arm64/kvm/handle_exit.c                       |   2 +-
 arch/arm64/net/bpf_jit_comp.c                      |   2 +-
 arch/riscv/net/bpf_jit_comp64.c                    |   4 +-
 arch/x86/kernel/alternative.c                      |   4 +-
 arch/x86/kernel/kprobes/core.c                     |   2 +-
 drivers/misc/lkdtm/cfi.c                           |   2 +-
 drivers/misc/lkdtm/fortify.c                       |   6 ++
 kernel/module/tree_lookup.c                        |   2 +-
 kernel/configs/hardening.config                    |   4 +-
 72 files changed, 461 insertions(+), 96 deletions(-)
 create mode 100644 scripts/kconfig/tests/err_transitional/Kconfig
 create mode 100644 scripts/kconfig/tests/transitional/Kconfig
 create mode 100644 scripts/kconfig/tests/err_transitional/__init__.py
 create mode 100644 scripts/kconfig/tests/err_transitional/expected_stderr
 create mode 100644 scripts/kconfig/tests/transitional/__init__.py
 create mode 100644 scripts/kconfig/tests/transitional/expected_config
 create mode 100644 scripts/kconfig/tests/transitional/initial_config

-- 
Kees Cook

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

* Re: [GIT PULL] hardening updates for v6.18-rc1
  2025-09-29 19:15 [GIT PULL] hardening updates for v6.18-rc1 Kees Cook
@ 2025-09-30  0:59 ` Linus Torvalds
  2025-09-30  2:06   ` Kees Cook
  2025-09-30  1:13 ` pr-tracker-bot
  1 sibling, 1 reply; 4+ messages in thread
From: Linus Torvalds @ 2025-09-30  0:59 UTC (permalink / raw)
  To: Kees Cook
  Cc: linux-kernel, Andy Shevchenko, Christopher Fore,
	Gustavo A. R. Silva, Junjie Cao, Lad Prabhakar, Linus Walleij,
	Nathan Chancellor, Philipp Zabel, Vegard Nossum

On Mon, 29 Sept 2025 at 12:15, Kees Cook <kees@kernel.org> wrote:
>
> Please pull these hardening updates for v6.18-rc1. One notable addition
> is the creation of the "transitional" keyword for kconfig so CONFIG
> renaming can go more smoothly. This has been a long-standing deficiency,
> and with the renaming of CONFIG_CFI_CLANG to CONFIG_CFI (since GCC will
> soon have KCFI support), this came up again. The breadth of the diffstat
> is mainly this renaming.

So I really like this addition conceptually, but it doesn't actually
seem to work.

My clang-building tree config had

    CONFIG_ARCH_SUPPORTS_CFI_CLANG=y
    # CONFIG_CFI_CLANG is not set
    CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG=y

but then when I pulled this and did a "make oldconfig" I get Kconfig asking me

    Use Kernel Control Flow Integrity (kCFI) (CFI) [N/y/?] (NEW)

anyway, in order to get

    CONFIG_ARCH_SUPPORTS_CFI=y
    # CONFIG_CFI is not set
    CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS=y

and I thought the whole point was that it would recognize the old
Kconfig names and transition them to the new ones. And it very clearly
does not.

So I'm a bit disappointed. Possibly because I expected the
"transitional" keyword to be doing more than it does. But possibly
because it's buggy and doesn't actually do what it is *supposed* to
do.

Hmm?

I've pulled this because it doesn't seem wrong, but it does seem to be
less capable than what I was expecting / hoping it to be.

In other words: the long-standing deficiency still stands tall and not-so-proud.

           Linus

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

* Re: [GIT PULL] hardening updates for v6.18-rc1
  2025-09-29 19:15 [GIT PULL] hardening updates for v6.18-rc1 Kees Cook
  2025-09-30  0:59 ` Linus Torvalds
@ 2025-09-30  1:13 ` pr-tracker-bot
  1 sibling, 0 replies; 4+ messages in thread
From: pr-tracker-bot @ 2025-09-30  1:13 UTC (permalink / raw)
  To: Kees Cook
  Cc: Linus Torvalds, linux-kernel, Andy Shevchenko, Christopher Fore,
	Gustavo A. R. Silva, Junjie Cao, Kees Cook, Lad Prabhakar,
	Linus Walleij, Nathan Chancellor, Philipp Zabel, Vegard Nossum

The pull request you sent on Mon, 29 Sep 2025 12:15:50 -0700:

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

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

Thank you!

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

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

* Re: [GIT PULL] hardening updates for v6.18-rc1
  2025-09-30  0:59 ` Linus Torvalds
@ 2025-09-30  2:06   ` Kees Cook
  0 siblings, 0 replies; 4+ messages in thread
From: Kees Cook @ 2025-09-30  2:06 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: linux-kernel, Andy Shevchenko, Christopher Fore,
	Gustavo A. R. Silva, Junjie Cao, Lad Prabhakar, Linus Walleij,
	Nathan Chancellor, Philipp Zabel, Vegard Nossum

On Mon, Sep 29, 2025 at 05:59:17PM -0700, Linus Torvalds wrote:
> On Mon, 29 Sept 2025 at 12:15, Kees Cook <kees@kernel.org> wrote:
> >
> > Please pull these hardening updates for v6.18-rc1. One notable addition
> > is the creation of the "transitional" keyword for kconfig so CONFIG
> > renaming can go more smoothly. This has been a long-standing deficiency,
> > and with the renaming of CONFIG_CFI_CLANG to CONFIG_CFI (since GCC will
> > soon have KCFI support), this came up again. The breadth of the diffstat
> > is mainly this renaming.
> 
> So I really like this addition conceptually, but it doesn't actually
> seem to work.
> 
> My clang-building tree config had
> 
>     CONFIG_ARCH_SUPPORTS_CFI_CLANG=y
>     # CONFIG_CFI_CLANG is not set
>     CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG=y
> 
> but then when I pulled this and did a "make oldconfig" I get Kconfig asking me
> 
>     Use Kernel Control Flow Integrity (kCFI) (CFI) [N/y/?] (NEW)
> 
> anyway, in order to get
> 
>     CONFIG_ARCH_SUPPORTS_CFI=y
>     # CONFIG_CFI is not set
>     CONFIG_HAVE_CFI_ICALL_NORMALIZE_INTEGERS=y
> 
> and I thought the whole point was that it would recognize the old
> Kconfig names and transition them to the new ones. And it very clearly
> does not.
> 
> So I'm a bit disappointed. Possibly because I expected the
> "transitional" keyword to be doing more than it does. But possibly
> because it's buggy and doesn't actually do what it is *supposed* to
> do.

Ah, the existing "=n" didn't persist. That's not expected. I will take
a look.

-- 
Kees Cook

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

end of thread, other threads:[~2025-09-30  2:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-29 19:15 [GIT PULL] hardening updates for v6.18-rc1 Kees Cook
2025-09-30  0:59 ` Linus Torvalds
2025-09-30  2:06   ` Kees Cook
2025-09-30  1:13 ` pr-tracker-bot

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®