drm/amdgpu: Fix shared buff copy to user
authorjsg <jsg@openbsd.org>
Mon, 4 Mar 2024 02:11:22 +0000 (02:11 +0000)
committerjsg <jsg@openbsd.org>
Mon, 4 Mar 2024 02:11:22 +0000 (02:11 +0000)
From Stanley.Yang
cb4541cabb531ce230489a2930c5eaaa91d779ce in linux-6.6.y/6.6.19
2dcf82a8e8dc930655787797ef8a3692b527c7a9 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c

index 468a67b..ca5c86e 100644 (file)
@@ -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: