Gentoo Archives: gentoo-hardened

From: Mike Frysinger <vapier@g.o>
To: gentoo-embedded@l.g.o
Cc: Kfir Lavi <lavi.kfir@×××××.com>, gentoo-hardened@l.g.o
Subject: [gentoo-hardened] Re: [gentoo-embedded] Tool for eliminating non used code or symbols?
Date: Fri, 26 Apr 2013 20:03:36
Message-Id: 201304261603.20868.vapier@gentoo.org
In Reply to: [gentoo-hardened] Tool for eliminating non used code or symbols? by Kfir Lavi
1 On Monday 25 March 2013 03:01:51 Kfir Lavi wrote:
2 > I'm looking for a way to reduce glibc code size.
3 > It can be a way to make system smaller and minimize the impact
4 > of attack vectors in glibc, as in return-to-libc attack.
5 >
6 > Lets say I'm deleting the program 'mkdir', and mkdir uses a function
7 > in glibc that non of the other parts of the system uses.
8 > Then I want to eliminate this function from glibc. This leads to smaller
9 > code and if this function is used in some attack scenario, maybe prevent
10 > it.
11 >
12 > Is there a way to do it?
13 > Can you help me think how to build a tool like this? or, integrate
14 > with existing tools.
15
16 the only thing i've seen in the past was a hacky script that utilize the
17 uClibc build system to cull objects until things stopped linking. it had very
18 constrained use where i'd safely work, and was never generalized. i don't
19 remember the name of it now (was a few years ago), but having read the
20 [limited] source, i wouldn't bother using it as a base.
21
22 otherwise, i haven't heard of any tools that do what you want, but i've seen
23 many people request it. unfortunately, it's a tough nut to crack, and the
24 vast majority of people requesting it didn't have the technical skills to even
25 think about a solution let alone implement it.
26
27 i [pessimistically] suspect we're talking many man months here, and the skill
28 set involves knowledge of the ELF format at a fairly low level.
29 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies