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: <20150130182316.GA30459@jhogan-linux.le.imgtec.org>
Date:	Fri, 30 Jan 2015 18:23:16 +0000
From:	James Hogan <james.hogan@...tec.com>
To:	Aaro Koskinen <aaro.koskinen@....fi>
CC:	"Maciej W. Rozycki" <macro@...ux-mips.org>,
	Ralf Baechle <ralf@...ux-mips.org>,
	David Daney <david.daney@...ium.com>,
	<linux-mips@...ux-mips.org>, <linux-kernel@...r.kernel.org>,
	Hemmo Nieminen <hemmo.nieminen@....fi>,
	<stable@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] MIPS: fix kernel lockup or crash after CPU
 offline/online

On Fri, Jan 30, 2015 at 07:55:32PM +0200, Aaro Koskinen wrote:
> Hi,
> 
> On Fri, Jan 30, 2015 at 02:59:57PM +0000, James Hogan wrote:
> > On 30/01/15 12:47, Maciej W. Rozycki wrote:
> > > On Fri, 30 Jan 2015, James Hogan wrote:
> > > 
> > >>>  Hmm, why can a call to `printk' cause a TLB miss, what's so special about 
> > >>> this function?  Does it use kernel mapped addresses for any purpose such 
> > >>> as `vmalloc'?
> > >>
> > >> It would be the fact netconsole (or whatever other console is in use) is
> > >> built as a kernel module, memory for which is allocated from the vmalloc
> > >> area.
> > > 
> > >  Ah, I see, thanks for enlightening me.  But in that case wouldn't it be 
> > > possible to postpone console output from `printk' until it is safe to 
> > > access the device?  In a manner similar to how for example we handle calls 
> > > to `printk' made from the hardirq context.  That would make things less 
> > > fragile.
> > 
> > Hmm, kernel/printk/printk.c does have:
> > 
> > static inline int can_use_console(unsigned int cpu)
> > {
> > 	return cpu_online(cpu) || have_callable_console();
> > }
> > 
> > which should prevent it dumping printk buffer to console. CPU shouldn't
> > be marked online that early, which suggests that the console has the
> > CON_ANYTIME flag set, which it probably shouldn't if it depends on
> > module code. call_console_drivers() seems to ensure the CPU is online or
> > has CON_ANYTIME before calling the console write callback.
> > 
> > A quick glance and I can't see any evidence of netconsole being able to
> > get CON_ANYTIME.
> 
> It does not set the flag. But flags are kept in module's static data,
> so the original problem stays.
> 
> A.

Ah yes, of course. This approach looks correct to me then.

Cheers
James

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ