public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/27177] New: GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work
@ 2021-01-13  2:43 hjl.tools at gmail dot com
  2021-01-13  3:06 ` [Bug dynamic-link/27177] " hjl.tools at gmail dot com
  2021-01-13 18:05 ` hjl.tools at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2021-01-13  2:43 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27177

            Bug ID: 27177
           Summary: GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shst
                    k=on doesn't work
           Product: glibc
           Version: 2.33
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
                CC: skpgkp2 at gmail dot com
  Target Milestone: ---
            Target: i386, x86-64

Created attachment 13116
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13116&action=edit
A testcase

dl_cet_check has

  /* No legacy object check if both IBT and SHSTK are always on.  */
  if (enable_ibt_type == cet_always_on
      && enable_shstk_type == cet_always_on)
    return;

With

$ GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on

          unsigned int feature_1 = 0;
          if (enable_ibt)
            feature_1 |= GNU_PROPERTY_X86_FEATURE_1_IBT;
          if (enable_shstk)
            feature_1 |= GNU_PROPERTY_X86_FEATURE_1_SHSTK;
          struct pthread *self = THREAD_SELF;
          THREAD_SETMEM (self, header.feature_1, feature_1);

is skipped:

[hjl@gnu-tgl-2 tmp]$ gcc -fcf-protection tst-cet-setjmp-1.c
[hjl@gnu-tgl-2 tmp]$ ./a.out 
Saved environment.
Jumped to 1.
Jumped to 2.
Jumped to 3.
Jumped to 4.
Jumped to 5.
Jumped to 6.
Jumped to 7.
Jumped to 8.
Jumped to 9.
Jumped to 10.
Saved environment.
Jumped to 1.
Jumped to 2.
Jumped to 3.
Jumped to 4.
Jumped to 5.
Jumped to 6.
Jumped to 7.
Jumped to 8.
Jumped to 9.
Jumped to 10.
Saved environment.
Jumped to 1.
Jumped to 2.
Jumped to 3.
Jumped to 4.
Jumped to 5.
Jumped to 6.
Jumped to 7.
Jumped to 8.
Jumped to 9.
Jumped to 10.
Test succeeded!
[hjl@gnu-tgl-2 tmp]$ GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
./a.out 
Saved environment.
Jumped to 1.
Jumped to 2.
Jumped to 3.
Jumped to 4.
Jumped to 5.
Jumped to 6.
Jumped to 7.
Jumped to 8.
Jumped to 9.
Jumped to 10.
Saved environment.
Jumped to 1.
Jumped to 2.
Jumped to 3.
Jumped to 4.
Jumped to 5.
Jumped to 6.
Jumped to 7.
Jumped to 8.
Jumped to 9.
Jumped to 10.
Saved environment.
Jumped to 1.
Jumped to 2.
Jumped to 3.
Jumped to 4.
Jumped to 5.
Jumped to 6.
Jumped to 7.
Jumped to 8.
Jumped to 9.
Jumped to 10.
Test succeeded!
Segmentation fault (core dumped)
[hjl@gnu-tgl-2 tmp]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug dynamic-link/27177] GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work
  2021-01-13  2:43 [Bug dynamic-link/27177] New: GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work hjl.tools at gmail dot com
@ 2021-01-13  3:06 ` hjl.tools at gmail dot com
  2021-01-13 18:05 ` hjl.tools at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2021-01-13  3:06 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27177

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |hjl.tools at gmail dot com

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 13117
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13117&action=edit
A patch

I am testing this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug dynamic-link/27177] GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work
  2021-01-13  2:43 [Bug dynamic-link/27177] New: GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work hjl.tools at gmail dot com
  2021-01-13  3:06 ` [Bug dynamic-link/27177] " hjl.tools at gmail dot com
@ 2021-01-13 18:05 ` hjl.tools at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: hjl.tools at gmail dot com @ 2021-01-13 18:05 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=27177

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.33
             Status|NEW                         |RESOLVED

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed for 2.33 and on 2.28/2.29/2.30/2.31/2.32 branches by

https://sourceware.org/git/?p=glibc.git;a=commit;h=2ef23b520597f4ea1790a669b83e608f24f4cf12

and backports.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-01-13 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13  2:43 [Bug dynamic-link/27177] New: GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on doesn't work hjl.tools at gmail dot com
2021-01-13  3:06 ` [Bug dynamic-link/27177] " hjl.tools at gmail dot com
2021-01-13 18:05 ` hjl.tools at gmail dot com

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).