From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: =?UTF-8?B?W0J1ZyAxMTAyMjVdIEtlcm5lbCBwYW5pYyB3aGlsZSDigJwgIG1vZHByb2Jl?= =?UTF-8?B?IGFtZGtmZCA7ICBtb2Rwcm9iZSAtciBhbWRrZmQgIiAgOyA0LjE0LjM1IGtl?= =?UTF-8?B?cm5lbCAu?= Date: Mon, 25 Mar 2019 18:38:36 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1960151094==" Return-path: Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E4CB6E722 for ; Mon, 25 Mar 2019 18:38:36 +0000 (UTC) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1960151094== Content-Type: multipart/alternative; boundary="15535391161.c3f90B.9698" Content-Transfer-Encoding: 7bit --15535391161.c3f90B.9698 Date: Mon, 25 Mar 2019 18:38:36 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D110225 --- Comment #1 from John.p.donnelly@oracle.com --- This was been fixed in 4.20.x upstream: commit c393e9b2d51540b74e18e555df14706098dbf2cc Author: Randy Dunlap Date: Mon Nov 13 18:08:48 2017 +0200 drm/amdkfd: fix amdkfd use-after-free GP fault 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 Signed-off-by: Oded Gabbay diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c index 6c5a9ca..f744cae 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "kfd_priv.h" #define KFD_DRIVER_AUTHOR "AMD Inc. and others" @@ -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"); } [root@jpd-vmbase02 ~]# modprobe amdkfd [ 132.453287] AMD IOMMUv2 driver by Joerg Roedel [ 132.454004] AMD IOMMUv2 functionality not available on this system [ 132.507733] CRAT table not found [ 132.508139] Finished initializing topology ret=3D0 [ 132.508802] kfd kfd: Initialized module [root@jpd-vmbase02 ~]# modprobe -r amdkfd [ 137.447829] amdkfd: Removed module [root@jpd-vmbase02 ~]# [root@jpd-vmbase02 ~]# --=20 You are receiving this mail because: You are the assignee for the bug.= --15535391161.c3f90B.9698 Date: Mon, 25 Mar 2019 18:38:36 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 1 on bug 11022= 5 from Jo= hn.p.donnelly@oracle.com
This was been fixed in 4.20.x  upstream:


commit c393e9b2d51540b74e18e555df14706098dbf2cc
Author: Randy Dunlap <rdunl=
ap@infradead.org>
Date:   Mon Nov 13 18:08:48 2017 +0200

   drm/amdkfd: fix amdkfd use-after-free GP fault

   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 <rdunlap@infradead.org>
   Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c
b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
index 6c5a9ca..f744cae 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
@@ -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"
@@ -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");
}




[root@jpd-vmbase02 ~]# modprobe  amdkfd
[  132.453287] AMD IOMMUv2 driver by Joerg Roedel <jroedel@suse.de>
[  132.454004] AMD IOMMUv2 functionality not available on this system
[  132.507733] CRAT table not found
[  132.508139] Finished initializing topology ret=3D0
[  132.508802] kfd kfd: Initialized module
[root@jpd-vmbase02 ~]# modprobe  -r amdkfd
[  137.447829] amdkfd: Removed module
[root@jpd-vmbase02 ~]#
[root@jpd-vmbase02 ~]#


You are receiving this mail because:
  • You are the assignee for the bug.
= --15535391161.c3f90B.9698-- --===============1960151094== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============1960151094==--