From: Joerg Roedel <joro@8bytes.org>
To: Vasant Hegde <vasant.hegde@amd.com>
Cc: iommu@lists.linux.dev, robin.murphy@arm.com, will@kernel.org,
suravee.suthikulpanit@amd.com,
Matt Fagnani <matt.fagnani@bell.net>
Subject: Re: [PATCH 3/3] iommu/amd: Call BUG_ON in page fault hanlder path if domain is NULL
Date: Fri, 3 Feb 2023 10:36:30 +0100 [thread overview]
Message-ID: <Y9zVnkfEp3bC+UfL@8bytes.org> (raw)
In-Reply-To: <20230113135956.5788-3-vasant.hegde@amd.com>
On Fri, Jan 13, 2023 at 01:59:56PM +0000, Vasant Hegde wrote:
> If IOMMU domain for device group is not setup properly then we may hit
> IOMMU page fault. Current page fault handler assumes that domain is
> always setup and it will hit NULL pointer dereference (see below sample log).
>
> This is mostly programming error and difficult to recover from here. Hence
> call BUG_ON().
I agree with Robin here, a BUG_ON() is no improvement over a NULL-ptr
dereference. Just handle the domain == NULL case so that this code-path
will not crash.
Thanks,
Joerg
next prev parent reply other threads:[~2023-02-03 9:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-13 13:59 [PATCH 1/3] iommu: Attach device group to old domain in error path Vasant Hegde
2023-01-13 13:59 ` [PATCH 2/3] iommu/amd: Skip attach device domain is same as new domain Vasant Hegde
2023-01-13 13:59 ` [PATCH 3/3] iommu/amd: Call BUG_ON in page fault hanlder path if domain is NULL Vasant Hegde
2023-01-13 16:15 ` Robin Murphy
2023-01-17 4:56 ` Vasant Hegde
2023-02-03 9:36 ` Joerg Roedel [this message]
2023-02-03 10:40 ` Vasant Hegde
2023-02-03 11:12 ` Joerg Roedel
2023-02-03 16:52 ` Vasant Hegde
2023-02-01 5:19 ` [PATCH 1/3] iommu: Attach device group to old domain in error path Vasant Hegde
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=Y9zVnkfEp3bC+UfL@8bytes.org \
--to=joro@8bytes.org \
--cc=iommu@lists.linux.dev \
--cc=matt.fagnani@bell.net \
--cc=robin.murphy@arm.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=vasant.hegde@amd.com \
--cc=will@kernel.org \
/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.