Skip to content

Annotate arguments of memtostr/strtomem with __nonstring

Kees Cook linux-coco linux-hardening linux-nilfs linux-scsi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10scsi: mptfusion: Mark device strings as nonstringdrivers/message/fusion/mptsas.c+4 -40 replies
2/10scsi: mpi3mr: Mark device strings as nonstringdrivers/scsi/mpi3mr/mpi3mr_transport.c+4 -40 replies
3/10scsi: mpt3sas: Mark device strings as nonstringdrivers/scsi/mpt3sas/mpi/mpi2_cnfg.h drivers/scsi/mpt3sas/mpt3sas_transport.c+5 -50 replies
4/10scsi: qla2xxx: Mark device strings as nonstringdrivers/scsi/qla2xxx/qla_mr.h+2 -20 replies
5/10string: kunit: Mark nonstring test strings as __nonstringlib/string_kunit.c+2 -20 replies
6/10x86/tdx: Mark message.str as nonstringarch/x86/coco/tdx/tdx.c+1 -15 replies
7/10uapi: stddef.h: Introduce __kernel_nonstringinclude/uapi/linux/stddef.h+6 -00 replies
8/10nilfs2: Mark on-disk strings as nonstringinclude/uapi/linux/nilfs2_ondisk.h+2 -10 replies
9/10compiler.h: Introduce __must_be_noncstr()include/linux/compiler.h+17 -10 replies
10/10string.h: Validate memtostr*()/strtomem*() arguments more carefullyinclude/linux/string.h+12 -40 replies

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchDave HansenKirill A. ShutemovMartin K. Petersen
SeriesR-b
1/10
2/10
3/10
4/10
5/10
6/10A-b A-b
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 00/10] Annotate arguments of memtostr/strtomem with __nonstring

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(-)
Signature · 1 line
2.34.1