lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue,  2 Aug 2016 11:34:49 -0400
From:	Rafael Aquini <aquini@...hat.com>
To:	linux-kernel@...r.kernel.org
Cc:	linux-mm@...ck.org, x86@...nel.org, luto@...nel.org,
	aarcange@...hat.com, lwoodman@...hat.com, riel@...hat.com,
	mgorman@...e.de, akpm@...ux-foundation.org
Subject: [PATCH] x86/mm: Add barriers and document switch_mm()-vs-flush synchronization follow-up

While backporting 71b3c126e611 ("x86/mm: Add barriers and document switch_mm()-vs-flush synchronization")
we stumbled across a possibly missing barrier at flush_tlb_page().

Following the reasoning presented while introducing the synchronization
barrier at flush_tlb_mm_range(), for the current->active_mm != mm checkpoint:

        if (current->active_mm != mm) {
                /* Synchronize with switch_mm. */
                smp_mb();

                goto out;
        }

it suggests the same barrier should be introduced for the similar
outcome at flush_tlb_page(). This patch add that mentioned missing
barrier and documents its case.

Suggested-by: Andrea Arcangeli <aarcange@...hat.com>
Signed-off-by: Rafael Aquini <aquini@...hat.com>
---
 arch/x86/mm/tlb.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 4dbe656..3b4addc 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -375,6 +375,12 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long start)
 			/* Synchronize with switch_mm. */
 			smp_mb();
 		}
+	} else {
+		/*
+		 * current->active_mm != mm
+		 * Synchronize with switch_mm.
+		 */
+		smp_mb();
 	}
 
 	if (cpumask_any_but(mm_cpumask(mm), smp_processor_id()) < nr_cpu_ids)
-- 
2.5.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ