lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202601091117.122A9268@keescook>
Date: Fri, 9 Jan 2026 11:18:12 -0800
From: Kees Cook <kees@...nel.org>
To: Yicong Hui <yiconghui@...il.com>
Cc: alexander.deucher@....com, christian.koenig@....com, airlied@...il.com,
	simona@...ll.ch, amd-gfx@...ts.freedesktop.org,
	dri-devel@...ts.freedesktop.org, skhan@...uxfoundation.org,
	david.hunter.linux@...il.com, linux-hardening@...r.kernel.org
Subject: Re: [PATCH] drm/amdgpu: Replace deprecated strcpy() in
 amdgpu_virt_write_vf2pf_data

On Fri, Jan 09, 2026 at 04:25:14PM +0000, Yicong Hui wrote:
> strcpy() is deprecated as it does not do any bounds checking (as
> specified in Documentation/process/deprecated.rst).
> 
> There is a risk of buffer overflow in the case that the value for
> THIS_MODULE->version exceeds the 64 characters. This is unlikely, but
> replacing the deprecated function will pre-emptively remove this risk
> entirely.
> 
> Replace both instances of strcpy() with the safer strscpy() function.

This looks correct to me -- dest and src are both fixed-size, so strscpy
happily checks everything at compile time. :)

Reviewed-by: Kees Cook <kees@...nel.org>

-Kees

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ