[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140117164736.GE8715@pd.tnic>
Date: Fri, 17 Jan 2014 17:47:36 +0100
From: Borislav Petkov <bp@...en8.de>
To: "Ren, Qiaowei" <qiaowei.ren@...el.com>
Cc: "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"x86@...nel.org" <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [PATCH 2/5] x86, mpx: hook #BR exception handler to allocate
bound tables
On Fri, Jan 17, 2014 at 02:47:15PM +0000, Ren, Qiaowei wrote:
> > do_bounds
> > |->do_mpx_bt_fault
> > |->allocate_bt
> > |->sys_mmap_pgoff
> > |->vm_mmap_pgoff
> > |->do_mmap_pgoff
> > |->mmap_region
> > |-> kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
> >
> Sorry for my late reply.
>
> Petkov, could you please detail the problem? Memory allocation can't
> be done in the eception handler? I guess it is like do_page_fault(),
> right?
Right, so Steve and I played a couple of scenarios in IRC with this. So
#BR is comparable with #PF, AFAICT, and as expected we don't take any
locks when handling page faults in kernel space as we might deadlock.
Now, what happens if a thread is sleeping on some lock down that
GFP_KERNEL allocation path and another thread gets a #BR and goes that
same mmap_pgoff path and tries to grab that same lock?
Also, what happens if you take a #BR in NMI context, say the NMI
handler?
All I'm trying to say is, it might not be such a good idea to sleep in a
fault handler...
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
--
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