| Summary: | No support for pidfd_send_signal system call | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | k04jg02 |
| Component: | memcheck | Assignee: | Julian Seward <jseward> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | mark, milasudril |
| Priority: | NOR | ||
| Version First Reported In: | 3.22.0 | ||
| Target Milestone: | --- | ||
| Platform: | Ubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
k04jg02
2024-04-21 20:42:49 UTC
Note that my libc was not new enough to have a wrapper for this syscall, if yours isn't as well you will want this to reproduce:
```
#include <sys/syscall.h>
#ifndef SYS_pidfd_send_signal
#define SYS_pidfd_send_signal 424
#endif
int pidfd_send_signal(int pidfd, int sig, siginfo_t* info, unsigned int flags)
{
return syscall(SYS_pidfd_send_signal, pidfd, sig, info, flags);
}
```
There was a preliminary implementation posted to the mailinglist: https://sourceforge.net/p/valgrind/mailman/message/52515225/ So the only tricky part is that we want to mimic this part of the (generic) PRE(sys_kill):
/* If we're sending SIGKILL, check to see if the target is one of
our threads and handle it specially. */
if (ARG2 == VKI_SIGKILL && ML_(do_sigkill)(ARG1, -1))
SET_STATUS_Success(0);
In the pidfd_send_signal case ARG2 is the signo, just like the kill syscall.
But ARG1 is a pidfd and do_sigkill wants an pid (tid).
So we have to somehow translate the pidfd to a pid number.
It isn't immediately clear how to do that.
Any work on this |