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

Shameer Kolothum Thodi skolothumtho at nvidia.com
Fri May 29 05:50:15 PDT 2026



> -----Original Message-----
> From: Jason Gunthorpe <jgg at ziepe.ca>
> Sent: 29 May 2026 12:54
> To: Shameer Kolothum Thodi <skolothumtho at nvidia.com>
> Cc: iommu at lists.linux.dev; linux-kernel at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; Nicolin Chen <nicolinc at nvidia.com>;
> joro at 8bytes.org; will at kernel.org; robin.murphy at arm.com; Nathan Chen
> <nathanc at nvidia.com>; Matt Ochs <mochs at nvidia.com>
> 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



More information about the linux-arm-kernel mailing list