Skip to content

Commit

Permalink
drm/amdkfd: fix amdkfd use-after-free GP fault
Browse files Browse the repository at this point in the history
Fix GP fault caused by dev_info() reference to a struct device*
after the device has been freed (use after free).
kfd_chardev_exit() frees the device so 'kfd_device' should not
be used after calling kfd_chardev_exit().

Signed-off-by: Randy Dunlap <[email protected]>
Signed-off-by: Oded Gabbay <[email protected]>
  • Loading branch information
rddunlap authored and ogabbay committed Nov 26, 2017
1 parent 8c946b8 commit c393e9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdkfd/kfd_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/sched.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/printk.h>
#include "kfd_priv.h"

#define KFD_DRIVER_AUTHOR "AMD Inc. and others"
Expand Down Expand Up @@ -132,7 +133,7 @@ static void __exit kfd_module_exit(void)
kfd_process_destroy_wq();
kfd_topology_shutdown();
kfd_chardev_exit();
dev_info(kfd_device, "Removed module\n");
pr_info("amdkfd: Removed module\n");
}

module_init(kfd_module_init);
Expand Down

0 comments on commit c393e9b

Please sign in to comment.