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 BC9F722259F; Mon, 20 Apr 2026 15:57:44 +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=1776700664; cv=none; b=AcqZqawRg4JNjWq33+BO/PQaLpOwJ7Ry4twzs4pIkKG6t56kBGLIWGsKEESIjX83/vPChOMUkwG3zSdTcaQKAxedTkLkzhkfn9EicFnVaF9IERUD9oEefq7bgCfvHYm0sq9zF9iJ5opsoksHwajVtcxeI8nySY6OLRpU8pKiIfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776700664; c=relaxed/simple; bh=Bj00YMySmlL/aPNMe2KGXUXgkIAvv3Emrv/S4+H1kB8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tg+ZnAL4dyBgENIA6uIw4+dFX87kRe5HJbtMOAqJucV5jAWwPMflqcMVGS3euqUjqH5mO/1ArrXZq/8YBhlARBuU+AgDkaYQnGMNWWn2FvMEKiYcL+lcRl9DVWBVSRv5v1b+4/11DF9f9CyMje0FyM4qLvmck3tD7mHRZuC63WE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uamwRUKc; 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="uamwRUKc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52FC2C19425; Mon, 20 Apr 2026 15:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776700664; bh=Bj00YMySmlL/aPNMe2KGXUXgkIAvv3Emrv/S4+H1kB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uamwRUKcbrTQm/VfdczfsuBX+Q3C9/TC3mFrn9uPgBIy/WcFTYPoO/yoClZJFqj2m 0tYovZypE7qocal1T+F/T2Trso0OIzEZv/4NwewIXSKTw6QvOYRS61PeKhf7Xn4hnr SlqpqKmCv377o7xO5pVRrK4EfggZIBt+N95DXD+0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arnd Bergmann , Takashi Iwai , Sasha Levin Subject: [PATCH 6.18 008/198] ALSA: asihpi: avoid write overflow check warning Date: Mon, 20 Apr 2026 17:39:47 +0200 Message-ID: <20260420153935.913991563@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260420153935.605963767@linuxfoundation.org> References: <20260420153935.605963767@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit 591721223be9e28f83489a59289579493b8e3d83 ] clang-22 rightfully warns that the memcpy() in adapter_prepare() copies between different structures, crossing the boundary of nested structures inside it: In file included from sound/pci/asihpi/hpimsgx.c:13: In file included from include/linux/string.h:386: include/linux/fortify-string.h:569:4: error: call to '__write_overflow_field' declared with 'warning' attribute: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror,-Wattribute-warning] 569 | __write_overflow_field(p_size_field, size); The two structures seem to refer to the same layout, despite the separate definitions, so the code is in fact correct. Avoid the warning by copying the two inner structures separately. I see the same pattern happens in other functions in the same file, so there is a chance that this may come back in the future, but this instance is the only one that I saw in practice, hitting it multiple times per day in randconfig build. Signed-off-by: Arnd Bergmann Link: https://patch.msgid.link/20260318124016.3488566-1-arnd@kernel.org Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/pci/asihpi/hpimsgx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/pci/asihpi/hpimsgx.c b/sound/pci/asihpi/hpimsgx.c index b68e6bfbbfbab..ed1c7b7744361 100644 --- a/sound/pci/asihpi/hpimsgx.c +++ b/sound/pci/asihpi/hpimsgx.c @@ -581,8 +581,10 @@ static u16 adapter_prepare(u16 adapter) HPI_ADAPTER_OPEN); hm.adapter_index = adapter; hw_entry_point(&hm, &hr); - memcpy(&rESP_HPI_ADAPTER_OPEN[adapter], &hr, - sizeof(rESP_HPI_ADAPTER_OPEN[0])); + memcpy(&rESP_HPI_ADAPTER_OPEN[adapter].h, &hr, + sizeof(rESP_HPI_ADAPTER_OPEN[adapter].h)); + memcpy(&rESP_HPI_ADAPTER_OPEN[adapter].a, &hr.u.ax.info, + sizeof(rESP_HPI_ADAPTER_OPEN[adapter].a)); if (hr.error) return hr.error; -- 2.53.0