mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] amdkfd: Copy from the proper user command pointer
@ 2016-01-15 18:26 Borislav Petkov
  2016-01-15 19:09 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Borislav Petkov @ 2016-01-15 18:26 UTC (permalink / raw)
  To: Al Viro; +Cc: LKML

From: Borislav Petkov <bp@suse.de>

8f1d57c17248 ("amdkfd: don't open-code memdup_user()") mistakenly uses
an uninitialized local pointer, gcc complains:

  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c: In function ‘kfd_ioctl_dbg_address_watch’:
  drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:562:12: warning: ‘args_buff’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    args_buff = memdup_user(args_buff,
                ^

Fix it.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index d321222fd92e..d2b49c026cf6 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -558,8 +558,7 @@ static int kfd_ioctl_dbg_address_watch(struct file *filep,
 		return -EINVAL;
 
 	/* this is the actual buffer to work with */
-
-	args_buff = memdup_user(args_buff,
+	args_buff = memdup_user(cmd_from_user,
 				args->buf_size_in_bytes - sizeof(*args));
 	if (IS_ERR(args_buff))
 		return PTR_ERR(args_buff);
-- 
2.3.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] amdkfd: Copy from the proper user command pointer
  2016-01-15 18:26 [PATCH] amdkfd: Copy from the proper user command pointer Borislav Petkov
@ 2016-01-15 19:09 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2016-01-15 19:09 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: LKML

On Fri, Jan 15, 2016 at 07:26:44PM +0100, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> 8f1d57c17248 ("amdkfd: don't open-code memdup_user()") mistakenly uses
> an uninitialized local pointer, gcc complains:
> 
>   drivers/gpu/drm/amd/amdkfd/kfd_chardev.c: In function ‘kfd_ioctl_dbg_address_watch’:
>   drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:562:12: warning: ‘args_buff’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>     args_buff = memdup_user(args_buff,
>                 ^
> 
> Fix it.

Mea culpa...  Applied, and I wonder how the hell I'd missed that..

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-15 19:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-15 18:26 [PATCH] amdkfd: Copy from the proper user command pointer Borislav Petkov
2016-01-15 19:09 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome