Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1723036

Re: [kernel-hardening] [PATCH v5 04/10] arm64: Add __flush_tlb_one()

From Juerg Haefliger <juerg.haefliger@canonical.com>
Newsgroups linux.kernel
Subject Re: [kernel-hardening] [PATCH v5 04/10] arm64: Add __flush_tlb_one()
Date 2017-08-30 07:40 +0200
Message-ID <uk3Tj-4ey-9@gated-at.bofh.it> (permalink)
References (2 earlier) <udCMa-8ux-9@gated-at.bofh.it> <ueqzh-6tX-31@gated-at.bofh.it> <ueqSC-6B0-31@gated-at.bofh.it> <uhHay-30H-19@gated-at.bofh.it> <uhHkd-3jd-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 08/23/2017 07:04 PM, Mark Rutland wrote:
> On Wed, Aug 23, 2017 at 10:58:42AM -0600, Tycho Andersen wrote:
>> Hi Mark,
>>
>> On Mon, Aug 14, 2017 at 05:50:47PM +0100, Mark Rutland wrote:
>>> That said, is there any reason not to use flush_tlb_kernel_range()
>>> directly?
>>
>> So it turns out that there is a difference between __flush_tlb_one() and
>> flush_tlb_kernel_range() on x86: flush_tlb_kernel_range() flushes all the TLBs
>> via on_each_cpu(), where as __flush_tlb_one() only flushes the local TLB (which
>> I think is enough here).
> 
> That sounds suspicious; I don't think that __flush_tlb_one() is
> sufficient.
> 
> If you only do local TLB maintenance, then the page is left accessible
> to other CPUs via the (stale) kernel mappings. i.e. the page isn't
> exclusively mapped by userspace.

We flush all CPUs to get rid of stale entries when a new page is
allocated to userspace that was previously allocated to the kernel.
Is that the scenario you were thinking of?

...Juerg


> Thanks,
> Mark.
> 

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [kernel-hardening] [PATCH v5 04/10] arm64: Add __flush_tlb_one() Juerg Haefliger <juerg.haefliger@canonical.com> - 2017-08-30 07:40 +0200
  Re: [kernel-hardening] [PATCH v5 04/10] arm64: Add __flush_tlb_one() Tycho Andersen <tycho@docker.com> - 2017-08-30 18:50 +0200
    Re: [kernel-hardening] [PATCH v5 04/10] arm64: Add __flush_tlb_one() Mark Rutland <mark.rutland@arm.com> - 2017-08-31 11:50 +0200
      Re: [kernel-hardening] [PATCH v5 04/10] arm64: Add __flush_tlb_one() Tycho Andersen <tycho@docker.com> - 2017-08-31 23:30 +0200
    Re: [kernel-hardening] [PATCH v5 04/10] arm64: Add __flush_tlb_one() Juerg Haefliger <juerg.haefliger@canonical.com> - 2017-08-31 11:50 +0200

csiph-web