From: Kees Cook <kees@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Nathan Chancellor" <nathan@kernel.org>,
"Tao Zhou" <tao.zhou1@amd.com>,
"Hawking Zhang" <Hawking.Zhang@amd.com>,
"YiPeng Chai" <YiPeng.Chai@amd.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Nick Desaulniers" <nick.desaulniers+lkml@gmail.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
"Gangliang Xie" <ganglxie@amd.com>,
"Srinivasan Shanmugam" <srinivasan.shanmugam@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] drm/amd/ras: work around write overflow attribute warning
Date: Wed, 18 Mar 2026 09:23:50 -0700 [thread overview]
Message-ID: <202603180923.9208D4C4@keescook> (raw)
In-Reply-To: <20260318105050.1947902-1-arnd@kernel.org>
On Wed, Mar 18, 2026 at 11:50:36AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> clang-22 warns about possibly copying beyind the end of an array:
>
> In file included from drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras_umc.c:24:
> In file included from drivers/gpu/drm/amd/amdgpu/../ras/rascore/ras.h:27:
> In file included from drivers/gpu/drm/amd/amdgpu/../ras/ras_mgr/ras_sys.h:29:
> 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);
> | ^
>
> As far as I can tell, this is a false-postive warning, but there is
> an easy workaround, by using a direct struct assignment in place of
> the memcpy.
>
> Fixes: 7a3f9c0992c4 ("drm/amd/ras: Add umc common ras functions")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Yeah, direct assignment is much preferred anyway. :)
Reviewed-by: Kees Cook <kees@kernel.org>
--
Kees Cook
prev parent reply other threads:[~2026-03-18 16:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 10:50 [PATCH] drm/amd/ras: work around write overflow attribute warning Arnd Bergmann
2026-03-18 16:23 ` Kees Cook [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=202603180923.9208D4C4@keescook \
--to=kees@kernel.org \
--cc=Hawking.Zhang@amd.com \
--cc=YiPeng.Chai@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ganglxie@amd.com \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=simona@ffwll.ch \
--cc=srinivasan.shanmugam@amd.com \
--cc=tao.zhou1@amd.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