All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Ard Biesheuvel" <ardb@kernel.org>,
	"Arnd Bergmann" <arnd@arndb.de>, "Christoph Hellwig" <hch@lst.de>,
	"Coly Li" <colyli@kernel.org>, "David Gow" <davidgow@google.com>,
	"Dr. David Alan Gilbert" <linux@treblig.org>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	"Harry Yoo" <harry.yoo@oracle.com>,
	"Jan Hendrik Farr" <kernel@jfarr.cc>,
	"Justin Stitt" <justinstitt@google.com>,
	"Kees Cook" <kees@kernel.org>, "Mark Brown" <broonie@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <n.schier@avm.de>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Venkat Rao Bagalkote" <venkat88@linux.ibm.com>,
	WangYuli <wangyuli@uniontech.com>
Subject: [GIT PULL] hardening updates for v6.16-rc1
Date: Mon, 26 May 2025 20:25:28 -0700	[thread overview]
Message-ID: <202505262001.561C185@keescook> (raw)

Hi Linus,

Please pull these hardening updates for v6.16-rc1.

The randstruct GCC plugin was fixed but it uncovered a missed
randomization opportunity (that was similarly missed in Clang but has
also now been fixed there too).

There are two patches in this pull that are duplicated in other trees: 1
in netdev and 1 in watchdog. They were needed to build the hardening tree
(due to the randstruct fixes), but they were taken into their respective
trees kind of later in the dev cycle. I debated splitting up this tree
and ripping out the patches, but they're both small, and it seemed like
more trouble for both of us (2 pulls). If you'd rather have it split up,
let me know and I can resend it that way.

Another item of note is the kbuild change that will induce a full kernel
rebuild when other dependencies of the compile change (randstruct seed,
GCC plugins are rebuilt, or the Clang sanitizer .scl file content
changes). Several variations were attempted by myself and kbuild
maintainers was the version ultimately agreed to (and I carried in my
tree since it's all due to hardening features anyway).

Thanks!

-Kees

The following changes since commit b4432656b36e5cc1d50a1f2dc15357543add530e:

  Linux 6.15-rc4 (2025-04-27 15:19:23 -0700)

are available in the Git repository at:

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

for you to fetch changes up to f0cd6012c40da99b45f8f63052b97ec89d5f307b:

  Revert "hardening: Disable GCC randstruct for COMPILE_TEST" (2025-05-08 09:42:40 -0700)

----------------------------------------------------------------
hardening updates for v6.16-rc1

- Update overflow helpers to ease refactoring of on-stack flex array
  instances (Gustavo A. R. Silva, Kees Cook)

- lkdtm: Use SLAB_NO_MERGE instead of constructors (Harry Yoo)

- Simplify CONFIG_CC_HAS_COUNTED_BY (Jan Hendrik Farr)

- Disable u64 usercopy KUnit test on 32-bit SPARC (Thomas Weißschuh)

- Add missed designated initializers now exposed by fixed randstruct
  (Nathan Chancellor, Kees Cook)

- Document compilers versions for __builtin_dynamic_object_size

- Remove ARM_SSP_PER_TASK GCC plugin

- Fix GCC plugin randstruct, add selftests, and restore COMPILE_TEST
  builds

- Kbuild: induce full rebuilds when dependencies change with GCC plugins,
  the Clang sanitizer .scl file, or the randstruct seed.

- Kbuild: Switch from -Wvla to -Wvla-larger-than=1

- Correct several __nonstring uses for -Wunterminated-string-initialization

----------------------------------------------------------------
Gustavo A. R. Silva (3):
      overflow: Add STACK_FLEX_ARRAY_SIZE() helper
      kunit/overflow: Add tests for STACK_FLEX_ARRAY_SIZE() helper
      overflow: Fix direct struct member initialization in _DEFINE_FLEX()

Harry Yoo (1):
      lkdtm: use SLAB_NO_MERGE instead of an empty constructor

Jan Hendrik Farr (1):
      hardening: simplify CONFIG_CC_HAS_COUNTED_BY

Kees Cook (16):
      gcc-plugins: Remove ARM_SSP_PER_TASK plugin
      compiler_types: Identify compiler versions for __builtin_dynamic_object_size
      overflow: Clarify expectations for getting DEFINE_FLEX variable sizes
      mod_devicetable: Enlarge the maximum platform_device_id name length
      watchdog: exar: Shorten identity name to fit correctly
      input/joystick: magellan: Mark __nonstring look-up table const
      kbuild: Switch from -Wvla to -Wvla-larger-than=1
      gcc-plugins: Force full rebuild when plugins change
      randstruct: Force full rebuild when seed changes
      integer-wrap: Force full rebuild when .scl file changes
      md/bcache: Mark __nonstring look-up table
      scsi: qedf: Use designated initializer for struct qed_fcoe_cb_ops
      randstruct: gcc-plugin: Remove bogus void member
      lib/tests: Add randstruct KUnit test
      lib/tests: randstruct: Add deep function pointer layout test
      Revert "hardening: Disable GCC randstruct for COMPILE_TEST"

Nathan Chancellor (1):
      net: qede: Initialize qede_ll_ops with designated initializer

Thomas Weißschuh (1):
      kunit/usercopy: Disable u64 test on 32-bit SPARC

 arch/arm/Kconfig                              |   3 +-
 init/Kconfig                                  |   9 +-
 scripts/gcc-plugins/Kconfig                   |   4 -
 lib/Kconfig.debug                             |   8 +
 security/Kconfig.hardening                    |   2 +-
 arch/arm/boot/compressed/Makefile             |   2 +-
 lib/Makefile                                  |   1 -
 lib/tests/Makefile                            |   1 +
 mm/kasan/Makefile                             |   3 +-
 scripts/basic/Makefile                        |   5 +
 scripts/gcc-plugins/Makefile                  |   4 +
 scripts/Makefile.extrawarn                    |   9 +-
 scripts/Makefile.gcc-plugins                  |   8 +-
 scripts/Makefile.lib                          |  18 ++
 scripts/Makefile.ubsan                        |   1 +
 scripts/gcc-plugins/arm_ssp_per_task_plugin.c | 107 ---------
 scripts/gcc-plugins/randomize_layout_plugin.c |  18 +-
 include/linux/compiler-version.h              |  30 +++
 include/linux/compiler_types.h                |   5 +
 include/linux/mod_devicetable.h               |   2 +-
 include/linux/overflow.h                      |  23 +-
 include/linux/vermagic.h                      |   1 -
 drivers/input/joystick/magellan.c             |   2 +-
 drivers/md/bcache/super.c                     |   3 +-
 drivers/misc/lkdtm/heap.c                     |  17 +-
 drivers/net/ethernet/qlogic/qede/qede_main.c  |   2 +-
 drivers/scsi/qedf/qedf_main.c                 |   2 +-
 drivers/watchdog/exar_wdt.c                   |   2 +-
 lib/tests/overflow_kunit.c                    |   4 +
 lib/tests/randstruct_kunit.c                  | 334 ++++++++++++++++++++++++++
 lib/tests/usercopy_kunit.c                    |   1 +
 MAINTAINERS                                   |   1 +
 32 files changed, 461 insertions(+), 171 deletions(-)
 delete mode 100644 scripts/gcc-plugins/arm_ssp_per_task_plugin.c
 create mode 100644 lib/tests/randstruct_kunit.c

-- 
Kees Cook

             reply	other threads:[~2025-05-27  3:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27  3:25 Kees Cook [this message]
2025-05-28 15:42 ` [GIT PULL] hardening updates for v6.16-rc1 pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202505262001.561C185@keescook \
    --to=kees@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=colyli@kernel.org \
    --cc=davidgow@google.com \
    --cc=gustavoars@kernel.org \
    --cc=harry.yoo@oracle.com \
    --cc=hch@lst.de \
    --cc=justinstitt@google.com \
    --cc=kernel@jfarr.cc \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=linux@treblig.org \
    --cc=n.schier@avm.de \
    --cc=nathan@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=venkat88@linux.ibm.com \
    --cc=wangyuli@uniontech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.