From: Joshua Brindle <jbrindle@tresys.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Jeremy Mowery <jmowery@tresys.com>,
selinux@tycho.nsa.gov, selinux-dev <selinux-dev@tresys.com>
Subject: Re: [PATCH] libsepol: compile archive with -fpic
Date: Wed, 27 Sep 2006 08:37:18 -0400 [thread overview]
Message-ID: <451A707E.7070504@tresys.com> (raw)
In-Reply-To: <1159357424.32075.22.camel@moss-spartans.epoch.ncsc.mil>
Stephen Smalley wrote:
>
> On Tue, 2006-09-26 at 13:54 -0400, Jeremy A. Mowery wrote:
> > The libsepol archive is compiled normally without the -fpic flag. This
> > causes problems with other things that use libsepol.a with dynamic
> > relocation on 64-bit machines. The setools project uses libsepol.a in a
> > shared object library; checkpolicy is prevented from being built as a
> > position independent executable. The following patch modifies
> > libsepol's Makefile to build the archive using position independent
> > code.
> >
>
The cost is negligible, especially since the only static users are going
to be checkpolicy and apol. FWIW hardened gentoo users build every
binary (and object) on their system with -fpic (so that the address
space can be randomized at runtime) and the slowdown has never been
apparent and the extra register is only necessary in rare cases (eg.,
media apps).
Fedora has already started building some of their binaries as shared
objects so it won't be long before they'd want checkpolicy linking
against the pic version of libsepol anyway (file `which su` for
evidence). I don't think its worth it to make another archive.
> > --- libsepol/src/Makefile-orig 2006-09-19 10:03:54.000000000 -0400
> > +++ libsepol/src/Makefile 2006-09-19 10:06:21.000000000 -0400
> > @@ -24,7 +24,7 @@ $(LIBSO): $(LOBJS)
> > ln -sf $@ $(TARGET)
> >
> > %.o: %.c
> > - $(CC) $(CFLAGS) -c -o $@ $<
> > + $(CC) $(CFLAGS) -fpic -c -o $@ $<
> >
> > %.lo: %.c
> > $(CC) $(CFLAGS) -fpic -DSHARED -c -o $@ $<
> >
>
> There is a cost associated with doing that. Possibly we could provide a
> libsepol_pic.a. See:
> http://www.mail-archive.com/debian-devel@lists.debian.org/msg239046.html
>
> --
> 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.
next prev parent reply other threads:[~2006-09-27 12:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-26 17:54 [PATCH] libsepol: compile archive with -fpic Jeremy A. Mowery
2006-09-27 11:43 ` Stephen Smalley
2006-09-27 12:37 ` Joshua Brindle [this message]
2006-09-28 18:30 ` Joshua Brindle
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=451A707E.7070504@tresys.com \
--to=jbrindle@tresys.com \
--cc=jmowery@tresys.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux-dev@tresys.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.