From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23357 invoked by alias); 6 Jul 2006 09:23:12 -0000 Received: (qmail 23223 invoked by uid 48); 6 Jul 2006 09:23:03 -0000 Date: Thu, 06 Jul 2006 09:23:00 -0000 Subject: [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "arjan at linux dot intel dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-07/txt/msg00412.txt.bz2 List-Id: 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