Re: Tool for eliminating non used code or symbols?
Mike Frysinger <[email protected]>
| Newsgroups | gmane.linux.gentoo.embedded,gmane.linux.gentoo.hardened |
|---|---|
| Organization | wh0rd.org |
| Message-ID | <[email protected]> |
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
signature.asc
(application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJRet2IAAoJEEFjO5/oN/WBjb8QAKCFxgXXpUWAEgn4offJkJ9r fdRDEi/l04egmuzSwYaflAZlph1iYLWrU13aawMbBGtf2GhKymzQW4asz3owzmP5 gtUoIsOy+F08ZAgTp4OgW1ui05431L1UsD37OzSRW9t/RZjK8nWh+VFqY+HoyMAk 8XGQdAPE7Ro6nfiLclHyEOX7VbY17NInf0zcTQ1orBlyC5IjsmVkH5mWlKYGnQ9u 144d39mV7rKwHusTksTQTxopH15PC6TsvuQGKYJygY4m+AEq2yyJyQ7EN2YUOraw 7rfvnTU7ICh6iWgW8TMB6Sy4Zvhg7xV4alvsgSHWdwaOM5UT7G6MF2cPuVlj0ZtJ kxC0svzl94MSql8lfFkPvNShyQw9ed6LSh+nSNW++o9jPCcCEivJJ14uDMZ+kfvc 1ihn6sBugY6z+q8LgL0CIfwDpf09jZfTflFNOrNUaL8ajA2cIbLuwbNiiyudwq9l eEHtYh3p45+14Lln9rU5afo9GKtKl5SDJx/LahqKw5dGIpHUb2UnX8cjnL8Y7/qF Alh8Nfa8Bd2ZWmmMrEZoA/bJAMGmO0KZ+9A3ySy1PcWCR95FYUuGf8V3gqw00Jag +vUUgyf/A4muWwrWN4nwuog7zwjct+QlX8E3Q3a0snZF0HqvU3N+Hefs1yz3l9+X +0Ke2k1FQtN9BcivRlu8 =bOLi -----END PGP SIGNATURE-----