From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"Yang, Lixiao" <lixiao.yang@intel.com>,
Matthew Rosato <mjrosato@linux.ibm.com>,
Nicolin Chen <nicolinc@nvidia.com>,
"Liu, Yi L" <yi.l.liu@intel.com>
Subject: Re: [PATCH 1/4] iommufd: Do not add the same hwpt to the ioas->hwpt_list twice
Date: Tue, 14 Feb 2023 11:14:48 -0400 [thread overview]
Message-ID: <Y+ulaEHbx/uHqx8B@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB527654AA7B3BE05FCD7A12108CA29@BN9PR11MB5276.namprd11.prod.outlook.com>
On Tue, Feb 14, 2023 at 05:51:13AM +0000, Tian, Kevin wrote:
> > From: Jason Gunthorpe <jgg@nvidia.com>
> > Sent: Tuesday, February 14, 2023 2:03 AM
> >
> > The hwpt is added to the hwpt_list only during its creation, it is never
> > added again. This hunk is some missed leftover from rework. Adding it
> > twice will corrupt the linked list in some cases.
> >
> > It effects HWPT specific attachment, which is something the test suite
> > cannot cover until we can create a legitimate struct device with a
> > non-system iommu "driver" (ie we need the bus removed from the iommu
> > code)
> >
> > Cc: stable@vger.kernel.org
> > Fixes: e8d57210035b ("iommufd: Add kAPI toward external drivers for
> > physical devices")
> > Reported-by: Kevin Tian <kevin.tian@intel.com>
> > Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
>
> for stable kernels this kind of fixes an issue in a dead code path
> where no uAPI for user to manually create hwpt or return the
> hwpt id of auto domain to userspace.
>
> from that angle do we still want a fix tag?
I always put fixes tags, no matter how minor.
The cc stable is the thoughtful one.
In this case though there is no way to formall access this API the
HWPT ID does exist and a hostile userspace can guess it to trigger a
kernel bug. So it should be fixed.
Jason
next prev parent reply other threads:[~2023-02-14 15:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-13 18:02 [PATCH 0/4] Fix hwpt lifetime and detach bugs Jason Gunthorpe
2023-02-13 18:02 ` [PATCH 1/4] iommufd: Do not add the same hwpt to the ioas->hwpt_list twice Jason Gunthorpe
2023-02-14 5:51 ` Tian, Kevin
2023-02-14 15:14 ` Jason Gunthorpe [this message]
2023-02-15 1:39 ` Tian, Kevin
2023-02-13 18:02 ` [PATCH 2/4] iommufd: Assert devices_lock for iommufd_hw_pagetable_has_group() Jason Gunthorpe
2023-02-14 5:52 ` Tian, Kevin
2023-02-13 18:02 ` [PATCH 3/4] iommufd: Add iommufd_lock_obj() around the auto-domains hwpts Jason Gunthorpe
2023-02-14 5:55 ` Tian, Kevin
2023-02-13 18:02 ` [PATCH 4/4] iommufd: Simplify the lifecycle of a hwpt Jason Gunthorpe
2023-02-14 6:14 ` Tian, Kevin
2023-02-14 10:41 ` Nicolin Chen
2023-02-14 16:32 ` Jason Gunthorpe
2023-02-16 1:36 ` [PATCH 0/4] Fix hwpt lifetime and detach bugs Jason Gunthorpe
2023-02-22 2:14 ` Tian, Kevin
2023-02-22 12:43 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y+ulaEHbx/uHqx8B@nvidia.com \
--to=jgg@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=kevin.tian@intel.com \
--cc=lixiao.yang@intel.com \
--cc=mjrosato@linux.ibm.com \
--cc=nicolinc@nvidia.com \
--cc=yi.l.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.