RE: [PATCH] iommu/tegra241-cmdqv: Skip CMD_SYNC flush during remove

From: Shameer Kolothum Thodi

Date: Fri May 29 2026 - 08:51:02 EST




> -----Original Message-----
> From: Jason Gunthorpe <jgg@xxxxxxxx>
> Sent: 29 May 2026 12:54
> To: Shameer Kolothum Thodi <skolothumtho@xxxxxxxxxx>
> Cc: iommu@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; Nicolin Chen <nicolinc@xxxxxxxxxx>;
> joro@xxxxxxxxxx; will@xxxxxxxxxx; robin.murphy@xxxxxxx; Nathan Chen
> <nathanc@xxxxxxxxxx>; Matt Ochs <mochs@xxxxxxxxxx>
> Subject: Re: [PATCH] iommu/tegra241-cmdqv: Skip CMD_SYNC flush during
> remove
>
> External email: Use caution opening links or attachments
>
>
> On Fri, May 29, 2026 at 10:10:52AM +0100, Shameer Kolothum wrote:
>
> > @@ -789,6 +794,13 @@ static void tegra241_cmdqv_remove(struct
> arm_smmu_device *smmu)
> > container_of(smmu, struct tegra241_cmdqv, smmu);
> > u16 idx;
> >
> > + /*
> > + * tegra241_cmdqv_remove() is added to devres at the very beginning.
> So,
> > + * at this point, devres has already freed the SMMU resources that this
> > + * path must not access to avoid a UAF.
> > + */
> > + cmdqv->removing = true;
>
> Please don't add random bools to avoid devm bugs. Just don't use devm,
> or maybe fix the devm ordering.. These ordering bugs are a well known
> problem with using devm :(

Ok. Let me take another look at this.

Thanks,
Shameer