WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 3/3] Add support for OpenBSD

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 3/3] Add support for OpenBSD
From: "Christoph Egger" <Christoph.Egger@xxxxxxx>
Date: Wed, 18 Oct 2006 09:08:31 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 19 Oct 2006 00:15:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C15C0C1C.2BDD%Keir.Fraser@xxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: AMD / OSRC
References: <C15C0C1C.2BDD%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.4
On Wednesday 18 October 2006 17:51, Keir Fraser wrote:
> On 17/10/06 15:44, "Christoph Egger" <Christoph.Egger@xxxxxxx> wrote:
> > This is the third and last patch.
> >
> > This patch makes the xen kernel buildable on OpenBSD by adding support
> > for ProPolice. ProPolice has been added to standard GCC in version 4.1.x
> > under the name Stack Smashing Protection (SSP).
>
> Gcc 4.1.x works fine for me already (under Linux at least). We specifically
> disable stack protection in xen/arch/x86/Rules.mk.

The stack protection is not just to improve security. With a stack protection,
it is more likely that you find off-by-one bugs like this:

void foo(void)
{
        char array[8];
        int i;

        for (i = 0; i <= 8; i++) {
             array[i] = 0;
        }
        .....
}


The propolice patch also contained a snippet, which necessary to make
the Xen kernel build independ if SSP is disabled or not.

I extracted this snippet into a separate patch to fix this build error:

gcc -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer  -o 
boot/mkelf32 boot/mkelf32.c
boot/mkelf32.c:93:1: "swap16" redefined
In file included from /usr/include/machine/endian.h:68,
                 from /usr/include/sys/types.h:45,
                 from /usr/include/stdio.h:45,
                 from boot/mkelf32.c:11:
/usr/include/sys/endian.h:156:1: this is the location of the previous 
definition
boot/mkelf32.c:94:1: "swap32" redefined
/usr/include/sys/endian.h:157:1: this is the location of the previous 
definition
boot/mkelf32.c:95:1: "swap64" redefined
/usr/include/sys/endian.h:158:1: this is the location of the previous 
definition
gmake[2]: *** [boot/mkelf32] Error 1

This mail has two patches attached:
openbsd_buildfix.diff  - the absolute necessary patch to make the kernel build 
on OpenBSD
openbsd_propolice.diff - it adds support for SSP


Attachment: openbsd_buildfix.diff
Description: Text Data

Attachment: openbsd_propolice.diff
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel