From: Rusty Russell Subject: Re: [PATCH] Prevent unnatural use of ioctl in /proc/xen/xenbus_dev Date: Sat, 10 Sep 2005 22:19:42 +1000 Message-ID: <1126354782.21731.7.camel@localhost.localdomain> References: <1126265347.5623.18.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen Mailing List , Christian Limpach List-Id: xen-devel@lists.xenproject.org On Fri, 2005-09-09 at 13:48 +0100, Keir Fraser wrote: > On 9 Sep 2005, at 12:29, Rusty Russell wrote: > > > xenbus_dev's use of ioctl for read/write is a crime against nature. > > Make it a read-write interface, but check boundaries so we can recover > > if userspace dies. This also simplifies libxenstore. > > How can you cleanly express the request/reponse nature of interacting > with xenstore, and grouping of accesses into transactions, via > read/write? Err... the same way we do when tools interact with the store over a pipe? Which is the same protocol we use in shared memory. > I would imagine you lose valuable framing information that > you end up having to reconstruct. The only painful part is that userspace is now hijacking the kernel's xenstore comms channel. While we clearly trust userspace somewhat, since they're using our ID for operations, we want to ensure that we have a usable channel if they die unexpectedly. Otherwise it would be entirely trivial... Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman