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]
Date:	Mon, 12 Dec 2011 17:35:52 +0100 (CET)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Peter Zijlstra <peterz@...radead.org>
cc:	Richard Weinberger <rw@...utronix.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -rt] printk: Disable migration instead of preemption

On Mon, 12 Dec 2011, Peter Zijlstra wrote:

> On Mon, 2011-12-12 at 14:35 +0100, Richard Weinberger wrote:
> > There is no need do disable preemption in vprintk(),
> > disable_migrate() is sufficient.
> > This fixes also a the following bug in -rt:
> > 
> > [   14.759233] BUG: sleeping function called from invalid context
> > at /home/rw/linux-rt/kernel/rtmutex.c:645
> 
> > ---
> >  kernel/printk.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/printk.c b/kernel/printk.c
> > index a50af4e..13d0825 100644
> > --- a/kernel/printk.c
> > +++ b/kernel/printk.c
> > @@ -898,7 +898,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
> >  	boot_delay_msec();
> >  	printk_delay();
> >  
> > -	preempt_disable();
> > +	migrate_disable();
> >  	/* This stops the holder of console_sem just where we want him */
> >  	raw_local_irq_save(flags);
> >  	this_cpu = smp_processor_id();
> > @@ -1029,7 +1029,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
> >  out_restore_irqs:
> >  	raw_local_irq_restore(flags);
> >  
> > -	preempt_enable();
> > +	migrate_enable();
> >  	return printed_len;
> >  }
> >  EXPORT_SYMBOL(printk);
> 
> One has to wonder why this patch makes any difference what so ever, note
> how right after/before the preempt_disable/enable there's a
> raw_local_irq_save/restore and last time I checked those really did
> disable IRQs, even on -rt.

The point is that we drop that lock further down and on RT we also
reenable interrupts, so we have to prevent that we get migrated away.

Thanks,

	tglx
--
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