Skip to content

Commit 922e301

Browse files
committed
signalfd: Remove SIL_PERF_EVENT fields from signalfd_siginfo
With the addition of ssi_perf_data and ssi_perf_type struct signalfd_siginfo is dangerously close to running out of space. All that remains is just enough space for two additional 64bit fields. A practice of adding all possible siginfo_t fields into struct singalfd_siginfo can not be supported as adding the missing fields ssi_lower, ssi_upper, and ssi_pkey would require two 64bit fields and one 32bit fields. In practice the fields ssi_perf_data and ssi_perf_type can never be used by signalfd as the signal that generates them always delivers them synchronously to the thread that triggers them. Therefore until someone actually needs the fields ssi_perf_data and ssi_perf_type in signalfd_siginfo remove them. This leaves a bit more room for future expansion. v1: https://lkml.kernel.org/r/[email protected] v2: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Reviewed-by: Marco Elver <[email protected]> Signed-off-by: "Eric W. Biederman" <[email protected]>
1 parent 0683b53 commit 922e301

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

fs/signalfd.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,13 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
114114
break;
115115
case SIL_FAULT_BNDERR:
116116
case SIL_FAULT_PKUERR:
117+
case SIL_PERF_EVENT:
117118
/*
118-
* Fall through to the SIL_FAULT case. Both SIL_FAULT_BNDERR
119-
* and SIL_FAULT_PKUERR are only generated by faults that
120-
* deliver them synchronously to userspace. In case someone
121-
* injects one of these signals and signalfd catches it treat
122-
* it as SIL_FAULT.
119+
* Fall through to the SIL_FAULT case. SIL_FAULT_BNDERR,
120+
* SIL_FAULT_PKUERR, and SIL_PERF_EVENT are only
121+
* generated by faults that deliver them synchronously to
122+
* userspace. In case someone injects one of these signals
123+
* and signalfd catches it treat it as SIL_FAULT.
123124
*/
124125
case SIL_FAULT:
125126
new.ssi_addr = (long) kinfo->si_addr;
@@ -132,11 +133,6 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
132133
new.ssi_addr = (long) kinfo->si_addr;
133134
new.ssi_addr_lsb = (short) kinfo->si_addr_lsb;
134135
break;
135-
case SIL_PERF_EVENT:
136-
new.ssi_addr = (long) kinfo->si_addr;
137-
new.ssi_perf_type = kinfo->si_perf_type;
138-
new.ssi_perf_data = kinfo->si_perf_data;
139-
break;
140136
case SIL_CHLD:
141137
new.ssi_pid = kinfo->si_pid;
142138
new.ssi_uid = kinfo->si_uid;

include/uapi/linux/signalfd.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ struct signalfd_siginfo {
3939
__s32 ssi_syscall;
4040
__u64 ssi_call_addr;
4141
__u32 ssi_arch;
42-
__u32 ssi_perf_type;
43-
__u64 ssi_perf_data;
4442

4543
/*
4644
* Pad strcture to 128 bytes. Remember to update the
@@ -51,7 +49,7 @@ struct signalfd_siginfo {
5149
* comes out of a read(2) and we really don't want to have
5250
* a compat on read(2).
5351
*/
54-
__u8 __pad[16];
52+
__u8 __pad[28];
5553
};
5654

5755

0 commit comments

Comments
 (0)