Bug 473907 - Using seteuid or setegid in a thread causes SIGRT_1 to be delivered
Using seteuid or setegid in a thread causes SIGRT_1 to be delivered
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: glibc (Show other bugs)
All Linux
medium Severity high
: rc
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2008-12-01 07:26 EST by Albert Flügel
Modified: 2008-12-01 09:13 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-12-01 09:13:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
c-code to show the problem. (209 bytes, text/x-c)
2008-12-01 07:26 EST, Albert Flügel
no flags Details

  None (edit)
Description Albert Flügel 2008-12-01 07:26:51 EST
Created attachment 325225 [details]
c-code to show the problem.

Description of problem:
When using seteuid or setegid in a thread, tgkill is issued with SIGRT_1,
what makes certain software constantly talk, that an unknown signal has
been caught.

Version-Release number of selected component (if applicable):

How reproducible:
compile the attached example and run in strace

Steps to Reproduce:
1. gcc seteuid.c -o seteuid -lpthread -g
2. strace ./seteuid
3. See the strace output:
[pid 23370] futex(0x420719d0, FUTEX_WAIT, 23371, NULL <unfinished ...>
[pid 23371] set_robust_list(0x420719e0, 0x18) = 0
[pid 23371] tgkill(23370, 23370, SIGRT_1) = 0
[pid 23370] <... futex resumed> )       = -1 EINTR (Interrupted system call)
[pid 23371] futex(0x42071100, FUTEX_WAIT, 1, NULL <unfinished ...>
[pid 23370] --- SIGRT_1 (Unknown signal 33) @ 0 (0) ---
[pid 23370] setresuid(-1, 35344, -1)    = -1 EPERM (Operation not permitted)
[pid 23370] futex(0x42071100, FUTEX_WAKE, 1 <unfinished ...>

Actual results:
see above. No problem with this simple program, but with software
from other vendor, e.g. eDirectory from Novell.

Expected results:
No error

Additional info:
Comment 1 Jakub Jelinek 2008-12-01 09:13:28 EST
That is Novell eDirectory bug then.

Programs are only allowed to set, intercept, etc. named signals and
signals in range SIGRTMIN .. SIGRTMAX.  glibc uses a few realtime signals for itself (e.g. SIGRT_0 for cancellation and SIGRT_1 for process wide credential changes), and SIGRTMIN expands to a function call which returns the lowest
32 .. 64 value that is available to user programs:

#include <signal.h>
#include <stdio.h>

main (void)
  printf ("%d %d\n", SIGRTMIN, SIGRTMAX);

prints 34 64 here.

Note You need to log in before you can comment on or make changes to this bug.