Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1057869
| From | Thorsten Glaser <tg@debian.org> |
|---|---|
| Newsgroups | linux.debian.bugs.dist, linux.debian.kernel |
| Subject | Bug#988027: klibc: sigsetjmp ignores second argument, siglongjmp always restores signals |
| Date | 2021-05-03 23:00 +0200 |
| Message-ID | <CaNPA-1R6-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Cross-posted to 2 groups.
Package: libklibc-dev
Version: 2.0.8-6
Severity: serious
Justification: spec violation, affecting release architectures
X-Debbugs-Cc: tg@debian.org
Found during debugging of #943425:
- usr/include/setjmp.h
struct __sigjmp_buf {
jmp_buf __jmpbuf;
sigset_t __sigs;
};
=> does not contain information whether __sigs was saved
#define sigsetjmp(__env, __save) \
({ \
struct __sigjmp_buf *__e = (__env); \
sigprocmask(0, NULL, &__e->__sigs); \
setjmp(__e->__jmpbuf); \
})
=> ignores the __save argument
- usr/klibc/siglongjmp.c
__noreturn siglongjmp(sigjmp_buf buf, int retval)
{
sigprocmask(SIG_SETMASK, &buf->__sigs, NULL);
longjmp(buf->__jmpbuf, retval);
=> always restores __sigs
This is in direct violation to the Debian sigsetjmp(3) docs...
If, and only if, the savesigs argument provided to sigsetjmp() is non-
zero, the process's current signal mask is saved in env and will be re-
stored if a siglongjmp() is later performed with this env.
... and POSIX:
* The siglongjmp() function shall restore the saved signal mask if and
only if the env argument was initialized by a call to [9]sigsetjmp()
with a non-zero savemask argument.
Q: https://pubs.opengroup.org/onlinepubs/9699919799/functions/siglongjmp.html
If necessary I can provide a patch to fix this.
-- System Information:
Debian Release: 11.0
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: s390x
Kernel: Linux 4.19.0-16-s390x (SMP w/2 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
Versions of packages libklibc-dev depends on:
ii libklibc 2.0.8-6
ii linux-libc-dev 5.10.28-1
libklibc-dev recommends no packages.
libklibc-dev suggests no packages.
-- no debconf information
Back to linux.debian.bugs.dist | Previous | Next | Find similar | Unroll thread
Bug#988027: klibc: sigsetjmp ignores second argument, siglongjmp always restores signals Thorsten Glaser <tg@debian.org> - 2021-05-03 23:00 +0200
csiph-web