linux-nilfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Annotate arguments of memtostr/strtomem with __nonstring
@ 2025-02-07  1:00 Kees Cook
  2025-02-07  1:00 ` [PATCH 01/10] scsi: mptfusion: Mark device strings as nonstring Kees Cook
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Kees Cook @ 2025-02-07  1:00 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kees Cook, Sathya Prakash, Sreekanth Reddy,
	Suganath Prabu Subramani, Kashyap Desai, Sumit Saxena,
	James E.J. Bottomley, Martin K. Petersen, Nilesh Javali,
	Andrew Morton, Kirill A. Shutemov, Dave Hansen, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin, Alexey Dobriyan,
	Sven Eckelmann, Tadeusz Struk, kernel test robot, Erick Archer,
	Dmitry Antipov, Ryusuke Konishi, Luc Van Oostenryck, linux-kernel,
	MPT-FusionLinux.pdl, linux-scsi, mpi3mr-linuxdrv.pdl,
	GR-QLogic-Storage-Upstream, linux-hardening, x86, linux-coco,
	linux-nilfs

Hi,

The memtostr*() and strtomem*() helpers are designed to move between C
strings (NUL-terminated) and byte arrays (that may just be zero padded and
may not be NUL-terminated). The "nonstring" attribute is used to annotated
these kinds of byte arrays, and we can validate the annotation on the
arguments of the helpers. Add the the infrastructure to do this, and
then update all the places where these annotations are currently missing.

-Kees

Kees Cook (10):
  scsi: mptfusion: Mark device strings as nonstring
  scsi: mpi3mr: Mark device strings as nonstring
  scsi: mpt3sas: Mark device strings as nonstring
  scsi: qla2xxx: Mark device strings as nonstring
  string: kunit: Mark nonstring test strings as __nonstring
  x86/tdx: Mark message.str as nonstring
  uapi: stddef.h: Introduce __kernel_nonstring
  nilfs2: Mark on-disk strings as nonstring
  compiler.h: Introduce __must_be_noncstr()
  string.h: Validate memtostr*()/strtomem*() arguments more carefully

 arch/x86/coco/tdx/tdx.c                  |  2 +-
 drivers/message/fusion/mptsas.c          |  8 ++++----
 drivers/scsi/mpi3mr/mpi3mr_transport.c   |  8 ++++----
 drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h     |  2 +-
 drivers/scsi/mpt3sas/mpt3sas_transport.c |  8 ++++----
 drivers/scsi/qla2xxx/qla_mr.h            |  4 ++--
 include/linux/compiler.h                 | 18 +++++++++++++++++-
 include/linux/string.h                   | 16 ++++++++++++----
 include/uapi/linux/nilfs2_ondisk.h       |  3 ++-
 include/uapi/linux/stddef.h              |  6 ++++++
 lib/string_kunit.c                       |  4 ++--
 11 files changed, 55 insertions(+), 24 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-02-13  3:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07  1:00 [PATCH 00/10] Annotate arguments of memtostr/strtomem with __nonstring Kees Cook
2025-02-07  1:00 ` [PATCH 01/10] scsi: mptfusion: Mark device strings as nonstring Kees Cook
2025-02-07  1:00 ` [PATCH 02/10] scsi: mpi3mr: " Kees Cook
2025-02-07  1:00 ` [PATCH 03/10] scsi: mpt3sas: " Kees Cook
2025-02-07  1:00 ` [PATCH 04/10] scsi: qla2xxx: " Kees Cook
2025-02-07  1:00 ` [PATCH 05/10] string: kunit: Mark nonstring test strings as __nonstring Kees Cook
2025-02-07  1:00 ` [PATCH 06/10] x86/tdx: Mark message.str as nonstring Kees Cook
2025-02-07  1:12   ` Dave Hansen
2025-02-07  2:37     ` Kees Cook
2025-02-07 12:09       ` Andy Shevchenko
2025-02-08 21:16         ` Kees Cook
2025-02-10 11:53       ` Kirill A. Shutemov
2025-02-07  1:00 ` [PATCH 07/10] uapi: stddef.h: Introduce __kernel_nonstring Kees Cook
2025-02-07  1:00 ` [PATCH 08/10] nilfs2: Mark on-disk strings as nonstring Kees Cook
2025-02-07  1:00 ` [PATCH 09/10] compiler.h: Introduce __must_be_noncstr() Kees Cook
2025-02-07  1:00 ` [PATCH 10/10] string.h: Validate memtostr*()/strtomem*() arguments more carefully Kees Cook
2025-02-13  3:04 ` [PATCH 00/10] Annotate arguments of memtostr/strtomem with __nonstring Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).