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-prev] [day] [month] [year] [list]
Message-ID: <20140904140619.GH7156@arm.com>
Date:	Thu, 4 Sep 2014 15:06:19 +0100
From:	Will Deacon <will.deacon@....com>
To:	Kees Cook <keescook@...omium.org>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Rabin Vincent <rabin@....in>, Rob Herring <robh@...nel.org>,
	Laura Abbott <lauraa@...eaurora.org>,
	Leif Lindholm <leif.lindholm@...aro.org>,
	Stephen Boyd <sboyd@...eaurora.org>,
	"msalter@...hat.com" <msalter@...hat.com>,
	Liu hua <sdu.liu@...wei.com>,
	Nikolay Borisov <Nikolay.Borisov@....com>,
	Nicolas Pitre <nicolas.pitre@...aro.org>,
	Tomasz Figa <t.figa@...sung.com>,
	Doug Anderson <dianders@...gle.com>,
	Jason Wessel <jason.wessel@...driver.com>,
	Catalin Marinas <Catalin.Marinas@....com>,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH v4 4/8] arm: use fixmap for text patching when text is RO

On Thu, Sep 04, 2014 at 03:00:31PM +0100, Kees Cook wrote:
> On Thu, Sep 4, 2014 at 2:27 AM, Will Deacon <will.deacon@....com> wrote:
> > On Wed, Sep 03, 2014 at 10:43:58PM +0100, Kees Cook wrote:
> >> On Wed, Aug 20, 2014 at 5:28 AM, Kees Cook <keescook@...omium.org> wrote:
> >> > On Tue, Aug 19, 2014 at 7:29 AM, Will Deacon <will.deacon@....com> wrote:
> >> >> On Wed, Aug 13, 2014 at 06:06:29PM +0100, Kees Cook wrote:
> >> >>> +     set_fixmap(fixmap, page_to_phys(page));
> >> >>
> >> >> set_fixmap does TLB invalidation, right? I think that means it can block on
> >> >> 11MPCore and A15 w/ the TLBI erratum, so it's not safe to call this with
> >> >> interrupts disabled anyway.
> >> >
> >> > Oh right. Hrm.
> >> >
> >> > In an earlier version of this series set_fixmap did not perform TLB
> >> > invalidation. I wonder if this is not needed at all? (Wouldn't that be
> >> > nice...)
> >>
> >> As suspected, my tests fail spectacularly without the TLB flush.
> >> Adding WARN_ON(!irqs_disabled()) doesn't warn, so I think we're safe
> >> here. Should I leave the WARN_ON in place for clarity, or some other
> >> comments?
> >
> > I thought there was a potential call to spin_lock_irqsave right before
> > this TLB flush?
> 
> I'm not sure I understand what you mean. Should I change something
> here? It looks like irqs are disabled, so isn't this a safe code path?

My point was that it's not safe to call set_fixmap when interrupts are
disabled, because it will try to flush the TLB, and this can lock-up on
some CPUs where it needs to do something like smp_call_function.

Will
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ