mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Dimitris Papastamos <sin@2f30.org>
To: musl@lists.openwall.com
Subject: standalone fortify source implementation
Date: Wed, 4 Feb 2015 16:02:14 +0000	[thread overview]
Message-ID: <20150204160214.GA3717@cream.2f30.org> (raw)

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/


             reply	other threads:[~2015-02-04 16:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 16:02 Dimitris Papastamos [this message]
2015-02-04 16:21 ` Daniel Cegiełka
2015-02-04 16:26   ` Dimitris Papastamos
2015-02-04 16:33   ` Rich Felker
2015-02-10 14:54 ` Dimitris Papastamos

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=20150204160214.GA3717@cream.2f30.org \
    --to=sin@2f30.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).