From: Arjan van de Ven <arjan@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: ak@suse.de, akpm@osdl.org
Subject: [patch 0/5] -fstack-protector feature for the kernel (try 2)
Date: Wed, 16 Aug 2006 18:48:22 +0200 [thread overview]
Message-ID: <1155746902.3023.63.camel@laptopd505.fenrus.org> (raw)
This patch series adds support for the gcc -fstack-protector feature to
the kernel. While gcc 4.1 supports this feature for userspace, the patches to support
it for the kernel only got added to the gcc tree on 27/7/2006 (eg for 4.2);
it is expected that several distributors will backport this patch to their 4.1
gcc versions. (For those who want to know more, see gcc PR 28281)
-fstack-protector is a security feature in gcc that causes "selected" functions
to store a special "canary" value at the start of the function, just below
the return address. At the end of the function, just before using this
return address with the "ret" instruction, this canary value is compared to
the reference value again. If the value of the stack canary has changed, it is a sign
that there has been some stack corruption (most likely due to a buffer overflow) that
has compromised the integrity of the return address.
Standard, the "selected" functions are those that actually have stack
buffers of at least 8 bytes, this selection is done to limit the overhead to
only those functions with the highest risk potential. There is an override to enable this
for all functions.
On first sight this would not be needed for the kernel, because the kernel
is "perfect" and "has no buffer overflows on the stack". I thought that too
for a long time, but the last year has shown a few cases where that would
have been overly naive.
This feature has some performance overhead (but it's not that incredibly expensive
either) so it should be a configuration option for those who want this extra security.
I've included fixes for the comments from the last review on lkml, and especially the Makefile
side is now changed to automatically detect if the used gcc has the fix for PR 28281.
next reply other threads:[~2006-08-16 17:10 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-16 16:48 Arjan van de Ven [this message]
2006-08-16 16:49 ` [patch 1/5] -fstack-protector feature: annotate the PDA offsets Arjan van de Ven
2006-08-16 16:50 ` [patch 2/5] -fstack-protector feature: Add the Kconfig option Arjan van de Ven
2006-08-16 18:12 ` Adrian Bunk
2006-08-18 11:08 ` Andi Kleen
2006-08-18 11:23 ` Arjan van de Ven
2006-08-18 14:05 ` Andi Kleen
2006-08-18 13:10 ` Arjan van de Ven
2006-08-18 13:30 ` Arjan van de Ven
2006-08-18 17:21 ` Sam Ravnborg
2006-08-16 16:51 ` [patch 3/5] -fstack-protector feature: Add the canary field to the PDA area Arjan van de Ven
2006-08-16 16:52 ` [patch 4/5] -fstack-protector feature: Add the __stack_chk_fail() function Arjan van de Ven
2006-08-16 16:53 ` [patch 5/5] -fstack-protector feature: Enable the compiler flags in CFLAGS Arjan van de Ven
2006-08-16 18:55 ` Sam Ravnborg
2006-08-16 19:24 ` Arjan van de Ven
2006-08-18 11:15 ` [patch 0/5] -fstack-protector feature for the kernel (try 2) Andi Kleen
2006-08-18 11:29 ` Arjan van de Ven
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=1155746902.3023.63.camel@laptopd505.fenrus.org \
--to=arjan@linux.intel.com \
--cc=ak@suse.de \
--cc=akpm@osdl.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
all inboxes | Powered by JetHome®