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:	Thu, 23 Apr 2009 13:52:22 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
cc:	Ingo Molnar <mingo@...e.hu>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Glauber de Oliveira Costa <gcosta@...hat.com>,
	Chris Wright <chrisw@...s-sol.org>,
	Rusty Russell <rusty@...tcorp.com.au>,
	Pekka Enberg <penberg@...helsinki.fi>
Subject: Re: [PATCH 0/2] [GIT PULL] tracing: various bug fixes


On Thu, 23 Apr 2009, Jeremy Fitzhardinge wrote:

> Steven Rostedt wrote:
> > Ah, this is a lockdep thing.
> > 
> > The raw_local_irq_save/restore in __native_flush_tlb_global does not update
> > hardirqs_enabled.
> > 
> > When we call into ftrace, when we cross page bounderies, we disable
> > interrupts using the normal local_irq_save/restore calls.
> > 
> > But when we restore, it detects that interrupts are not going to be enabled,
> > and keeps hardirqs_enabled off.
> > 
> > The printk solved the issue because it called local_irq_restore, which set
> > the variable back.
> > 
> > I guess there's two solutions here. One, we can change the
> > raw_local_irq_enable/disable variants in __native_flush_tlb_global to the
> > non-raw type (it should protect against recursion).
> > 
> > or we can try to make the ring buffer use the raw_local_irq variants too. I
> > tried this once before, and it did cause issues.
> > 
> > Note, there's a "check_flags" in lockdep, but it is only called on locking,
> > it is not called when we only disable/enable interrupts.
> >   
> 
> OK, the good news is that its not a callee-save calling convention problem,
> which is what I feared.  But it does sound pretty awkward to fix.  Does
> __native_flush_tlb_global() have to use raw_local_irq_save/restore?

No, I just investigated (and booted) without the raw versions (using the 
normal disable instead). The hooks just update variables in the task 
struct. I see no reason to have use it.

I use to use it with ftrace, but I found that issues are caused if ftrace 
called something internal that used local_irq_save.

Perhaps that is the issue. If something uses raw_local_irq_save then calls 
flush_tlb_global you might get a problem with the flags again (like we did 
here). But the only user of raw_* should be lockdep and irqsoff, and they 
should be able to deal with recursion. I don't think there should be any 
other user.

-- Steve

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