This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel][PATCH][RFC] _chk_fail and _chk canaries for minios and newli

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel][PATCH][RFC] _chk_fail and _chk canaries for minios and newlib
From: "George S. Coker, II" <gscoker@xxxxxxxxxxxxxx>
Date: Mon, 09 Mar 2009 13:08:04 -0500
Cc: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
Delivery-date: Mon, 09 Mar 2009 10:08:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acmg2Zvbgr82TgOCHUqR6Al9u9PTCA==
Thread-topic: [Xen-devel][PATCH][RFC] _chk_fail and _chk canaries for minios and newlib
User-agent: Microsoft-Entourage/

I've made a small patch (attached) to minios and newlib that addresses long
standing linking issues for ocaml stubdomains on non-debian distros.  While
minios and associated libraries are compiled with fno-stack-protector and no
fortify buffer overflow protections, this doesn't produce a stubdom free of
these dependencies when linking against third party libraries, e.g.
Libasmrun for ocaml.  It seems impractical to keep building minios specific
libraries given that these options are common on all distros (now) and a
potential impediment to creating stubdomains out of existing system

This patch implements a minios version of the stack_chk_fail from glibc.
fprintf_chk and sprintf_chk functions have been added to newlib.  This split
was made to ensure that minios would dump the stack and exit on a
stack_chk_fail but avoid a cross-dependency between minios and newlib.  If
anyone has other suggestions, let me know.

The _chk functions are just pass through stubs because the actual fortify
implementation is not trivial for newlib.  It's also not clear that minios
domains benefit much from the fortify protections.  This patch supports the
needs of the ocaml stubdomain, other stubdomains using existing system
libraries may need additional _chk stubs.


George S. Coker, II <gscoker@xxxxxxxxxxxxxx>

Attachment: minios-stack-buffer-overflow-canaries.diff
Description: Binary data

Xen-devel mailing list