Commit e1fb1dc
committed
pidfd: allow to override signal scope in pidfd_send_signal()
Right now we determine the scope of the signal based on the type of
pidfd. There are use-cases where it's useful to override the scope of
the signal. For example in [1]. Add flags to determine the scope of the
signal:
(1) PIDFD_SIGNAL_THREAD: send signal to specific thread reference by @pidfd
(2) PIDFD_SIGNAL_THREAD_GROUP: send signal to thread-group of @pidfd
(2) PIDFD_SIGNAL_PROCESS_GROUP: send signal to process-group of @pidfd
Since we now allow specifying PIDFD_SEND_PROCESS_GROUP for
pidfd_send_signal() to send signals to process groups we need to adjust
the check restricting si_code emulation by userspace to account for
PIDTYPE_PGID.
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Link: systemd/systemd#31093 [1]
Link: https://lore.kernel.org/r/20240210-chihuahua-hinzog-3945b6abd44a@brauner
Link: https://lore.kernel.org/r/20240214123655.GB16265@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>1 parent 81b9d8a commit e1fb1dc
2 files changed
Lines changed: 42 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1905 | 1905 | | |
1906 | 1906 | | |
1907 | 1907 | | |
1908 | | - | |
| 1908 | + | |
1909 | 1909 | | |
1910 | 1910 | | |
1911 | | - | |
1912 | 1911 | | |
1913 | | - | |
| 1912 | + | |
1914 | 1913 | | |
1915 | | - | |
1916 | 1914 | | |
1917 | 1915 | | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
1918 | 1921 | | |
1919 | 1922 | | |
1920 | 1923 | | |
| |||
3873 | 3876 | | |
3874 | 3877 | | |
3875 | 3878 | | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
3876 | 3883 | | |
3877 | 3884 | | |
3878 | 3885 | | |
| |||
3897 | 3904 | | |
3898 | 3905 | | |
3899 | 3906 | | |
3900 | | - | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
3901 | 3912 | | |
3902 | 3913 | | |
3903 | 3914 | | |
| |||
3915 | 3926 | | |
3916 | 3927 | | |
3917 | 3928 | | |
3918 | | - | |
| 3929 | + | |
| 3930 | + | |
| 3931 | + | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
3919 | 3938 | | |
3920 | | - | |
| 3939 | + | |
| 3940 | + | |
3921 | 3941 | | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
3922 | 3947 | | |
3923 | 3948 | | |
3924 | 3949 | | |
| |||
3931 | 3956 | | |
3932 | 3957 | | |
3933 | 3958 | | |
3934 | | - | |
| 3959 | + | |
3935 | 3960 | | |
3936 | 3961 | | |
3937 | 3962 | | |
3938 | 3963 | | |
3939 | 3964 | | |
3940 | 3965 | | |
3941 | | - | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
3942 | 3970 | | |
3943 | 3971 | | |
3944 | 3972 | | |
| |||
0 commit comments