From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7312E285C89; Tue, 12 Aug 2025 19:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755026844; cv=none; b=jemrqcnV3/qfWDBe9sxT/PkDPW7KWi6iYpa1NvYhZjFxgs61bQq621VJNt97gtf9LDlpgrBrfvuiWFEkhA5AZM4g+1OUwow+fXjgIiVUG3LGK7YbrPW+SgQwpYcCRg3VPDyGPsbGV9MIOCsmENOiDy6QhhOiJ5d6t42zo8rgM3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755026844; c=relaxed/simple; bh=19sFSUDYxPkia47MC2xK1QAoE5+KESM12+B1O85dS4s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fAG8sTOsRDKCJoZ6H1IlRqILa5/dE7HPO29BRLQPyyprwGitXeQLPjespbjQhXfSfeGKEhlreopcJEulXHhvY1gQI75MGt0zFouK+2Y1F43G8JaPJQDq8gGYzrZhPyP6yhyyW1R8dM65JYXDJkUHi7UkjCHHLOFsQbBHjqRdzaA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TxtYv4Rj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TxtYv4Rj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6DA5C4CEF0; Tue, 12 Aug 2025 19:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755026844; bh=19sFSUDYxPkia47MC2xK1QAoE5+KESM12+B1O85dS4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TxtYv4Rjhl3ur2iMWOjy8gHTxwzTP7Jt6v4lUccLOcjJ9TrpZG4UiAEMpuwmNYIrV 9NxrmhGggm0ucADBj9sawDB4IoP5v/uGu2mWDbbXFP5kc54l21v/z2+dMnS7MfUQnb wFCVO2WoJ4GX0n6xICQh+BwwYzUZADeghaakcjkg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thorsten Blum , Takashi Iwai Subject: [PATCH 6.15 457/480] ALSA: intel_hdmi: Fix off-by-one error in __hdmi_lpe_audio_probe() Date: Tue, 12 Aug 2025 19:51:05 +0200 Message-ID: <20250812174416.243070518@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250812174357.281828096@linuxfoundation.org> References: <20250812174357.281828096@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thorsten Blum commit 8cbe564974248ee980562be02f2b1912769562c7 upstream. In __hdmi_lpe_audio_probe(), strscpy() is incorrectly called with the length of the source string (excluding the NUL terminator) rather than the size of the destination buffer. This results in one character less being copied from 'card->shortname' to 'pcm->name'. Use the destination buffer size instead to ensure the card name is copied correctly. Cc: stable@vger.kernel.org Fixes: 75b1a8f9d62e ("ALSA: Convert strlcpy to strscpy when return value is unused") Signed-off-by: Thorsten Blum Link: https://patch.msgid.link/20250805234156.60294-1-thorsten.blum@linux.dev Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/x86/intel_hdmi_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -1767,7 +1767,7 @@ static int __hdmi_lpe_audio_probe(struct /* setup private data which can be retrieved when required */ pcm->private_data = ctx; pcm->info_flags = 0; - strscpy(pcm->name, card->shortname, strlen(card->shortname)); + strscpy(pcm->name, card->shortname, sizeof(pcm->name)); /* setup the ops for playback */ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &had_pcm_ops);