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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 5 Feb 2009 20:13:20 -0500
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	Masami Hiramatsu <mhiramat@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Greg KH <greg@...ah.com>, Nick Piggin <npiggin@...e.de>,
	LKML <linux-kernel@...r.kernel.org>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>,
	Jim Keniston <jkenisto@...ibm.com>,
	systemtap-ml <systemtap@...rces.redhat.com>,
	"Frank Ch. Eigler" <fche@...hat.com>
Subject: Re: [BUGFIX][PATCH -rc/-mm] prevent kprobes from catching spurious
	page  faults

* Ingo Molnar (mingo@...e.hu) wrote:
> 
> * Masami Hiramatsu <mhiramat@...hat.com> wrote:
> 
> > -	if (notify_page_fault(regs))
> > -		return;
> >  	if (unlikely(kmmio_fault(regs, address)))
> >  		return;
> > 
> > @@ -634,6 +632,9 @@ void __kprobes do_page_fault(struct pt_r
> >  		if (spurious_fault(address, error_code))
> >  			return;
> > 
> > +		/* kprobes don't want to hook the spurious faults. */
> > +		if (notify_page_fault(regs))
> > +			return;
> >  		/*
> >  		 * Don't take the mm semaphore here. If we fixup a prefetch
> >  		 * fault we could otherwise deadlock.
> > @@ -641,6 +642,9 @@ void __kprobes do_page_fault(struct pt_r
> >  		goto bad_area_nosemaphore;
> >  	}
> > 
> > +	/* kprobes don't want to hook the spurious faults. */
> > +	if (notify_page_fault(regs))
> > +		return;
> 
> I dont know - this spreads that callback to two places now. Any
> reason why kprobes cannot call spurious_fault(), if there's a
> probe active?
> 
> Also, moving that would remove the planned cleanup of merging these
> two into one call:
> 
>  	if (notify_page_fault(regs))
>  		return;
>   	if (unlikely(kmmio_fault(regs, address)))
>   		return;
> 
> We should reduce the probing cross section, not increase it,
> especially in such a critical codepath as the pagefault handler.
> 
> Btw., why cannot kprobes install a dynamic probe to the fault
> handler itself? That way the default path would have no such
> callbacks and checks at all.
> 

Or we could simply merge my 2 LTTng page fault handler tracepoints per
architecture and be done with it ?

I'd need to clean up the patchset a little bit to fold a few patches,
but that would be straightforward enough.

Mathieu

-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
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