glibc/rt
Adhemerval Zanella c5579f3a71 debug: Fix clang mq_open fortify wrapper (BZ 31917)
The mqueue.h fortify wrapper for clang added by c23107effb
is not fully correct, where correct 4 argument usage are not
being correctly handled.  For instance, while building socat 1.8
with a yocto clang based system shows:

  ./socat-1.8.0.0/xio-posixmq.c:119:8: error: 'mq_open' is unavailable: mq_open can be called either with 2 or 4 arguments
    119 |         mqd = mq_open(name, oflag, opt_mode, NULL);
        |               ^
  [...] /usr/include/bits/mqueue2.h:66:8: note: 'mq_open' has been explicitly marked unavailable here
     66 | __NTH (mq_open (const char *__name, int __oflag, mode_t mode,
        |        ^
  1 error generated.

The correct way to define the wrapper is to set invalid usage
with __fortify_clang_unavailable (for the case with 5 or more
arguments), followed by the expected ones.  This fix make mq_open
similar to current open wrappers.

[1] http://www.dest-unreach.org/socat/

Reported-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Khem Raj <raj.khem@gmail.com>
2024-06-27 13:32:48 -03:00
..
bits debug: Fix clang mq_open fortify wrapper (BZ 31917) 2024-06-27 13:32:48 -03:00
aio_cancel.c
aio_error.c
aio_fsync.c
aio_misc.c
aio_notify.c
aio_read64.c
aio_read.c
aio_return.c
aio_sigqueue.c
aio_suspend.c
aio_write64.c
aio_write.c
aio.h
Depend
librt-compat.c
lio_listio64.c
lio_listio-common.c
lio_listio.c
Makefile
mq_close.c
mq_getattr.c
mq_notify.c
mq_open.c
mq_receive.c
mq_send.c
mq_setattr.c
mq_timedreceive.c
mq_timedsend.c
mq_unlink.c
mqueue.h
shm_open.c
shm_unlink.c
timer_create.c
timer_delete.c
timer_getoverr.c
timer_gettime.c
timer_settime.c
tst-aio2.c
tst-aio3.c
tst-aio4.c
tst-aio5.c
tst-aio6-time64.c
tst-aio6.c
tst-aio7.c
tst-aio8.c
tst-aio9.c
tst-aio10.c
tst-aio64.c
tst-aio.c
tst-bz28213.c
tst-cpuclock2-time64.c
tst-cpuclock2.c
tst-cputimer1.c
tst-cputimer2.c
tst-cputimer3.c
tst-mqueue1-time64.c
tst-mqueue1.c
tst-mqueue2-time64.c
tst-mqueue2.c
tst-mqueue3.c
tst-mqueue4-time64.c
tst-mqueue4.c
tst-mqueue5.c
tst-mqueue6.c
tst-mqueue7.c
tst-mqueue8-time64.c
tst-mqueue8.c
tst-mqueue9.c
tst-mqueue10-time64.c
tst-mqueue10.c
tst-mqueue.h
tst-shm-cancel.c
tst-shm.c
tst-timer2.c
tst-timer3.c
tst-timer4-time64.c
tst-timer4.c
tst-timer5.c
tst-timer-sigmask.c
tst-timer.c
Versions