public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Mark Brown <broonie@kernel.org>,
	srinivas.kandagatla@linaro.org, bgoswami@quicinc.com,
	tiwai@suse.com, Fullway Wang <fullwaywang@outlook.com>
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	fullwaywang@tencent.com
Subject: Re: [PATCH] sound: soc: wcd934x: fix an incorrect use of kstrndup()
Date: Thu, 1 Feb 2024 10:04:23 +0100	[thread overview]
Message-ID: <dde96dd7-eb33-41ca-9b08-3a2788164d02@linux.intel.com> (raw)
In-Reply-To: <170662942110.37296.1277489815994094565.b4-ty@kernel.org>

On 1/30/2024 4:43 PM, Mark Brown wrote:
> On Thu, 18 Jan 2024 15:52:49 +0800, Fullway Wang wrote:
>> In wcd934x_codec_enable_dec(), kstrndup() is used to alloc memory.
>> However, kmemdup_nul() should be used instead with the size known.
>>
>> This is similar to CVE-2019-12454 which was fixed in commit
>> a549881.
>>
>>
>> [...]
> 
> Applied to
> 
>     https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
> 
> Thanks!
> 

Hi,

Mark, my other comment was meant to stop this patch from being applied 
;), perhaps I could have been more clear? kmemdup_nul() in this case 
will copy bytes behind the end of widget name when copying. Widgets to 
which it applies are named: "ADX MUX0", "ADC MUX1" and so on, until "ADC 
MUX 8", which is 10 bytes including '\0', and kmemdup_nul() will copy 15 
using memcpy().

  reply	other threads:[~2024-02-01  9:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18  7:52 [PATCH] sound: soc: wcd934x: fix an incorrect use of kstrndup() Fullway Wang
2024-01-29 21:32 ` Mark Brown
2024-01-30  9:56 ` Amadeusz Sławiński
2024-01-30 15:43 ` Mark Brown
2024-02-01  9:04   ` Amadeusz Sławiński [this message]
2024-02-01 12:31     ` Mark Brown

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=dde96dd7-eb33-41ca-9b08-3a2788164d02@linux.intel.com \
    --to=amadeuszx.slawinski@linux.intel.com \
    --cc=bgoswami@quicinc.com \
    --cc=broonie@kernel.org \
    --cc=fullwaywang@outlook.com \
    --cc=fullwaywang@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --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