This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
- From: "arjan at linux dot intel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jul 2006 09:23:03 -0000
- Subject: [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Userspace and kernel space use a different segment register for TLS access in
x86_64. (This is so that a syscall doesn't need to switch these registers most
of the time, so good for performance)
This means that the kernel cannot use -fstack-protector currently, which is sad
since today another buffer overflow has been found in the linux kernel.
The solution is quite simple, and I will attach a patch to fix this next; just
use a different segement register for the mc_kernel model.
(the patch is trivial; it copies a line and changes a few characters in it, and
then places an if around it)
--
Summary: gcc uses the wrong segment register for TLS access for -
fstack-protector in kernel mode
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: arjan at linux dot intel dot com
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28281