platform_external_selinux/libselinux
Christian Göttsche 85982d83d1
libselinux: use valid address to silence glibc 2.34 warnings
Glibc 2.34 added an access function attribute to pthread_setspecific(3).
This leads to the following GCC warnings:

    In file included from matchpathcon.c:5:
    matchpathcon.c: In function ‘matchpathcon_init_prefix’:
    selinux_internal.h:38:25: error: ‘pthread_setspecific’ expecting 1 byte in a region of size 0 [-Werror=stringop-overread]
       38 |                         pthread_setspecific(KEY, VALUE);        \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    matchpathcon.c:359:9: note: in expansion of macro ‘__selinux_setspecific’
      359 |         __selinux_setspecific(destructor_key, (void *)1);
          |         ^~~~~~~~~~~~~~~~~~~~~
    In file included from selinux_internal.h:2,
                     from matchpathcon.c:5:
    /usr/include/pthread.h:1167:12: note: in a call to function ‘pthread_setspecific’ declared with attribute ‘access (none, 2)’
     1167 | extern int pthread_setspecific (pthread_key_t __key,
          |            ^~~~~~~~~~~~~~~~~~~

The actual value and the validity of the passed pointer is irrelevant,
since it does not gets accessed internally by glibc and
pthread_getspecific(3) is not used.
Use a pointer to a global object to please GCC.

Closes: https://github.com/SELinuxProject/selinux/issues/311
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-11-11 22:40:40 +01:00
..
include libselinux: accept const fromcon in get_context API 2021-01-20 16:53:34 +01:00
man selinux.8: document how mount flag nosuid affects SELinux 2021-06-18 16:44:50 +02:00
src libselinux: use valid address to silence glibc 2.34 warnings 2021-11-11 22:40:40 +01:00
utils libselinux/utils: drop requirement to combine compiling and linking 2021-09-22 12:31:53 +02:00
LICENSE initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile libselinux: do not duplicate make target when going into subdirectory 2021-04-30 21:09:22 +02:00
VERSION Update VERSIONs to 3.3 for release. 2021-10-21 16:31:23 +02:00