From: Samuel Thibault Subject: Re: POC: ncurses in stubdom Date: Tue, 28 Apr 2009 22:56:34 +0200 Message-ID: <20090428205634.GL5777@const.famille.thibault.fr> References: <873abt51e5.fsf@tac.ki.iif.hu> <20090427200544.GN5965@const.famille.thibault.fr> <87skjt3koh.fsf@tac.ki.iif.hu> <20090427211132.GR5965@const.famille.thibault.fr> <87eivc7jbg.fsf@tac.ki.iif.hu> <87ab607i5o.fsf_-_@tac.ki.iif.hu> <20090428183702.GF5777@const.famille.thibault.fr> <87prew5z8o.fsf@tac.ki.iif.hu> <20090428201303.GK5777@const.famille.thibault.fr> <87hc085wx0.fsf@tac.ki.iif.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <87hc085wx0.fsf@tac.ki.iif.hu> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ferenc Wagner Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Ferenc Wagner, le Tue 28 Apr 2009 22:46:19 +0200, a =E9crit : > Samuel Thibault writes: > > Ferenc Wagner, le Tue 28 Apr 2009 21:56:07 +0200, a =E9crit : > > > >> But then trying the operation itself provides the exact same > >> diagnostics. This is what I mean by "pointless". > > > > Ok, but applications could still be upset to see access() work and no= t > > open(), or vice-versa. >=20 > Sure, but then they are buggy. So be they. We unfortunately can't change all of them just by will. > >> #if defined(HAVE_POSIX_MEMALIGN) > >> if (posix_memalign (&p, align, size) !=3D 0) > >> p =3D 0; > >> #elif defined(HAVE_MEMALIGN) > >> p =3D memalign (align, size); > > > > Errr, so grub2 doesn't unconditionally use posix_memalign. How did > > grub2 detect HAVE_POSIX_MEMALIGN? >=20 > By autoconf: > AC_CHECK_FUNCS(posix_memalign memalign asprintf) Mmmmm, and I guess it's linking against the host OS, not the stubdom OS, grmbl. > > Oh right, sorry. The final link is not done there but by the minios > > paragraph of stubdom/Makefile. You can either set APP_LDLIBS to > > -lncurses there, to override the empty default of mini-os/Makefile, o= r > > add -lncurses to APP_LDLIBS in the ifeq($libc),y) section along other= s. >=20 > This is what I did in the POC. Err, in your patch it wasn't in the ifeq section but the empty declaration. > > Ferenc Wagner, le Tue 28 Apr 2009 22:02:03 +0200, a =E9crit : > > > >> Eventually it could as well read the terminfo database from the host= . > >> Btw. it tries to do so by invoking a stat() call, and then segfaults > >> the stubdom. So there's some problem left here, more serious than > >> access(). > > > > Right, I'm not sure we really want to have a stubdom do this. >=20 > Do you mean accessing the host filesystem? I agree that shouldn't be > made necessary, as stubdoms are a security measure in part. Yes. Samuel