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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1539087798.23085.29.camel@synopsys.com>
Date:   Tue, 9 Oct 2018 12:23:18 +0000
From:   Eugeniy Paltsev <eugeniy.paltsev@...opsys.com>
To:     "Eugeniy.Paltsev@...opsys.com" <Eugeniy.Paltsev@...opsys.com>,
        "Vineet Gupta" <vineet.gupta1@...opsys.com>,
        "linux-snps-arc@...ts.infradead.org" 
        <linux-snps-arc@...ts.infradead.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Alexey Brodkin" <alexey.brodkin@...opsys.com>
Subject: Re: [PATCH] ARC: IOC: panic if kernel was started with previously
 enabled IOC

On Fri, 2018-10-05 at 22:56 +0000, Vineet Gupta wrote:
> On 10/04/2018 06:12 AM, Eugeniy Paltsev wrote:
> >  
> > diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c
> > index f2701c13a66b..ee7b63e9c5e3 100644
> > --- a/arch/arc/mm/cache.c
> > +++ b/arch/arc/mm/cache.c
> > @@ -1144,6 +1144,25 @@ noinline void __init arc_ioc_setup(void)
> >  {
> >  	unsigned int ioc_base, mem_sz;
> >  
> > +	/*
> > +	 * Disabling and reconfiguring of IOC are quite a tricky actions because
> > +	 * nobody knows what happens if there're IOC-ahndled tarnsactions in
> > +	 * flight when we're disabling IOC.
> > +	 *
> > +	 * And the problem is external DMA masters [that were initialized and
> > +	 * set in a bootlaoder that was executed before we got here] might
> > +	 * continue to send data to memory even at this point and we have
> > +	 * no way to prevent that.
> > +	 *
> > +	 * That said it's much safer to not enable IOC at all anywhere before
> > +	 * Linux kernel.
> > +	 */
> > +	if (read_aux_reg(ARC_REG_IO_COH_ENABLE) & ARC_IO_COH_ENABLE_BIT)
> > +		panic("kernel was started with previously enabled IOC!\n");
> 
> While I understand the needs, this seems excessive, should we warm the user,
> instead of panic ? Did you run into specific issue to warrant this !

Yes we've run into this.
Remember, we have IOC disabled (actually 'not enabled') in most of HSDK linux demos
(https://github.com/foss-for-synopsys-dwc-arc-processors/buildroot-demos/releases)

So we faced several times that this demos crashes different weird ways when we
accidentally launch them using old u-boot (which enables IOC by default!)

As we don't want to forcibly disable IOC during linux launch
(https://lkml.org/lkml/2018/1/19/557) 
I guess panic is what we need here.

> OTOH in recent past more than 1 person ran into some hsdk uboot shenanigans, where
> we had to upgrade the uboot to get it working with prebuit images - is that what
> you are trying to prevent here - panic early instead of random user errors / hangs
> later ?

Yes, I prefer to panic early instead of random errors / crashes later.
The problem with warning here is that it isn't very clear / easy to match warning
message with some random error.

> -Vineet
-- 
 Eugeniy Paltsev

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ