Return-Path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:54773 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754326AbdGYAKD (ORCPT ); Mon, 24 Jul 2017 20:10:03 -0400 Date: Tue, 25 Jul 2017 02:09:55 +0200 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= To: gregkh@linuxfoundation.org Cc: jgross@suse.com, stable@vger.kernel.org Subject: Re: WTF: patch "[PATCH] x86/xen: allow userspace access during hypercalls" was seriously submitted to be applied to the 4.12-stable tree? Message-ID: <20170725000955.GG1095@mail-itl> References: <1500939902223208@kroah.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZukBEUNXiWwEFff2" Content-Disposition: inline In-Reply-To: <1500939902223208@kroah.com> Sender: stable-owner@vger.kernel.org List-ID: --ZukBEUNXiWwEFff2 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 24, 2017 at 04:45:02PM -0700, gregkh@linuxfoundation.org wrote: > The patch below was submitted to be applied to the 4.12-stable tree. >=20 > I fail to see how this patch meets the stable kernel rules as found at > Documentation/process/stable_kernel_rules.rst. >=20 > I could be totally wrong, and if so, please respond to=20 > and let me know why this patch should be > applied. Otherwise, it is now dropped from my patch queues, never to be > seen again. This is a fix for -EFAULT on (any?) usage of /dev/xen/privcmd from inside of Xen HVM guest with SMAP enabled. Details in this thread: http://markmail.org/message/b6wxaipxbjyhiueg > thanks, >=20 > greg k-h >=20 > ------------------ original commit in Linus's tree ------------------ >=20 > From c54590cac51db8ab5fd30156bdaba34af915e629 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Marek=3D20Marczykowski-G=3DC3=3DB3recki?=3D > > Date: Mon, 26 Jun 2017 14:49:46 +0200 > Subject: [PATCH] x86/xen: allow userspace access during hypercalls > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit >=20 > Userspace application can do a hypercall through /dev/xen/privcmd, and > some for some hypercalls argument is a pointers to user-provided > structure. When SMAP is supported and enabled, hypervisor can't access. > So, lets allow it. >=20 > The same applies to HYPERVISOR_dm_op, where additionally privcmd driver > carefully verify buffer addresses. >=20 > Cc: stable@vger.kernel.org > Signed-off-by: Marek Marczykowski-G=C3=B3recki > Reviewed-by: Juergen Gross > Signed-off-by: Juergen Gross >=20 > diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/= xen/hypercall.h > index 7a4db5fefd15..11071fcd630e 100644 > --- a/arch/x86/include/asm/xen/hypercall.h > +++ b/arch/x86/include/asm/xen/hypercall.h > @@ -43,6 +43,7 @@ > =20 > #include > #include > +#include > =20 > #include > #include > @@ -216,10 +217,12 @@ privcmd_call(unsigned call, > __HYPERCALL_DECLS; > __HYPERCALL_5ARG(a1, a2, a3, a4, a5); > =20 > + stac(); > asm volatile("call *%[call]" > : __HYPERCALL_5PARAM > : [call] "a" (&hypercall_page[call]) > : __HYPERCALL_CLOBBER5); > + clac(); > =20 > return (long)__res; > } > @@ -478,7 +481,11 @@ static inline int > HYPERVISOR_dm_op( > domid_t dom, unsigned int nr_bufs, struct xen_dm_op_buf *bufs) > { > - return _hypercall3(int, dm_op, dom, nr_bufs, bufs); > + int ret; > + stac(); > + ret =3D _hypercall3(int, dm_op, dom, nr_bufs, bufs); > + clac(); > + return ret; > } > =20 > static inline void >=20 --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --ZukBEUNXiWwEFff2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJZdoxUAAoJENuP0xzK19csbooH/06zakVXPJKiO3QdpdeuU/CO N3bL9zft/7V6TVUNI7EZDXitjCvifmR3qL9J9GzBp3ADz2mpCu/3AYkBDJBFFVRZ JKFY0vvtwALNE20AKyofimbsum4do6rvuG+YNidnUm3sh58EUIPfbCd1Y6vE76hp yraRXuHGQAxqY9lqGPEaQI5GvJuC4mJJjsW0+OWe51SPNMJe++kGThH85aDhXru/ LiQ2n9rfFm0iOAvZeU0STTzBeFlkjBkGBu2q6hNh/eZZmK0C8hpMtunT0PrSvPJI DqgKzaz/XUDJSm2lZlY3Iw6RvsXnQVfIH8jJVJZ1LpfGq29seevbkEr8VXpI9FY= =m00O -----END PGP SIGNATURE----- --ZukBEUNXiWwEFff2--