Received: from eggs.gnu.org ([2001:4830:134:3::10]:53799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxWXD-0001QK-GA for qemu-devel@nongnu.org; Fri, 21 Oct 2016 05:54:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxWXA-0005Y1-EG for qemu-devel@nongnu.org; Fri, 21 Oct 2016 05:54:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36372) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bxWXA-0005Xv-8d for qemu-devel@nongnu.org; Fri, 21 Oct 2016 05:54:40 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39CFC8EA29 for ; Fri, 21 Oct 2016 09:54:39 +0000 (UTC) Date: Fri, 21 Oct 2016 10:54:37 +0100 From: Stefan Hajnoczi Message-ID: <20161021095437.GC4648@stefanha-x1.localdomain> References: <1476871708-25096-1-git-send-email-famz@redhat.com> <20161020140827.GA2733@stefanha-x1.localdomain> <20161020143059.GA21349@lemon> <16c8a152-0d2c-2ee0-e33f-35147549788b@redhat.com> <20161021001147.GB27213@lemon> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="z4+8/lEcDcG5Ke9S" Content-Disposition: inline In-Reply-To: <20161021001147.GB27213@lemon> Subject: Re: [Qemu-devel] [PATCH RFC] tcmu: Introduce qemu-tcmu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Andy Grover , qemu-devel@nongnu.org, Paolo Bonzini , Pranith Kumar Karampuri , Vijay Bellur , Huamin Chen --z4+8/lEcDcG5Ke9S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 21, 2016 at 08:11:47AM +0800, Fam Zheng wrote: > On Thu, 10/20 10:21, Andy Grover wrote: > > On 10/20/2016 07:30 AM, Fam Zheng wrote: > > > On Thu, 10/20 15:08, Stefan Hajnoczi wrote: > > > > If a corrupt image is able to execute arbitrary code in the qemu-tc= mu > > > > process, does /dev/uio0 or the tcmu shared memory interface allow g= et > > > > root or kernel privileges? > > >=20 > > > I haven't audited the code, but target_core_user.ko should contain th= e access to > > > /dev/uioX and make sure there is no security risk regarding buggy or = malicious > > > handlers. Otherwise it's a bug that should be fixed. Andy can correct= me if I'm > > > wrong. > >=20 > > Yes... well, TCMU ensures that a bad handler can't scribble to kernel m= emory > > outside the shared memory area. >=20 > Thanks! >=20 > >=20 > > UIO devices are basically a "device drivers in userspace" kind of API so > > they require root to use. I seem to remember somebody mentioning ways t= his > > might work for less-privileged handlers (fd-passing??) but no way to do= this > > exists just yet. >=20 > In my example in the cover letter I use chmod + non-root which seems to be > working properly. So I think fd-passing is a promising mechanism. Is there any way to use the in-kernel SCSI target without root? For example, if an unprivileged user wants to run an iSCSI target on an unprivileged port to serve up a regular file (test.img). If the answer is no then it's unlikely qemu-tcmu can ever be used without root anyway... Stefan --z4+8/lEcDcG5Ke9S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYCeXcAAoJEJykq7OBq3PI87EH+gN59gNBvyDQwlTY5jl2HkgS Js49u0rEjjGINNCgZKmQ/EsVYmZb/vFJf+X6zIX6F2qeCi98gyYImPO1wt8rFIT3 5dVmyb6kHG0lOFWHCYLyttT+pttHbySrLvqUQIW9PNzLq1ZXnLRypKieaUDWqjS/ dhlE4EnOiTAe1ByGSNAyxmklbLFglszKFs6AKOm9aTu3Toae5WCF6hYd4pj8Xfhb orLoZcmxnQOudNSg2rPUc3EjExUfelFmzuz2rf9y75Iz8woujL5+tR0sbQMct4+f VyHozGMBpAcig3+cppQbjNMzJTErJbuuvpItoU6g97sDcgfNQqyJCELmf9Nzb6Q= =2U72 -----END PGP SIGNATURE----- --z4+8/lEcDcG5Ke9S--