public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: linux-kernel@vger.kernel.org
Subject: Re: propolice support for linux
Date: Thu, 13 Jan 2005 14:04:46 +0000	[thread overview]
Message-ID: <20050113140446.GA22381@infradead.org> (raw)
In-Reply-To: <20050113134620.GA14127@boetes.org>

> --- linux-2.6.3/Makefile	2004-02-17 22:58:39.000000000 -0500
> +++ linux-2.6.3.ssp/Makefile	2004-03-03 10:20:29.000000000 -0500

2.6.3 is from stoneage..

> +ifdef CONFIG_HARDENED_SSP
> +CFLAGS += -fstack-protector
> +endif

What about just CONFIG_PROPOLICY?  The hardnedefoo naming is so childish
(or gentooish, in the end it's the same anyway..)

> diff -urN linux-2.6.3/include/linux/kernel.h linux-2.6.3.ssp/include/linux/kernel.h
> --- linux-2.6.3/include/linux/kernel.h	2004-02-17 22:57:11.000000000 -0500
> +++ linux-2.6.3.ssp/include/linux/kernel.h	2004-03-03 10:08:10.000000000 -0500
> @@ -115,6 +115,10 @@
>  #define TAINT_FORCED_RMMOD		(1<<3)
>  
>  extern void dump_stack(void);
> +#ifdef CONFIG_HARDENED_SSP
> +extern int __guard;
> +extern void __stack_smash_handler(int, char []);
> +#endif

What do you need these prototypes for, they're not used at all.  Also
no need to put ifdefs around them.

> diff -urN linux-2.6.3/lib/propolice.c linux-2.6.3.ssp/lib/propolice.c
> --- linux-2.6.3/lib/propolice.c	1969-12-31 19:00:00.000000000 -0500
> +++ linux-2.6.3.ssp/lib/propolice.c	2004-03-03 17:52:48.000000000 -0500
> @@ -0,0 +1,15 @@
> +#include <linux/module.h>
> +#include <linux/errno.h>

What do you need errno for?

> 
> +
> +EXPORT_SYMBOL_NOVERS(__guard);
> +EXPORT_SYMBOL_NOVERS(__stack_smash_handler);
> + 
> +int __guard = '\0\0\n\777';
> + 
> +void 
> +__stack_smash_handler (int damaged, char func[])
> +{
> +	static char *message = "propolice detects %x at function %s.\n" ;
> +	panic (message, damaged, func);
> +}

ah, it seems you need them because you put the exports before the
delaration.  This file should probably look more like:

/*
 * Insert Copyright here.
 *
 * Insert small description here.
 */
#include <linux/kernel.h>
#include <linux/module.h>

int __guard = '\0\0\n\777';
EXPORT_SYMBOL_NOVERS(__guard);
 
static const char message[] = "propolice detects %x at function %s.\n";

void __stack_smash_handler(int damaged, char func[])
{
	panic(message, damaged, func);
}
EXPORT_SYMBOL_NOVERS(__stack_smash_handler);



  reply	other threads:[~2005-01-13 14:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-13 13:46 propolice support for linux Han Boetes
2005-01-13 14:04 ` Christoph Hellwig [this message]
2005-01-13 14:53   ` Arjan van de Ven
2005-01-13 16:37   ` Han Boetes
2005-01-13 17:02     ` Arjan van de Ven
2005-01-13 19:32       ` Han Boetes
2005-01-14  7:35         ` Arjan van de Ven
2005-01-13 17:07     ` Bill Davidsen
2005-01-13 17:31       ` Han Boetes
2005-01-13 17:58     ` Zwane Mwaikambo
2005-01-13 18:17       ` Han Boetes
2005-01-14  4:25     ` Mitchell Blank Jr
2005-01-14 10:30       ` Han Boetes
2005-01-15  2:25         ` Mitchell Blank Jr
2005-01-15  8:10           ` Han Boetes
2005-01-13 14:07 ` Arjan van de Ven
2005-01-13 14:15 ` Jakub Jelinek
2005-01-13 19:58 ` Andi Kleen
2005-01-13 21:11 ` Ulrich Drepper
2005-01-13 22:52   ` Han Boetes
2005-01-14  6:25     ` Willy Tarreau
2005-01-14  7:06     ` Ulrich Drepper
2005-01-14 14:08       ` Nix

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=20050113140446.GA22381@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox