All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Venkat Rao Bagalkote <venkat88@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Kees Cook <kees@kernel.org>
Subject: Re: [next-20250226]Build Failure
Date: Thu, 27 Feb 2025 12:38:04 +1100	[thread overview]
Message-ID: <20250227123804.5dd71cef@canb.auug.org.au> (raw)
In-Reply-To: <adbe8dd1-a725-4811-ae7e-76fe770cf096@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 13215 bytes --]

Hi Venkat,

CC Kees Cook for advice.  This is a result of the tests added in commit

  bbeb38b8487a ("string.h: Validate memtostr*()/strtomem*() arguments more carefully")

from the kspp tree.

I note that the comment about memtostr() says "Copy a possibly
non-NUL-term string".

On Thu, 27 Feb 2025 06:30:12 +0530 Venkat Rao Bagalkote <venkat88@linux.vnet.ibm.com> wrote:
>
> I am seeing build failures with kernel next-20250226, on IBM Power8 systems.
> 
> Failures:
> 
> In file included from ./include/asm-generic/div64.h:27,
>                   from ./arch/powerpc/include/generated/asm/div64.h:1,
>                   from ./include/linux/math.h:6,
>                   from ./include/linux/math64.h:6,
>                   from ./include/linux/time.h:6,
>                   from fs/ext4/file.c:22:
> fs/ext4/file.c: In function 'ext4_sample_last_mounted':
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:418:6: note: in expansion of macro '__must_be_noncstr'
>        __must_be_noncstr(dest) +  \
>        ^~~~~~~~~~~~~~~~~
> fs/ext4/file.c:869:2: note: in expansion of macro 'strtomem_pad'
>    strtomem_pad(sbi->s_es->s_last_mounted, cp, 0);
>    ^~~~~~~~~~~~
> In file included from ./include/linux/build_bug.h:5,
>                   from ./include/linux/container_of.h:5,
>                   from ./include/linux/list.h:5,
>                   from ./include/linux/module.h:12,
>                   from drivers/message/fusion/mptsas.c:46:
> drivers/message/fusion/mptsas.c: In function 'mptsas_exp_repmanufacture_info':
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/message/fusion/mptsas.c:2968:3: note: in expansion of macro 'memtostr'
>     memtostr(edev->vendor_id, manufacture_reply->vendor_id);
>     ^~~~~~~~
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/message/fusion/mptsas.c:2969:3: note: in expansion of macro 'memtostr'
>     memtostr(edev->product_id, manufacture_reply->product_id);
>     ^~~~~~~~
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/message/fusion/mptsas.c:2970:3: note: in expansion of macro 'memtostr'
>     memtostr(edev->product_rev, manufacture_reply->product_rev);
>     ^~~~~~~~
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/message/fusion/mptsas.c:2973:4: note: in expansion of macro 'memtostr'
>      memtostr(edev->component_vendor_id,
>      ^~~~~~~~
> make[4]: *** [scripts/Makefile.build:203: fs/ext4/file.o] Error 1
> make[3]: *** [scripts/Makefile.build:461: fs/ext4] Error 2
> make[3]: *** Waiting for unfinished jobs....
> In file included from ./include/linux/array_size.h:5,
>                   from ./include/linux/kernel.h:16,
>                   from drivers/scsi/mpt3sas/mpt3sas_base.c:46:
> drivers/scsi/mpt3sas/mpt3sas_base.c: In function '_base_display_ioc_capabilities':
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/scsi/mpt3sas/mpt3sas_base.c:4798:2: note: in expansion of macro 'memtostr'
>    memtostr(desc, ioc->manu_pg0.ChipName);
>    ^~~~~~~~
> In file included from ./include/linux/build_bug.h:5,
>                   from ./include/linux/container_of.h:5,
>                   from ./include/linux/list.h:5,
>                   from ./include/linux/module.h:12,
>                   from drivers/scsi/mpt3sas/mpt3sas_transport.c:45:
> drivers/scsi/mpt3sas/mpt3sas_transport.c: In function '_transport_expander_report_manufacture':
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/scsi/mpt3sas/mpt3sas_transport.c:461:3: note: in expansion of macro 'memtostr'
>     memtostr(edev->vendor_id, manufacture_reply->vendor_id);
>     ^~~~~~~~
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/scsi/mpt3sas/mpt3sas_transport.c:462:3: note: in expansion of macro 'memtostr'
>     memtostr(edev->product_id, manufacture_reply->product_id);
>     ^~~~~~~~
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/scsi/mpt3sas/mpt3sas_transport.c:463:3: note: in expansion of macro 'memtostr'
>     memtostr(edev->product_rev, manufacture_reply->product_rev);
>     ^~~~~~~~
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/scsi/mpt3sas/mpt3sas_transport.c:466:4: note: in expansion of macro 'memtostr'
>      memtostr(edev->component_vendor_id,
>      ^~~~~~~~
> make[5]: *** [scripts/Makefile.build:203: drivers/scsi/mpt3sas/mpt3sas_transport.o] Error 1
> make[5]: *** Waiting for unfinished jobs....
> make[5]: *** [scripts/Makefile.build:203: drivers/message/fusion/mptsas.o] Error 1
> make[4]: *** [scripts/Makefile.build:461: drivers/message/fusion] Error 2
> make[3]: *** [scripts/Makefile.build:461: drivers/message] Error 2
> make[3]: *** Waiting for unfinished jobs....
> make[5]: *** [scripts/Makefile.build:203: drivers/scsi/mpt3sas/mpt3sas_base.o] Error 1
> In file included from ./include/linux/array_size.h:5,
>                   from ./include/linux/kernel.h:16,
>                   from drivers/scsi/qla2xxx/qla_def.h:9,
>                   from drivers/scsi/qla2xxx/qla_mr.c:6:
> drivers/scsi/qla2xxx/qla_mr.c: In function 'qlafx00_fx_disc':
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/scsi/qla2xxx/qla_mr.c:1912:3: note: in expansion of macro 'memtostr'
>     memtostr(vha->hw->model_number, pinfo->model_num);
>     ^~~~~~~~
> ./include/linux/compiler.h:197:62: error: static assertion failed: "must be non-C-string (not NUL-terminated)"
>   #define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
> ^~~~~~~~~~~~~~
> ./include/linux/compiler.h:226:2: note: in expansion of macro '__BUILD_BUG_ON_ZERO_MSG'
>    __BUILD_BUG_ON_ZERO_MSG(!__is_noncstr(p), \
>    ^~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/string.h:468:26: note: in expansion of macro '__must_be_noncstr'
>    const size_t _src_len = __must_be_noncstr(src) +  \
>                            ^~~~~~~~~~~~~~~~~
> drivers/scsi/qla2xxx/qla_mr.c:1913:3: note: in expansion of macro 'memtostr'
>     memtostr(vha->hw->model_desc, pinfo->model_description);
>     ^~~~~~~~
> make[5]: *** [scripts/Makefile.build:203: drivers/scsi/qla2xxx/qla_mr.o] Error 1
> make[5]: *** Waiting for unfinished jobs....
> make[2]: *** [scripts/Makefile.build:461: fs] Error 2
> make[2]: *** Waiting for unfinished jobs....
> make[4]: *** [scripts/Makefile.build:461: drivers/scsi/mpt3sas] Error 2
> make[4]: *** Waiting for unfinished jobs....
> make[4]: *** [scripts/Makefile.build:461: drivers/scsi/qla2xxx] Error 2
> make[3]: *** [scripts/Makefile.build:461: drivers/scsi] Error 2
> make[2]: *** [scripts/Makefile.build:461: drivers] Error 2
> make[1]: *** [/root/linux-next/Makefile:1989: .] Error 2
> make: *** [Makefile:251: __sub-make] Error 2

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2025-02-27  1:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27  1:00 [next-20250226]Build Failure Venkat Rao Bagalkote
2025-02-27  1:38 ` Stephen Rothwell [this message]
2025-02-27 10:43   ` Christophe Leroy
2025-02-27 13:47     ` Venkat Rao Bagalkote
2025-02-27 14:07       ` Christophe Leroy
2025-02-27 14:05     ` Michael Kelley
2025-02-27 14:15       ` Christophe Leroy
2025-02-28 17:20         ` Kees Cook
2025-02-28 17:46         ` Kees Cook
2025-03-01  5:44           ` Michael Kelley

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=20250227123804.5dd71cef@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=venkat88@linux.vnet.ibm.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.