public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Takashi Iwai" <tiwai@suse.de>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
	"Kees Cook" <keescook@chromium.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.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] ALSA: asihpi: work around clang-17+ false positive fortify-string warning
Date: Wed, 28 Feb 2024 18:23:13 +0100	[thread overview]
Message-ID: <62f20e36-536d-47ee-b486-28ed87201b60@app.fastmail.com> (raw)
In-Reply-To: <87il28h7zs.wl-tiwai@suse.de>

On Wed, Feb 28, 2024, at 17:24, Takashi Iwai wrote:
> On Wed, 28 Feb 2024 16:03:56 +0100,
>> On Wed, Feb 28, 2024, at 15:37, Takashi Iwai wrote:
>> > On Wed, 28 Feb 2024 15:01:45 +0100,
>> 
>> The fortified-string warning only triggers for string.h operations
>> (memset, memcpy, memcmp, strn*...), not for a direct assignment.
>
> Ah, I see.  Then from the logical POV, it's better to have a check
> before that assignment; otherwise it'd overflow silently there.
>
> Does putting the check beforehand (like the one below) fix similarly?

Indeed, it does address the issue. I'll send a v2 with that
version, since it clearly makes more sense.

       Arnd

  reply	other threads:[~2024-02-28 17:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 14:01 [PATCH] ALSA: asihpi: work around clang-17+ false positive fortify-string warning Arnd Bergmann
2024-02-28 14:37 ` Takashi Iwai
2024-02-28 15:03   ` Arnd Bergmann
2024-02-28 16:24     ` Takashi Iwai
2024-02-28 17:23       ` Arnd Bergmann [this message]
2024-02-28 17:39     ` Clang __bos vs loop unrolling (was Re: [PATCH] ALSA: asihpi: work around clang-17+ false positive fortify-string warning) Kees Cook
2024-02-29  1:20       ` Bill Wendling

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=62f20e36-536d-47ee-b486-28ed87201b60@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --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=ndesaulniers@google.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    /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