All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Eric Paris <eparis@redhat.com>
Cc: Guido Trentalancia <guido@trentalancia.com>,
	Eric Paris <eparis@parisplace.org>,
	SELinux Mail List <selinux@tycho.nsa.gov>
Subject: Re: [PATCH] Fix includes for userspace tools and libraries (and possible security issue)
Date: Tue, 13 Sep 2011 16:42:11 -0400	[thread overview]
Message-ID: <1315946531.12522.96.camel@moss-pluto> (raw)
In-Reply-To: <1315945618.2738.13.camel@localhost>

On Tue, 2011-09-13 at 16:26 -0400, Eric Paris wrote:
> On Tue, 2011-09-13 at 22:04 +0200, Guido Trentalancia wrote:
> > On Tue, 2011-09-13 at 15:34 -0400, Stephen Smalley wrote:
> > > On Tue, 2011-09-13 at 15:25 -0400, Stephen Smalley wrote:
> > > > On Tue, 2011-09-13 at 21:18 +0200, Guido Trentalancia wrote:
> > > > > Hello again.
> > > > > 
> > > > > The security risk associated with the linkage of an old libsepol.a
> > > > > static library is low due to the fact that the tools are usually built
> > > > > from each component separately after all the libraries have been
> > > > > previously built and installed.
> > > > > 
> > > > > On Tue, 2011-09-13 at 14:48 -0400, Stephen Smalley wrote:
> > > > > > On Tue, 2011-09-13 at 20:33 +0200, Guido Trentalancia wrote:
> > > > > > > No, it doesn't currently ! If you want to try reproducing it, then you
> > > > > > > should do so on a system which hasn't got it already installed (or make
> > > > > > > sure you get temporarily rid of
> > > > > > > $(PREFIX)/include/{selinux,sepol,semanage} and
> > > > > > > $(LIBDIR)/lib{selinux,sepol,semanage}.* first).
> > 
> > [cut]
> > 
> > > I suppose the one thing that might not be clear is that the Makefile
> > > orders the SUBDIRS in order of dependency, so that we build and install
> > > libsepol first, then libselinux, and so on such that the headers and
> > > libraries required to build each component are already installed before
> > > we build that component.
> > 
> > It is up to the maintainer to keep the SUBDIRS variable ordered
> > (according to the dependency relations).
> > 
> > See for example:
> > 
> > http://www.gnu.org/s/hello/manual/make/Phony-Targets.html#Phony-Targets
> > http://www.gnu.org/s/hello/manual/automake/Subdirectories.html
> > 
> > > In your case, the sepol headers should have
> > > already been installed before trying to build libselinux, and I don't
> > > know why that didn't happen for you unless your make reorders SUBDIRS
> > > internally or the make install in libsepol failed to complete (but I
> > > wouldn't expect it to proceed in that case).
> > 
> > The make tool should not reorder variables in any case.
> > 
> > I did not issue a "make install" (yet). I did just issue "make" from the
> > top-level directory.
> > 
> > I am not building the components separately, I am building the whole
> > bundle (tools + libraries) from the top-level directory of the git
> > version. That's the point.
> 
> I, recently, applied a patch which changed the top level default from
> install to all.  sds says the 'right' way to build the git tree WAS to
> call "make DESTDIR=~/out"  (Remember the default was to install).  Since
> I changed the default target the new way to build out of the tree is to
> call "make DESTDIR=~/out install"
> 
> I have no plans at this time to revert my commit which changed the
> default from 'install' to 'all'.  It is just flat out totally wrong that
> cloning the git tree and typing make can break your running system.
> Period.  I agree that we must be certain not to break anyone who decides
> to still use 'make DESTDIR=~/out install' method.  Note: I'm fine that
> this means I'm forcing sds to use the install target instead of the
> default target from here out.  The old default target was a very bad
> idea.  If you know you need to type DESTDIR= you can also know to type
> 'install.'  If this doesn't work, I need to fix it.  (It doesn't work
> for me, but I'm not certain why just yet)
> 
> Personally, I'd like to see just 'make' at the top level dir build
> properly and I think your patches get us most of the way there without
> (further) breaking the building method that sds prefers.
> 
> If you get your best patch which does nothing but allow us to just type
> 'make' at the top level dir and it builds everything properly in place,
> I'll review and probably commit such a patch.

Be sure to test at least the following scenarios:
1) No sepol/selinux/semanage system headers installed on build host,
2) Old/incompatible sepol/selinux/semanage system headers installed on
build host (e.g. f14 build host, latest selinux git tree),
3) Ability to build each component separately without the rest of the
source tree, e.g. package rebuilds.

The make DESTDIR=~/out install approach enabled the first two to work
without breaking the third, which is why it was attractive.  If he can
make all three work via another mechanism, then I'm fine with it.

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2011-09-13 20:42 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-09 17:01 [PATCH] Fix include semanage/handle.h for semanage_set_root() as used by semodule Guido Trentalancia
2011-09-09 17:11 ` Guido Trentalancia
2011-09-09 17:17 ` Guido Trentalancia
2011-09-09 17:31   ` Eric Paris
2011-09-09 17:46     ` Guido Trentalancia
2011-09-09 17:59       ` [PATCH] Fix LIBDIR usage for load_policy (was Re: [PATCH] Fix include semanage/handle.h for semanage_set_root() as used by semodule) Guido Trentalancia
2011-09-09 21:19         ` [RFC] Userspace top-level Makefile (was Re: [PATCH] Fix LIBDIR usage for load_policy) Guido Trentalancia
2011-09-09 21:37           ` Joshua Brindle
2011-09-09 21:46             ` Guido Trentalancia
2011-09-09 22:35             ` Guido Trentalancia
2011-09-09 23:07               ` Eric Paris
2011-09-09 23:12                 ` Guido Trentalancia
2011-09-09 23:15                   ` Eric Paris
2011-09-09 23:25                     ` Guido Trentalancia
2011-09-09 23:45                       ` Guido Trentalancia
2011-09-09 23:56                         ` Guido Trentalancia
2011-09-10  1:04                           ` [RFC] Userspace git local build (was Re: [RFC] Userspace top-level Makefile) Guido Trentalancia
2011-09-10  2:39                             ` [RFC v2] Userspace git local build (was Re: [RFC] Userspace git local build) Guido Trentalancia
2011-09-11 23:22                     ` [RFC] Userspace top-level Makefile (was Re: [PATCH] Fix LIBDIR usage for load_policy) Joshua Brindle
2011-09-12  2:12                       ` Guido Trentalancia
2011-09-12 12:41                         ` Joshua Brindle
2011-09-12 20:17                           ` [RFC] Improve installation of userspace shared libraries (was Re: [RFC] Userspace top-level Makefile) Guido Trentalancia
2011-09-13 21:00                             ` Stephen Smalley
2011-09-13 21:12                               ` Guido Trentalancia
2011-09-13 21:35                                 ` Guido Trentalancia
2011-09-12 12:57     ` [PATCH] Fix include semanage/handle.h for semanage_set_root() as used by semodule Stephen Smalley
2011-09-12 20:29       ` [PATCH] Fix includes for userspace tools and libraries (was Re: [PATCH] Fix include semanage/handle.h for semanage_set_root() as used by semodule) Guido Trentalancia
2011-09-12 22:01         ` Eric Paris
2011-09-12 23:05           ` Guido Trentalancia
2011-09-13  0:53             ` Guido Trentalancia
2011-09-13  2:03               ` [PATCH v2] Fix includes for userspace tools and libraries (was Re: [PATCH] Fix includes for userspace tools and libraries) Guido Trentalancia
2011-09-13  2:41                 ` [PATCH v3] Fix includes for userspace tools and libraries (was Re: [PATCH v2] " Guido Trentalancia
2011-09-13 12:41           ` [PATCH] Fix includes for userspace tools and libraries (was Re: [PATCH] Fix include semanage/handle.h for semanage_set_root() as used by semodule) Stephen Smalley
2011-09-13 16:31             ` Guido Trentalancia
2011-09-13 17:20               ` Stephen Smalley
2011-09-13 18:33                 ` [PATCH] Fix includes for userspace tools and libraries (and possible security issue) Guido Trentalancia
2011-09-13 18:46                   ` Guido Trentalancia
2011-09-13 19:17                     ` Stephen Smalley
2011-09-13 18:48                   ` Stephen Smalley
2011-09-13 19:18                     ` Guido Trentalancia
2011-09-13 19:25                       ` Stephen Smalley
2011-09-13 19:34                         ` Stephen Smalley
2011-09-13 20:04                           ` Guido Trentalancia
2011-09-13 20:20                             ` Stephen Smalley
2011-09-13 20:49                               ` Guido Trentalancia
2011-09-13 20:26                             ` Eric Paris
2011-09-13 20:42                               ` Stephen Smalley [this message]
2011-09-13 21:09                                 ` Guido Trentalancia
2011-09-13 22:05                               ` [PATCH v4] " Guido Trentalancia
2011-09-13 23:33                                 ` [PATCH] Fix function arguments in libsemanage tests (was Re: [PATCH v4] Fix includes for userspace tools and libraries) Guido Trentalancia
2011-09-14  0:44                                   ` [PATCH] Change default make target for sepolgen " Guido Trentalancia
2011-09-14  1:10                                     ` [PATCH] Change default make target for some directories in the libraries (was Re: [PATCH] Change default make target for sepolgen) Guido Trentalancia
2011-09-14  1:20                                       ` [PATCH] Change default make target for the man directory of policycoreutils/mcstrans " Guido Trentalancia
2011-09-14 19:16                                     ` [PATCH] Change default make target for sepolgen (was Re: [PATCH v4] Fix includes for userspace tools and libraries) Eric Paris
2011-09-14 19:31                                   ` [PATCH] Fix function arguments in libsemanage tests " Eric Paris
2011-09-15  4:40                                     ` [PATCH v5] Fix makefiles for the userspace tools and libraries Guido Trentalancia
2011-09-15  9:40                                       ` [PATCH] Fix symbolic link creation for the userspace libraries Guido Trentalancia
2011-09-15 11:51                                       ` [PATCH v5] Fix makefiles for the userspace tools and libraries Guido Trentalancia
2011-09-14 12:56                                 ` [PATCH v4] Fix includes for userspace tools and libraries (and possible security issue) Stephen Smalley
2011-09-15  2:44                                   ` [PATCH v5] " Guido Trentalancia
2011-09-15 12:56                                     ` Stephen Smalley
2011-09-15 16:04                                       ` Guido Trentalancia
2011-09-15 16:35                                         ` Stephen Smalley
2011-09-15 17:03                                           ` Guido Trentalancia
2011-09-15 17:16                                             ` Stephen Smalley
2011-09-15 17:26                                               ` Guido Trentalancia
2011-09-15 18:14                                                 ` Stephen Smalley
2011-09-15 19:12                                                   ` [PATCH v5] Fix includes for userspace tools and libraries Guido Trentalancia
2011-09-15 20:00                                                     ` Stephen Smalley
2011-09-15 20:32                                                       ` Guido Trentalancia
2011-09-16 12:39                                                         ` Stephen Smalley
2011-09-16 12:50                                                           ` Guido Trentalancia
2011-09-17 20:48                                                       ` [PATCH v6] " Guido Trentalancia
2011-09-15 19:37                                                   ` [PATCH v5] " Guido Trentalancia
2011-09-15 17:15                                         ` [PATCH v5] Fix includes for userspace tools and libraries (and possible security issue) Eric Paris
2011-09-13 19:42                         ` [PATCH] " Guido Trentalancia
2011-09-13 17:08           ` [PATCH] Fix includes for userspace tools and libraries (was Re: [PATCH] Fix include semanage/handle.h for semanage_set_root() as used by semodule) Stephen Smalley
2011-09-09 17:31   ` [PATCH] Fix include semanage/handle.h for semanage_set_root() as used by semodule Guido Trentalancia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1315946531.12522.96.camel@moss-pluto \
    --to=sds@tycho.nsa.gov \
    --cc=eparis@parisplace.org \
    --cc=eparis@redhat.com \
    --cc=guido@trentalancia.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.