[PATCH] iommu: Allocate dev_iommu before accessing priv data

2020-09-01 Thread Torsten Hilbrich
_set call in the function init_no_remapping_devices in the path where !dmar_map_gfx. It turned out that the dev->iommu entry is NULL at this time. Lu Baolu suggested for dev_iommu_priv_set to automatically allocate the iommu entry by using the function dev_iommu_get to retrieve that pointer. This fun

[Regression] [PATCH] iommu: Avoid crash in init_no_remapping_devices if iommu is NULL

2020-08-31 Thread Torsten Hilbrich
n v5.9-rc1: commit 01b9d4e21148c89fdbab3d6b3705f9791314b631 Author: Joerg Roedel Date: Thu Jun 25 15:08:25 2020 +0200 iommu/vt-d: Use dev_iommu_priv_get/set() Remove the use of dev->archdata.iommu and use the private per-device pointer provided by IOMMU core code instead. W

Re: [PATCH 1/1] iommu/vt-d: Fix NULL pointer dereference in dev_iommu_priv_set()

2020-09-03 Thread Torsten Hilbrich
01b9d4e21148c ("iommu/vt-d: Use dev_iommu_priv_get/set()") > Reported-by: Torsten Hilbrich > Reported-by: Wendy Wang > Link: > https://lore.kernel.org/linux-iommu/96717683-70be-7388-3d2f-61131070a...@secunet.com/ > Signed-off-by: Lu Baolu Teste

Re: [Regression] [PATCH] iommu: Avoid crash in init_no_remapping_devices if iommu is NULL

2020-09-01 Thread Torsten Hilbrich
On 01.09.20 04:02, Lu Baolu wrote: [...] > This looks more like a generic issue, used-before-allocated, and should > be fixed in iommu.c instead of VT-d driver. How about > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > index 8fd93a5b8764..a599da87eb60 100644 > ---