You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pthread_setname_np is implemented in glibc with two different code paths.
When called on a target thread other than the current thread, it attempts to write to /proc/self/task/<taskid>/comm. However, when a process calls setuid/seteuid, the proc entries underneath remain owned by the pre-setuid userid unless the Linux kernel tunable /proc/sys/fs/suid_dumpable is set to 1.
As a result, we see repeated failures and perror errors from this call to pthread_setname_np in our error log where we start node as root and then lower privileges by calling setuid() prior to calling require("monitr").
On the other hand, when pthread_setname_np is called by a thread on itself, it uses a different code path which makes a syscall to prctl. So suggested fix is to change the location where pthread_setname_np is called to be inside the monitr thread itself, rather than inside the v8 thread.
The text was updated successfully, but these errors were encountered:
pthread_setname_np
is implemented inglibc
with two different code paths.When called on a target thread other than the current thread, it attempts to write to
/proc/self/task/<taskid>/comm
. However, when a process callssetuid/seteuid
, the proc entries underneath remain owned by the pre-setuid userid unless the Linux kernel tunable/proc/sys/fs/suid_dumpable
is set to1
.As a result, we see repeated failures and
perror
errors from this call topthread_setname_np
in our error log where we start node asroot
and then lower privileges by callingsetuid()
prior to callingrequire("monitr")
.On the other hand, when
pthread_setname_np
is called by a thread on itself, it uses a different code path which makes a syscall toprctl
. So suggested fix is to change the location wherepthread_setname_np
is called to be inside themonitr
thread itself, rather than inside the v8 thread.The text was updated successfully, but these errors were encountered: