From: "Jan Beulich" Subject: [PATCH] linux-2.6.18/x86-64: extend numeric user mode selector checks Date: Tue, 04 Oct 2011 11:30:23 +0100 Message-ID: <4E8AFC5F020000780005924F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org ... to also cover Xen provided ones Signed-off-by: Jan Beulich --- a/arch/x86_64/mm/fault-xen.c +++ b/arch/x86_64/mm/fault-xen.c @@ -146,7 +146,8 @@ static noinline int is_prefetch(struct p /* Could check the LDT for lm, but for now it's = good enough to assume that long mode only uses well = known segments or kernel. */ - scan_more =3D (!user_mode(regs)) || (regs->cs = =3D=3D __USER_CS); + scan_more =3D (!user_mode(regs)) || (regs->cs = =3D=3D __USER_CS) + || (regs->cs =3D=3D FLAT_USER_CS64); break; =09 case 0x60: @@ -575,8 +576,8 @@ bad_area_nosemaphore: these addresses are not reachable. Just detect this case and return. Any code segment in LDT is compatibility mode. */ - if ((regs->cs =3D=3D __USER32_CS || (regs->cs & (1<<2))) = && - (address >> 32)) + if ((regs->cs =3D=3D __USER32_CS || regs->cs =3D=3D = FLAT_USER_CS32 || + (regs->cs & (1<<2))) && (address >> 32)) return; =20 if (exception_trace && unhandled_signal(tsk, SIGSEGV)) {