public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28281]  New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
@ 2006-07-06  9:23 arjan at linux dot intel dot com
  2006-07-06  9:24 ` [Bug c/28281] " arjan at linux dot intel dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: arjan at linux dot intel dot com @ 2006-07-06  9:23 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/28281] gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
  2006-07-06  9:23 [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode arjan at linux dot intel dot com
@ 2006-07-06  9:24 ` arjan at linux dot intel dot com
  2006-07-06  9:49 ` arjan at linux dot intel dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: arjan at linux dot intel dot com @ 2006-07-06  9:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from arjan at linux dot intel dot com  2006-07-06 09:24 -------
Created an attachment (id=11839)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11839&action=view)
patch to fix this issue, including a testcase

patch + testcase for this issue

2006-07-06  Arjan van de Ven <arjan@linux.intel.com>
        * config/i386/i386.md: add conditonal for kernel side
        stack-protector


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28281


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/28281] gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
  2006-07-06  9:23 [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode arjan at linux dot intel dot com
  2006-07-06  9:24 ` [Bug c/28281] " arjan at linux dot intel dot com
@ 2006-07-06  9:49 ` arjan at linux dot intel dot com
  2006-07-06 11:09 ` arjan at linux dot intel dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: arjan at linux dot intel dot com @ 2006-07-06  9:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from arjan at linux dot intel dot com  2006-07-06 09:49 -------
Created an attachment (id=11842)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11842&action=view)
updated patch

updated patch; it helps if I send the non-test version of the testsuite test so
that it actually tests the right behavior


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28281


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c/28281] gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
  2006-07-06  9:23 [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode arjan at linux dot intel dot com
  2006-07-06  9:24 ` [Bug c/28281] " arjan at linux dot intel dot com
  2006-07-06  9:49 ` arjan at linux dot intel dot com
@ 2006-07-06 11:09 ` arjan at linux dot intel dot com
  2006-07-06 14:53 ` [Bug target/28281] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: arjan at linux dot intel dot com @ 2006-07-06 11:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from arjan at linux dot intel dot com  2006-07-06 11:08 -------
Created an attachment (id=11844)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11844&action=view)
updates with Jakub's comments

updates with jakubs comments


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28281


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/28281] gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
  2006-07-06  9:23 [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode arjan at linux dot intel dot com
                   ` (2 preceding siblings ...)
  2006-07-06 11:09 ` arjan at linux dot intel dot com
@ 2006-07-06 14:53 ` pinskia at gcc dot gnu dot org
  2006-07-29  7:46 ` arjan at linux dot intel dot com
  2006-07-29  7:47 ` belyshev at depni dot sinp dot msu dot ru
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-06 14:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
          Component|c                           |target


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28281


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/28281] gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
  2006-07-06  9:23 [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode arjan at linux dot intel dot com
                   ` (3 preceding siblings ...)
  2006-07-06 14:53 ` [Bug target/28281] " pinskia at gcc dot gnu dot org
@ 2006-07-29  7:46 ` arjan at linux dot intel dot com
  2006-07-29  7:47 ` belyshev at depni dot sinp dot msu dot ru
  5 siblings, 0 replies; 7+ messages in thread
From: arjan at linux dot intel dot com @ 2006-07-29  7:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from arjan at linux dot intel dot com  2006-07-29 07:46 -------
fixed in current SVN


-- 

arjan at linux dot intel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28281


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/28281] gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode
  2006-07-06  9:23 [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode arjan at linux dot intel dot com
                   ` (4 preceding siblings ...)
  2006-07-29  7:46 ` arjan at linux dot intel dot com
@ 2006-07-29  7:47 ` belyshev at depni dot sinp dot msu dot ru
  5 siblings, 0 replies; 7+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2006-07-29  7:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

belyshev at depni dot sinp dot msu dot ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28281


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-07-29  7:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-06  9:23 [Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode arjan at linux dot intel dot com
2006-07-06  9:24 ` [Bug c/28281] " arjan at linux dot intel dot com
2006-07-06  9:49 ` arjan at linux dot intel dot com
2006-07-06 11:09 ` arjan at linux dot intel dot com
2006-07-06 14:53 ` [Bug target/28281] " pinskia at gcc dot gnu dot org
2006-07-29  7:46 ` arjan at linux dot intel dot com
2006-07-29  7:47 ` belyshev at depni dot sinp dot msu dot ru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).