From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6946 Path: news.gmane.org!not-for-mail From: Dimitris Papastamos Newsgroups: gmane.linux.lib.musl.general Subject: standalone fortify source implementation Date: Wed, 4 Feb 2015 16:02:14 +0000 Message-ID: <20150204160214.GA3717@cream.2f30.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1423065770 23283 80.91.229.3 (4 Feb 2015 16:02:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Feb 2015 16:02:50 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6959-gllmg-musl=m.gmane.org@lists.openwall.com Wed Feb 04 17:02:46 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YJ2Pc-00044y-3r for gllmg-musl@m.gmane.org; Wed, 04 Feb 2015 17:02:44 +0100 Original-Received: (qmail 19463 invoked by uid 550); 4 Feb 2015 16:02:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18421 invoked from network); 4 Feb 2015 16:02:40 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:6946 Archived-At: Hi everyone, I have been working on a standalone fortify source implementation[0] that uses GCC's #include_next to overlay over the system headers. The current implementation has been tested against musl libc and OpenBSD's libc. This implementation only supports _FORTIFY_SOURCE=1. Level 2 is the same as level 1. If this is to be used by default on a system it makes sense to only catch cases where UB would be invoked (level 1) rather than trap on suspicious but legal code (level 2). At the moment only out of bound writes are caught. Should the implementation trap on out of bound reads as well? Overlap checks have been added to memcpy() and will probably be added to other functions as well. A short list of functions that still need to be covered: * wide versions of existing functions * confstr() * fread() * getcwd() * getgroups() * gethostname() * poll()/ppoll() * readlink()/readlinkat() * reentrant variants such as ttyname_r, getlogin_r() etc. I've received very useful feedback from dalias and fabled on IRC. I am putting this out here so that more people can have a look and share their comments. Thanks, Dimitris [0] http://git.2f30.org/fortify/