public inbox for linux-sound@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/7] ALSA: asihpi: bound control name formatting
Date: Fri, 27 Mar 2026 10:42:40 +0100	[thread overview]
Message-ID: <87h5q1sj5b.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260323070310.42827-1-pengpeng@iscas.ac.cn>

On Mon, 23 Mar 2026 08:03:10 +0100,
Pengpeng Hou wrote:
> 
> asihpi_ctl_init() builds mixer control names in the fixed 44-byte
> hpi_ctl->name buffer, but it currently does so with sprintf(). Some
> source/destination node names are already long enough that combining both
> endpoints, their indices, the direction prefix, and the control name can
> run past the end of the buffer.

Does it really overflow?  IOW, it's just for a defensive programming,
right?  Please clarify it, otherwise we'll receive an unnecessary CVE
number judged only from the description.

> Switch the formatting to snprintf() so the driver never writes past the
> ALSA control name storage.

For that purpose, please use scnprintf() instead.  snprintf() would
lead to other unnecessary warnings due to the potential overflow when
built with W=1, too.

> @@ -2957,4 +2960,3 @@ static void __exit snd_asihpi_exit(void)
>  
>  module_init(snd_asihpi_init)
>  module_exit(snd_asihpi_exit)
> -

This is unneeded change.  Please drop.


thanks,

Takashi

      reply	other threads:[~2026-03-27  9:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23  7:03 [PATCH 1/7] ALSA: asihpi: bound control name formatting Pengpeng Hou
2026-03-27  9:42 ` 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=87h5q1sj5b.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pengpeng@iscas.ac.cn \
    --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