]> git.hungrycats.org Git - linux/commit
drm/amdgpu: NUL-terminate securedisplay debugfs input from userspace
authorCandice Li <candice.li@amd.com>
Tue, 19 May 2026 10:42:09 +0000 (18:42 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Jun 2026 17:53:00 +0000 (13:53 -0400)
commit66a856e3e5d92a09363dea37e9376921b30aaa6b
tree54dbfc1ab9c644de1d06726d9ef02f5e3e937508
parentc83e4a45ff9a0b7aa1c48246102009a99ccef11b
drm/amdgpu: NUL-terminate securedisplay debugfs input from userspace

Use strncpy_from_user() instead of copy_from_user() before sscanf() in
the securedisplay_test debugfs write handler so a full-length write
cannot leave the stack buffer without a terminator.

Signed-off-by: Candice Li <candice.li@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c