drm/amdkfd: NULL dereference involving create_process()
Subsystems (4)
PATCH 1/1 drm/amdkfd: NULL dereference involving create_process()
We accidentally return ERR_PTR(0) which is NULL. The caller is not expecting that and it leads to an Oops.
drivers/gpu/drm/amd/amdkfd/kfd_process.c +2 -1
@@ -318,7 +318,8 @@ static struct kfd_process *create_process(const struct task_struct *thread)/* init process apertures*/ process->is_32bit_user_mode =in_compat_syscall (); -if (kfd_init_apertures (process) !=0 ) + err =kfd_init_apertures (process); +if (err !=0 ) goto err_init_apretures;return process;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Deucher, Alexander
maintainerQuoted 9 lines
-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Wednesday, June 14, 2017 6:59 AM
To: Oded Gabbay; Alexey Skidanov
Cc: Deucher, Alexander; Koenig, Christian; David Airlie; dri- [email protected]; [email protected]; kernel- [email protected]
Subject: [PATCH] drm/amdkfd: NULL dereference involvingcreate_process()
Quoted 5 lines
We accidentally return
ERR_PTR(0)which is NULL. The caller is not expecting that and it leads to an Oops.Fixes dd59239a9862 ("amdkfd: init aperture once per process")Signed-off-by Dan Carpenter <[email protected]>
Include Felix.
Alex
Quoted 17 lines
drivers/gpu/drm/amd/amdkfd/kfd_process.c +2
-1@@ -318,7 +318,8 @@ static struct kfd_process *create_process(const struct task_struct *thread)/* init process apertures*/ process->is_32bit_user_mode = in_compat_syscall(); -if (kfd_init_apertures (process) !=0 ) + err =kfd_init_apertures (process); +if (err !=0 ) goto err_init_apretures;return process;
Felix Kuehling
maintainerYeah, I saw this earlier. I'm on the amd-gfx list.
The patch looks good to me. Feel free to add my R-b. Do you want to apply it to amd-staging-4.11 and drm-next? I can take care of amd-kfd-staging and the release branches.
Thanks,
Felix
Quoted 37 lines · Alexander
Quoted 9 lines
-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Wednesday, June 14, 2017 6:59 AM
To: Oded Gabbay; Alexey Skidanov
Cc: Deucher, Alexander; Koenig, Christian; David Airlie; dri- [email protected]; [email protected]; kernel- [email protected]
Subject: [PATCH] drm/amdkfd: NULL dereference involvingcreate_process()Quoted 5 lines
We accidentally return
ERR_PTR(0)which is NULL. The caller is not expecting that and it leads to an Oops.Fixes dd59239a9862 ("amdkfd: init aperture once per process")Signed-off-by Dan Carpenter <[email protected]>Include Felix.
Alex
drivers/gpu/drm/amd/amdkfd/kfd_process.c static struct kfd_process *create_process(const
Quoted 7 lines
drivers/gpu/drm/amd/amdkfd/kfd_process.c +0
-0@@ -318,7 +318,8 @@ static struct kfd_process *create_process(conststruct
Quoted 10 lines
drivers/gpu/drm/amd/amdkfd/kfd_process.c +2
-1task_struct *thread)/* init process apertures*/ process->is_32bit_user_mode = in_compat_syscall(); -if (kfd_init_apertures (process) !=0 ) + err =kfd_init_apertures (process); +if (err !=0 ) goto err_init_apretures;return process;
Oded Gabbay
AppliedQuoted 12 lines · Dan Carpenter
We accidentally return
ERR_PTR(0)which is NULL. The caller is not expecting that and it leads to an Oops.Fixes dd59239a9862 ("amdkfd: init aperture once per process")Signed-off-by Dan Carpenter <[email protected]>drivers/gpu/drm/amd/amdkfd/kfd_process.c +0
-0
drivers/gpu/drm/amd/amdkfd/kfd_process.c static struct kfd_process *create_process(const struct task_struct *thread) · line 325
Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_process.c +2
-1@@ -318,7 +318,8 @@ static struct kfd_process *create_process(const struct task_struct *thread)/* init process apertures*/ process->is_32bit_user_mode =in_compat_syscall (); -if (kfd_init_apertures (process) !=0 ) + err =kfd_init_apertures (process); +if (err !=0 ) goto err_init_apretures;return process;
Hi Dan,
Applied to amdkfd-next
Thanks!
Oded