[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<DS7PR12MB5933AD00B803A227CC197E00FE742@DS7PR12MB5933.namprd12.prod.outlook.com>
Date: Tue, 23 Jan 2024 01:06:54 +0000
From: "Bhardwaj, Rajneesh" <Rajneesh.Bhardwaj@....com>
To: Steven Rostedt <rostedt@...dmis.org>, LKML <linux-kernel@...r.kernel.org>
CC: Linus Torvalds <torvalds@...ux-foundation.org>, "Kuehling, Felix"
<Felix.Kuehling@....com>, "Koenig, Christian" <Christian.Koenig@....com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
Subject: RE: [BUG] BUG: kernel NULL pointer dereference at
ttm_device_init+0xb4
[AMD Official Use Only - General]
-----Original Message-----
From: Steven Rostedt <rostedt@...dmis.org>
Sent: Monday, January 22, 2024 6:19 PM
To: LKML <linux-kernel@...r.kernel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>; Bhardwaj, Rajneesh <Rajneesh.Bhardwaj@....com>; Kuehling, Felix <Felix.Kuehling@....com>; Koenig, Christian <Christian.Koenig@....com>; dri-devel@...ts.freedesktop.org
Subject: Re: [BUG] BUG: kernel NULL pointer dereference at ttm_device_init+0xb4
On Mon, 22 Jan 2024 18:15:47 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:
> > ttm_pool_init(&bdev->pool, dev, dev_to_node(dev), use_dma_alloc, use_dma32); <<<------- BUG!
> >
> > Specifically, it appears that dev is NULL and dev_to_node() doesn't
> > like having a NULL pointer passed to it.
> >
>
> Yeah, that qxl_ttm_init() has:
>
> /* No others user of address space so set it to 0 */
> r = ttm_device_init(&qdev->mman.bdev, &qxl_bo_driver, NULL,
> qdev->ddev.anon_inode->i_mapping,
> qdev->ddev.vma_offset_manager,
> false, false);
>
> Where that NULL is "dev"!
>
> Thus that will never work here.
Perhaps this is the real fix?
I think the fix might be already applied to drm misc. Please see, https://lkml.iu.edu/hypermail/linux/kernel/2401.1/06778.html
-- Steve
diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
index f5187b384ae9..bc217b4d6b04 100644
--- a/drivers/gpu/drm/ttm/ttm_device.c
+++ b/drivers/gpu/drm/ttm/ttm_device.c
@@ -215,7 +215,8 @@ int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *func
ttm_sys_man_init(bdev);
- ttm_pool_init(&bdev->pool, dev, dev_to_node(dev), use_dma_alloc, use_dma32);
+ ttm_pool_init(&bdev->pool, dev, dev ? dev_to_node(dev) : NUMA_NO_NODE,
+ use_dma_alloc, use_dma32);
bdev->vma_manager = vma_manager;
spin_lock_init(&bdev->lru_lock);
Powered by blists - more mailing lists