From patchwork Mon Mar 25 18:38:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bugzilla-daemon@freedesktop.org X-Patchwork-Id: 10869853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B92C14DE for ; Mon, 25 Mar 2019 18:38:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80B00285FF for ; Mon, 25 Mar 2019 18:38:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7444E29236; Mon, 25 Mar 2019 18:38:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 13C4C285FF for ; Mon, 25 Mar 2019 18:38:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E73266E724; Mon, 25 Mar 2019 18:38:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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) Received: by culpepper.freedesktop.org (Postfix, from userid 33) id 6B2027215B; Mon, 25 Mar 2019 18:38:36 +0000 (UTC) From: bugzilla-daemon@freedesktop.org To: dri-devel@lists.freedesktop.org Subject: =?utf-8?q?=5BBug_110225=5D_Kernel_panic_while_=E2=80=9C__modprobe_a?= =?utf-8?q?mdkfd_=3B__modprobe_-r_amdkfd_=22__=3B_4=2E14=2E35_kernel_=2E?= Date: Mon, 25 Mar 2019 18:38:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DRI X-Bugzilla-Component: DRM/amdkfd X-Bugzilla-Version: XOrg git X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: John.p.donnelly@oracle.com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: medium X-Bugzilla-Assigned-To: dri-devel@lists.freedesktop.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP https://bugs.freedesktop.org/show_bug.cgi?id=110225 --- 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 [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=0 [ 132.508802] kfd kfd: Initialized module [root@jpd-vmbase02 ~]# modprobe -r amdkfd [ 137.447829] amdkfd: Removed module [root@jpd-vmbase02 ~]# [root@jpd-vmbase02 ~]# 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"); }