public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@redhat.com>
To: airlied@gmail.com, daniel@ffwll.ch, bskeggs@redhat.com,
	kherbst@redhat.com, lyude@redhat.com, sfr@canb.auug.org.au
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, Danilo Krummrich <dakr@redhat.com>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH drm-misc-next 3/5] drm/nouveau: remove incorrect __user annotations
Date: Mon,  7 Aug 2023 18:32:24 +0200	[thread overview]
Message-ID: <20230807163238.2091-4-dakr@redhat.com> (raw)
In-Reply-To: <20230807163238.2091-1-dakr@redhat.com>

Fix copy-paste error causing EXEC and VM_BIND syscalls data pointers
to carry incorrect __user annotations.

Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
---
 drivers/gpu/drm/nouveau/nouveau_exec.c | 6 +++---
 drivers/gpu/drm/nouveau/nouveau_exec.h | 2 +-
 drivers/gpu/drm/nouveau/nouveau_uvmm.c | 6 +++---
 drivers/gpu/drm/nouveau/nouveau_uvmm.h | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_exec.c b/drivers/gpu/drm/nouveau/nouveau_exec.c
index 42d9dd43ea02..0f927adda4ed 100644
--- a/drivers/gpu/drm/nouveau/nouveau_exec.c
+++ b/drivers/gpu/drm/nouveau/nouveau_exec.c
@@ -293,7 +293,7 @@ nouveau_exec(struct nouveau_exec_job_args *args)
 
 static int
 nouveau_exec_ucopy(struct nouveau_exec_job_args *args,
-		   struct drm_nouveau_exec __user *req)
+		   struct drm_nouveau_exec *req)
 {
 	struct drm_nouveau_sync **s;
 	u32 inc = req->wait_count;
@@ -352,7 +352,7 @@ nouveau_exec_ufree(struct nouveau_exec_job_args *args)
 
 int
 nouveau_exec_ioctl_exec(struct drm_device *dev,
-			void __user *data,
+			void *data,
 			struct drm_file *file_priv)
 {
 	struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv);
@@ -360,7 +360,7 @@ nouveau_exec_ioctl_exec(struct drm_device *dev,
 	struct nouveau_abi16_chan *chan16;
 	struct nouveau_channel *chan = NULL;
 	struct nouveau_exec_job_args args = {};
-	struct drm_nouveau_exec __user *req = data;
+	struct drm_nouveau_exec *req = data;
 	int ret = 0;
 
 	if (unlikely(!abi16))
diff --git a/drivers/gpu/drm/nouveau/nouveau_exec.h b/drivers/gpu/drm/nouveau/nouveau_exec.h
index 3032db27b8d7..778cacd90f65 100644
--- a/drivers/gpu/drm/nouveau/nouveau_exec.h
+++ b/drivers/gpu/drm/nouveau/nouveau_exec.h
@@ -48,7 +48,7 @@ struct nouveau_exec_job {
 int nouveau_exec_job_init(struct nouveau_exec_job **job,
 			  struct nouveau_exec_job_args *args);
 
-int nouveau_exec_ioctl_exec(struct drm_device *dev, void __user *data,
+int nouveau_exec_ioctl_exec(struct drm_device *dev, void *data,
 			    struct drm_file *file_priv);
 
 #endif
diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
index b515a21aa08e..2acbac73e57a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
@@ -1687,7 +1687,7 @@ nouveau_uvmm_vm_bind(struct nouveau_uvmm_bind_job_args *args)
 
 static int
 nouveau_uvmm_vm_bind_ucopy(struct nouveau_uvmm_bind_job_args *args,
-			   struct drm_nouveau_vm_bind __user *req)
+			   struct drm_nouveau_vm_bind *req)
 {
 	struct drm_nouveau_sync **s;
 	u32 inc = req->wait_count;
@@ -1749,12 +1749,12 @@ nouveau_uvmm_vm_bind_ufree(struct nouveau_uvmm_bind_job_args *args)
 
 int
 nouveau_uvmm_ioctl_vm_bind(struct drm_device *dev,
-			   void __user *data,
+			   void *data,
 			   struct drm_file *file_priv)
 {
 	struct nouveau_cli *cli = nouveau_cli(file_priv);
 	struct nouveau_uvmm_bind_job_args args = {};
-	struct drm_nouveau_vm_bind __user *req = data;
+	struct drm_nouveau_vm_bind *req = data;
 	int ret = 0;
 
 	if (unlikely(!nouveau_cli_uvmm_locked(cli)))
diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.h b/drivers/gpu/drm/nouveau/nouveau_uvmm.h
index 3923c03012f9..534baadc3bf7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_uvmm.h
+++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.h
@@ -89,10 +89,10 @@ void nouveau_uvmm_fini(struct nouveau_uvmm *uvmm);
 void nouveau_uvmm_bo_map_all(struct nouveau_bo *nvbov, struct nouveau_mem *mem);
 void nouveau_uvmm_bo_unmap_all(struct nouveau_bo *nvbo);
 
-int nouveau_uvmm_ioctl_vm_init(struct drm_device *dev, void __user *data,
+int nouveau_uvmm_ioctl_vm_init(struct drm_device *dev, void *data,
 			       struct drm_file *file_priv);
 
-int nouveau_uvmm_ioctl_vm_bind(struct drm_device *dev, void __user *data,
+int nouveau_uvmm_ioctl_vm_bind(struct drm_device *dev, void *data,
 			       struct drm_file *file_priv);
 
 static inline void nouveau_uvmm_lock(struct nouveau_uvmm *uvmm)
-- 
2.41.0


  parent reply	other threads:[~2023-08-07 16:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 16:32 [PATCH drm-misc-next 0/5] Nouveau VM_BIND uAPI Fixes Danilo Krummrich
2023-08-07 16:32 ` [PATCH drm-misc-next 1/5] nouveau/dmem: fix copy-paste error in nouveau_dmem_migrate_chunk() Danilo Krummrich
2023-08-07 16:32 ` [PATCH drm-misc-next 2/5] drm/nouveau: nvkm: vmm: silence warning from cast Danilo Krummrich
2023-08-07 16:32 ` Danilo Krummrich [this message]
2023-08-07 16:32 ` [PATCH drm-misc-next 4/5] drm/nouveau: uvmm: remove incorrect calls to mas_unlock() Danilo Krummrich
2023-08-07 16:32 ` [PATCH drm-misc-next 5/5] drm/nouveau: uvmm: remove dedicated VM pointer from VMAs Danilo Krummrich
2023-08-08  2:37 ` [PATCH drm-misc-next 0/5] Nouveau VM_BIND uAPI Fixes Dave Airlie

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=20230807163238.2091-4-dakr@redhat.com \
    --to=dakr@redhat.com \
    --cc=airlied@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kherbst@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lyude@redhat.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=sfr@canb.auug.org.au \
    /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