From: jsg Date: Mon, 4 Mar 2024 02:11:22 +0000 (+0000) Subject: drm/amdgpu: Fix shared buff copy to user X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c710c1798c5f19c4f903a7c2d5db4e2f7386d91b;p=openbsd drm/amdgpu: Fix shared buff copy to user From Stanley.Yang cb4541cabb531ce230489a2930c5eaaa91d779ce in linux-6.6.y/6.6.19 2dcf82a8e8dc930655787797ef8a3692b527c7a9 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c index 468a67b302d..ca5c86e5f7c 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c @@ -362,7 +362,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size } } - if (copy_to_user((char *)buf, context->mem_context.shared_buf, shared_buf_len)) + if (copy_to_user((char *)&buf[copy_pos], context->mem_context.shared_buf, shared_buf_len)) ret = -EFAULT; err_free_shared_buf: