public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] [v2] ALSA: asihpi: avoid write overflow check warning
Date: Wed, 18 Mar 2026 17:02:03 +0100	[thread overview]
Message-ID: <87341xceis.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260318124016.3488566-1-arnd@kernel.org>

On Wed, 18 Mar 2026 13:40:07 +0100,
Arnd Bergmann wrote:
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> clang-22 rightfully warns that the memcpy() in adapter_prepare() copies
> between different structures, crossing the boundary of nested
> structures inside it:
> 
> In file included from sound/pci/asihpi/hpimsgx.c:13:
> In file included from include/linux/string.h:386:
> include/linux/fortify-string.h:569:4: error: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
>   569 |                         __write_overflow_field(p_size_field, size);
> 
> The two structures seem to refer to the same layout, despite the
> separate definitions, so the code is in fact correct.
> 
> Avoid the warning by copying the two inner structures separately.
> I see the same pattern happens in other functions in the same file,
> so there is a chance that this may come back in the future, but
> this instance is the only one that I saw in practice, hitting it
> multiple times per day in randconfig build.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> 
> v2: use correct union member

Applied now.  Thanks.


Takashi

      reply	other threads:[~2026-03-18 16:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 12:40 [PATCH] [v2] ALSA: asihpi: avoid write overflow check warning Arnd Bergmann
2026-03-18 16:02 ` Takashi Iwai [this message]

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=87341xceis.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox