All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Lucy Thrun <lucy.thrun@digital-rabbithole.de>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ALSA: hda/ca0132: use snprintf() for kernel hardenning
Date: Wed, 11 Jun 2025 15:27:51 +0200	[thread overview]
Message-ID: <87cybawgq0.wl-tiwai@suse.de> (raw)
In-Reply-To: <aEl_0XoK4Q__MOVU@stanley.mountain>

On Wed, 11 Jun 2025 15:08:33 +0200,
Dan Carpenter wrote:
> 
> In this sprintf():
> 
> 	sprintf(namestr, "%s %s Volume", name, dirstr[dir]);
> 
> Then "namestr" and "name" buffer are both SNDRV_CTL_ELEM_ID_NAME_MAXLEN
> (44) characters long.  We never actually use that full amount in real
> life so everything works fine, but static checkers complain that if name
> is 44 characters then when you combine that with the other strings it
> will lead to a buffer overflow.  Using snprintf() silences the warning
> and makes the code a little bit safer for the future.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Thanks for the patch, but the very same fix was already submitted from
Lucy and merged in commit a409c60111e6.


Takashi

      reply	other threads:[~2025-06-11 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 13:08 [PATCH] ALSA: hda/ca0132: use snprintf() for kernel hardenning Dan Carpenter
2025-06-11 13:27 ` 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=87cybawgq0.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=dan.carpenter@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=lucy.thrun@digital-rabbithole.de \
    --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 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.