Bug 22742 - [aarch64] mcontext_t __reserved field got renamed
Summary: [aarch64] mcontext_t __reserved field got renamed
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.26
: P2 normal
Target Milestone: 2.27
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-24 11:44 UTC by Szabolcs Nagy
Modified: 2018-03-31 12:40 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szabolcs Nagy 2018-01-24 11:44:24 UTC
in glibc 2.26 the __reserved field of mcontext_t got renamed to __glibc_reserved1
assuming it is not supposed to be accessed by user code, however it is needed
for accessing processor state extensions and there are existing users of it:

libsanitizer/sanitizer_common/sanitizer_linux.cc:1265:35: error: ‘struct
mcontext_t’ has no member named ‘__reserved’; did you mean ‘__glibc_reserved1’?
   u8 *aux = ucontext->uc_mcontext.__reserved;
                                   ^~~~~~~~~~
                                   __glibc_reserved1

Build issue introduced by:
https://sourceware.org/git/?p=glibc.git;a=commit;h=4fa9b3bfe6759c82beb4b043a54a3598ca467289

	* sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym (oEXTENSION): Use
	__glibc_reserved1 instead of __reserved.
Comment 1 cvs-commit@gcc.gnu.org 2018-01-24 11:55:47 UTC
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  c739e191d0697e29110d4eb446e537ff336324c6 (commit)
      from  394b5bac88ef678dcacadbc1f6b393a55308f616 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c739e191d0697e29110d4eb446e537ff336324c6

commit c739e191d0697e29110d4eb446e537ff336324c6
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Jan 22 11:13:31 2018 +0000

    aarch64: Revert the change of the __reserved member of mcontext_t
    
    The uc_mcontext.__reserved member of ucontext_t is a user visible API,
    that should not be changed, because this is the only way to access cpu
    states of various extensions of linux asm/sigcontext.h, it does not
    violate namespace rules either, so revert this part of the commit
    
    commit 4fa9b3bfe6759c82beb4b043a54a3598ca467289
    Commit:     Joseph Myers <joseph@codesourcery.com>
    
        Fix mcontext_t sigcontext namespace (bug 21457).
    
    (In principle the user can type cast &uc_mcontext to struct sigcontext*
    to use the linux sigcontext fields, but that's not the existing practice
    since mcontext_t used to be a typedef of struct sigcontext.)
    
    	[BZ #22742]
    	* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h (__glibc_reserved1):
    	Rename to __reserved and add comment.
    	* sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym (__glibc_reserved1):
    	Rename to __reserved.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                      |    8 ++++++++
 sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h |    6 +++++-
 sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym |    2 +-
 3 files changed, 14 insertions(+), 2 deletions(-)
Comment 2 joseph@codesourcery.com 2018-01-24 13:02:16 UTC
If the commit fixes the problem, the bug needs to be resolved as FIXED 
with target milestone set to 2.27.
Comment 3 Szabolcs Nagy 2018-01-25 18:56:12 UTC
fixed for 2.27

i cant set the target milestone, i'll try to fix it on the 2.26 branch too tomorrow.