This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/28281] New: gcc uses the wrong segment register for TLS access for -fstack-protector in kernel mode


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]