* [PATCH v1 0/2] Misc fixes for ARM page table allocator (long/short descriptor format)
@ 2017-02-27 12:30 Oleksandr Tyshchenko
[not found] ` <1488198626-1884-1-git-send-email-olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Oleksandr Tyshchenko @ 2017-02-27 12:30 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
Cc: vlad.babchuk-Re5JQEeQqe8AvxtiuMwx3w, will.deacon-5wv7dgnIgG8,
andrii.anisov-Re5JQEeQqe8AvxtiuMwx3w,
andr2000-Re5JQEeQqe8AvxtiuMwx3w, al1img-Re5JQEeQqe8AvxtiuMwx3w,
joculator-Re5JQEeQqe8AvxtiuMwx3w
Hi.
There is a small patch series which contains the same fix for both
descriptor formats based on the preceding RFC patches:
https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020411.html
https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020477.html
Oleksandr Tyshchenko (2):
iommu/io-pgtable-arm: Check for leaf entry before dereferencing it
iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it
drivers/iommu/io-pgtable-arm-v7s.c | 6 +++++-
drivers/iommu/io-pgtable-arm.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread[parent not found: <1488198626-1884-1-git-send-email-olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* [PATCH v1 1/2] iommu/io-pgtable-arm: Check for leaf entry before dereferencing it [not found] ` <1488198626-1884-1-git-send-email-olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2017-02-27 12:30 ` Oleksandr Tyshchenko 2017-02-27 12:30 ` [PATCH v1 2/2] iommu/io-pgtable-arm-v7s: " Oleksandr Tyshchenko 2017-03-16 9:19 ` [PATCH v1 0/2] Misc fixes for ARM page table allocator (long/short descriptor format) Oleksandr Tyshchenko 2 siblings, 0 replies; 6+ messages in thread From: Oleksandr Tyshchenko @ 2017-02-27 12:30 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA Cc: vlad.babchuk-Re5JQEeQqe8AvxtiuMwx3w, will.deacon-5wv7dgnIgG8, andrii.anisov-Re5JQEeQqe8AvxtiuMwx3w, andr2000-Re5JQEeQqe8AvxtiuMwx3w, al1img-Re5JQEeQqe8AvxtiuMwx3w, joculator-Re5JQEeQqe8AvxtiuMwx3w From: Oleksandr Tyshchenko <oleksandr_tyshchenko-uRwfk40T5oI@public.gmane.org> Do a check for already installed leaf entry at the current level before dereferencing it in order to avoid walking the page table down with wrong pointer to the next level. Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko-uRwfk40T5oI@public.gmane.org> CC: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org> CC: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> --- drivers/iommu/io-pgtable-arm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index feacc54..f9bc6eb 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -335,8 +335,12 @@ static int __arm_lpae_map(struct arm_lpae_io_pgtable *data, unsigned long iova, if (cfg->quirks & IO_PGTABLE_QUIRK_ARM_NS) pte |= ARM_LPAE_PTE_NSTABLE; __arm_lpae_set_pte(ptep, pte, cfg); - } else { + } else if (!iopte_leaf(pte, lvl)) { cptep = iopte_deref(pte, data); + } else { + /* We require an unmap first */ + WARN_ON(!selftest_running); + return -EEXIST; } /* Rinse, repeat */ -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 2/2] iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it [not found] ` <1488198626-1884-1-git-send-email-olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2017-02-27 12:30 ` [PATCH v1 1/2] iommu/io-pgtable-arm: Check for leaf entry before dereferencing it Oleksandr Tyshchenko @ 2017-02-27 12:30 ` Oleksandr Tyshchenko 2017-03-16 9:19 ` [PATCH v1 0/2] Misc fixes for ARM page table allocator (long/short descriptor format) Oleksandr Tyshchenko 2 siblings, 0 replies; 6+ messages in thread From: Oleksandr Tyshchenko @ 2017-02-27 12:30 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA Cc: vlad.babchuk-Re5JQEeQqe8AvxtiuMwx3w, will.deacon-5wv7dgnIgG8, andrii.anisov-Re5JQEeQqe8AvxtiuMwx3w, andr2000-Re5JQEeQqe8AvxtiuMwx3w, al1img-Re5JQEeQqe8AvxtiuMwx3w, joculator-Re5JQEeQqe8AvxtiuMwx3w From: Oleksandr Tyshchenko <oleksandr_tyshchenko-uRwfk40T5oI@public.gmane.org> Do a check for already installed leaf entry at the current level before dereferencing it in order to avoid walking the page table down with wrong pointer to the next level. Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko-uRwfk40T5oI@public.gmane.org> CC: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org> CC: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> --- drivers/iommu/io-pgtable-arm-v7s.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c index 1c049e2..8d6ca28 100644 --- a/drivers/iommu/io-pgtable-arm-v7s.c +++ b/drivers/iommu/io-pgtable-arm-v7s.c @@ -422,8 +422,12 @@ static int __arm_v7s_map(struct arm_v7s_io_pgtable *data, unsigned long iova, pte |= ARM_V7S_ATTR_NS_TABLE; __arm_v7s_set_pte(ptep, pte, 1, cfg); - } else { + } else if (ARM_V7S_PTE_IS_TABLE(pte, lvl)) { cptep = iopte_deref(pte, lvl); + } else { + /* We require an unmap first */ + WARN_ON(!selftest_running); + return -EEXIST; } /* Rinse, repeat */ -- 2.7.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 0/2] Misc fixes for ARM page table allocator (long/short descriptor format) [not found] ` <1488198626-1884-1-git-send-email-olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2017-02-27 12:30 ` [PATCH v1 1/2] iommu/io-pgtable-arm: Check for leaf entry before dereferencing it Oleksandr Tyshchenko 2017-02-27 12:30 ` [PATCH v1 2/2] iommu/io-pgtable-arm-v7s: " Oleksandr Tyshchenko @ 2017-03-16 9:19 ` Oleksandr Tyshchenko [not found] ` <CAPD2p-=3Q7KKct29kjSi0=_-R7e3L5sgC-N4zS=BDa1vGc8uuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2 siblings, 1 reply; 6+ messages in thread From: Oleksandr Tyshchenko @ 2017-03-16 9:19 UTC (permalink / raw) To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA Cc: Volodymyr Babchuk, Will Deacon, Andrii Anisov, Oleksandr Andrushchenko, al1img, Artem Mygaiev Hi, all. Any comments? On Mon, Feb 27, 2017 at 2:30 PM, Oleksandr Tyshchenko <olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hi. > > There is a small patch series which contains the same fix for both > descriptor formats based on the preceding RFC patches: > https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020411.html > https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020477.html > > Oleksandr Tyshchenko (2): > iommu/io-pgtable-arm: Check for leaf entry before dereferencing it > iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it > > drivers/iommu/io-pgtable-arm-v7s.c | 6 +++++- > drivers/iommu/io-pgtable-arm.c | 6 +++++- > 2 files changed, 10 insertions(+), 2 deletions(-) > > -- > 2.7.4 > -- Regards, Oleksandr Tyshchenko ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <CAPD2p-=3Q7KKct29kjSi0=_-R7e3L5sgC-N4zS=BDa1vGc8uuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH v1 0/2] Misc fixes for ARM page table allocator (long/short descriptor format) [not found] ` <CAPD2p-=3Q7KKct29kjSi0=_-R7e3L5sgC-N4zS=BDa1vGc8uuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2017-03-16 11:19 ` Robin Murphy [not found] ` <9c726317-6669-91d9-ff42-9ad47c144a3e-5wv7dgnIgG8@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Robin Murphy @ 2017-03-16 11:19 UTC (permalink / raw) To: Oleksandr Tyshchenko, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA Cc: Volodymyr Babchuk, Will Deacon, Andrii Anisov, Oleksandr Andrushchenko, al1img, Artem Mygaiev On 16/03/17 09:19, Oleksandr Tyshchenko wrote: > Hi, all. > > Any comments? Er, no, but in a good way ;) Patches look fine to me, and I see Will's already queued them anyway. Thanks for the respin, and apologies for losing it in my inbox! Robin. > > On Mon, Feb 27, 2017 at 2:30 PM, Oleksandr Tyshchenko > <olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hi. >> >> There is a small patch series which contains the same fix for both >> descriptor formats based on the preceding RFC patches: >> https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020411.html >> https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020477.html >> >> Oleksandr Tyshchenko (2): >> iommu/io-pgtable-arm: Check for leaf entry before dereferencing it >> iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it >> >> drivers/iommu/io-pgtable-arm-v7s.c | 6 +++++- >> drivers/iommu/io-pgtable-arm.c | 6 +++++- >> 2 files changed, 10 insertions(+), 2 deletions(-) >> >> -- >> 2.7.4 >> > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <9c726317-6669-91d9-ff42-9ad47c144a3e-5wv7dgnIgG8@public.gmane.org>]
* Re: [PATCH v1 0/2] Misc fixes for ARM page table allocator (long/short descriptor format) [not found] ` <9c726317-6669-91d9-ff42-9ad47c144a3e-5wv7dgnIgG8@public.gmane.org> @ 2017-03-16 11:22 ` Oleksandr Tyshchenko 0 siblings, 0 replies; 6+ messages in thread From: Oleksandr Tyshchenko @ 2017-03-16 11:22 UTC (permalink / raw) To: Robin Murphy Cc: Volodymyr Babchuk, Will Deacon, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, Andrii Anisov, Oleksandr Andrushchenko, al1img, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Artem Mygaiev On Thu, Mar 16, 2017 at 1:19 PM, Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org> wrote: > On 16/03/17 09:19, Oleksandr Tyshchenko wrote: >> Hi, all. >> >> Any comments? > > Er, no, but in a good way ;) > > Patches look fine to me, and I see Will's already queued them anyway. > > Thanks for the respin, and apologies for losing it in my inbox! > > Robin. Great, thank you. > >> >> On Mon, Feb 27, 2017 at 2:30 PM, Oleksandr Tyshchenko >> <olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> Hi. >>> >>> There is a small patch series which contains the same fix for both >>> descriptor formats based on the preceding RFC patches: >>> https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020411.html >>> https://lists.linuxfoundation.org/pipermail/iommu/2017-February/020477.html >>> >>> Oleksandr Tyshchenko (2): >>> iommu/io-pgtable-arm: Check for leaf entry before dereferencing it >>> iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it >>> >>> drivers/iommu/io-pgtable-arm-v7s.c | 6 +++++- >>> drivers/iommu/io-pgtable-arm.c | 6 +++++- >>> 2 files changed, 10 insertions(+), 2 deletions(-) >>> >>> -- >>> 2.7.4 >>> >> >> >> > -- Regards, Oleksandr Tyshchenko ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-03-16 11:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-27 12:30 [PATCH v1 0/2] Misc fixes for ARM page table allocator (long/short descriptor format) Oleksandr Tyshchenko
[not found] ` <1488198626-1884-1-git-send-email-olekstysh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-27 12:30 ` [PATCH v1 1/2] iommu/io-pgtable-arm: Check for leaf entry before dereferencing it Oleksandr Tyshchenko
2017-02-27 12:30 ` [PATCH v1 2/2] iommu/io-pgtable-arm-v7s: " Oleksandr Tyshchenko
2017-03-16 9:19 ` [PATCH v1 0/2] Misc fixes for ARM page table allocator (long/short descriptor format) Oleksandr Tyshchenko
[not found] ` <CAPD2p-=3Q7KKct29kjSi0=_-R7e3L5sgC-N4zS=BDa1vGc8uuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-16 11:19 ` Robin Murphy
[not found] ` <9c726317-6669-91d9-ff42-9ad47c144a3e-5wv7dgnIgG8@public.gmane.org>
2017-03-16 11:22 ` Oleksandr Tyshchenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox