From: Kfir Lavi <lavi.kfir@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: gentoo-embedded@lists.gentoo.org, gentoo-hardened@lists.gentoo.org
Subject: [gentoo-hardened] Re: [gentoo-embedded] Tool for eliminating non used code or symbols?
Date: Mon, 29 Apr 2013 06:58:52 +0300 [thread overview]
Message-ID: <CAHNvW1KnrEECoL8aLHFfVekMorWtuXE4MVrdW9DuYQ1V0qiHaQ@mail.gmail.com> (raw)
In-Reply-To: <201304261603.20868.vapier@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 1791 bytes --]
On Fri, Apr 26, 2013 at 11:03 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Monday 25 March 2013 03:01:51 Kfir Lavi wrote:
> > I'm looking for a way to reduce glibc code size.
> > It can be a way to make system smaller and minimize the impact
> > of attack vectors in glibc, as in return-to-libc attack.
> >
> > Lets say I'm deleting the program 'mkdir', and mkdir uses a function
> > in glibc that non of the other parts of the system uses.
> > Then I want to eliminate this function from glibc. This leads to smaller
> > code and if this function is used in some attack scenario, maybe prevent
> > it.
> >
> > Is there a way to do it?
> > Can you help me think how to build a tool like this? or, integrate
> > with existing tools.
>
> the only thing i've seen in the past was a hacky script that utilize the
> uClibc build system to cull objects until things stopped linking. it had
> very
> constrained use where i'd safely work, and was never generalized. i don't
> remember the name of it now (was a few years ago), but having read the
> [limited] source, i wouldn't bother using it as a base.
>
> otherwise, i haven't heard of any tools that do what you want, but i've
> seen
> many people request it. unfortunately, it's a tough nut to crack, and the
> vast majority of people requesting it didn't have the technical skills to
> even
> think about a solution let alone implement it.
>
> i [pessimistically] suspect we're talking many man months here, and the
> skill
> set involves knowledge of the ELF format at a fairly low level.
> -mike
>
You can look at this problem 2 ways:
1. Change the binary created after compilation.
2. Reduce glibc code and compile again. Do this iteratively.
I'm leaning toward the second, as you have the protection of the
compilation.
Kfir
[-- Attachment #2: Type: text/html, Size: 2377 bytes --]
prev parent reply other threads:[~2013-04-29 3:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 7:01 [gentoo-hardened] Tool for eliminating non used code or symbols? Kfir Lavi
2013-03-25 12:52 ` PaX Team
2013-03-25 15:18 ` Javier Juan Martínez Cabezón
2013-03-25 18:00 ` "Tóth Attila"
2013-03-26 8:54 ` Hinnerk van Bruinehsen
2013-03-26 9:18 ` Javier Juan Martínez Cabezón
2013-03-26 15:11 ` "Tóth Attila"
2013-03-26 15:45 ` Javier Juan Martínez Cabezón
2013-03-26 15:56 ` Javier Juan Martínez Cabezón
2013-03-26 18:45 ` "Tóth Attila"
2013-03-28 8:01 ` Pavel Labushev
2013-03-25 20:35 ` Kfir Lavi
2013-03-25 22:32 ` PaX Team
2013-04-26 20:03 ` [gentoo-hardened] Re: [gentoo-embedded] " Mike Frysinger
2013-04-29 3:58 ` Kfir Lavi [this message]
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=CAHNvW1KnrEECoL8aLHFfVekMorWtuXE4MVrdW9DuYQ1V0qiHaQ@mail.gmail.com \
--to=lavi.kfir@gmail.com \
--cc=gentoo-embedded@lists.gentoo.org \
--cc=gentoo-hardened@lists.gentoo.org \
--cc=vapier@gentoo.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox