Misc fixes for ARM page table allocator (long/short descriptor format)
Subsystems (2)
cover Misc fixes for ARM page table allocator (long/short descriptor format)
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(-)
Signature · 1 line
2.7.4
PATCH 1/2 iommu/io-pgtable-arm: Check for leaf entry before dereferencing it
From: Oleksandr Tyshchenko <[email protected]>
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.
--- drivers/iommu/io-pgtable-arm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm.c +5 -1
@@ -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 */
Signature · 1 line
2.7.4
PATCH 2/2 iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing it
In reply to Oleksandr TyshchenkoFrom: Oleksandr Tyshchenko <[email protected]>
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.
--- drivers/iommu/io-pgtable-arm-v7s.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/iommu/io-pgtable-arm-v7s.c +5 -1
@@ -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 */
Signature · 1 line
2.7.4
cover Misc fixes for ARM page table allocator (long/short descriptor format)
In reply to Oleksandr TyshchenkoHi, all.
Any comments?
Quoted 18 lines · Oleksandr Tyshchenko
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.htmlOleksandr Tyshchenko (2):
iommu/io-pgtable-arm: Check for leaf entry before dereferencing it iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing itdrivers/iommu/io-pgtable-arm-v7s.c | 6 +++++- drivers/iommu/io-pgtable-arm.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-)--
2.7.4
Signature · 3 lines
Regards, Oleksandr Tyshchenko
Robin Murphy
reviewercover Misc fixes for ARM page table allocator (long/short descriptor format)
Quoted 3 lines · Oleksandr Tyshchenko
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.
Quoted 24 lines
Quoted 18 lines · Oleksandr Tyshchenko
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.htmlOleksandr Tyshchenko (2):
iommu/io-pgtable-arm: Check for leaf entry before dereferencing it iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing itdrivers/iommu/io-pgtable-arm-v7s.c | 6 +++++- drivers/iommu/io-pgtable-arm.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-)--
2.7.4
cover Misc fixes for ARM page table allocator (long/short descriptor format)
Quoted 5 lines · Robin Murphy
Quoted 3 lines · Oleksandr Tyshchenko
Hi, all.
Any comments?
Quoted 7 lines
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.
Quoted 26 lines
Quoted 25 lines
Quoted 18 lines · Oleksandr Tyshchenko
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.htmlOleksandr Tyshchenko (2):
iommu/io-pgtable-arm: Check for leaf entry before dereferencing it iommu/io-pgtable-arm-v7s: Check for leaf entry before dereferencing itdrivers/iommu/io-pgtable-arm-v7s.c | 6 +++++- drivers/iommu/io-pgtable-arm.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-)--
2.7.4
Signature · 3 lines
Regards, Oleksandr Tyshchenko