Revert "signal: Deliver SIGTRAP on perf event asynchronously if blocked"
This reverts commit 60768ffced which is
commit 78ed93d72ded679e3caf0758357209887bda885f upstream.
It breaks the Android CRC checksums (but not the size abi), and it
doesn't resolve anything that is relevant for Android systems, so just
revert it.
If it needs to be added back, it can be done so in an ABI-safe way if
needed.
Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie15b2985b87f16e6e200390c7c15a5a5f5623d90
This commit is contained in:
@@ -708,7 +708,6 @@ static_assert(offsetof(siginfo_t, si_upper) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_pkey) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_perf_data) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_perf_type) == 0x14);
|
||||
static_assert(offsetof(siginfo_t, si_perf_flags) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_band) == 0x0c);
|
||||
static_assert(offsetof(siginfo_t, si_fd) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_call_addr) == 0x0c);
|
||||
|
||||
@@ -1012,7 +1012,6 @@ static_assert(offsetof(siginfo_t, si_upper) == 0x28);
|
||||
static_assert(offsetof(siginfo_t, si_pkey) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_perf_data) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_perf_type) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_perf_flags) == 0x24);
|
||||
static_assert(offsetof(siginfo_t, si_band) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_fd) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_call_addr) == 0x10);
|
||||
|
||||
@@ -487,7 +487,6 @@ static_assert(offsetof(compat_siginfo_t, si_upper) == 0x18);
|
||||
static_assert(offsetof(compat_siginfo_t, si_pkey) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_data) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_type) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_flags) == 0x18);
|
||||
static_assert(offsetof(compat_siginfo_t, si_band) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_fd) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_call_addr) == 0x0c);
|
||||
|
||||
@@ -625,7 +625,6 @@ static inline void siginfo_build_tests(void)
|
||||
/* _sigfault._perf */
|
||||
BUILD_BUG_ON(offsetof(siginfo_t, si_perf_data) != 0x10);
|
||||
BUILD_BUG_ON(offsetof(siginfo_t, si_perf_type) != 0x14);
|
||||
BUILD_BUG_ON(offsetof(siginfo_t, si_perf_flags) != 0x18);
|
||||
|
||||
/* _sigpoll */
|
||||
BUILD_BUG_ON(offsetof(siginfo_t, si_band) != 0x0c);
|
||||
|
||||
@@ -780,6 +780,5 @@ static_assert(offsetof(compat_siginfo_t, si_upper) == 0x18);
|
||||
static_assert(offsetof(compat_siginfo_t, si_pkey) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_data) == 0x10);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_type) == 0x14);
|
||||
static_assert(offsetof(compat_siginfo_t, si_perf_flags) == 0x18);
|
||||
static_assert(offsetof(compat_siginfo_t, si_band) == 0x0c);
|
||||
static_assert(offsetof(compat_siginfo_t, si_fd) == 0x10);
|
||||
|
||||
@@ -590,6 +590,5 @@ static_assert(offsetof(siginfo_t, si_upper) == 0x28);
|
||||
static_assert(offsetof(siginfo_t, si_pkey) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_perf_data) == 0x18);
|
||||
static_assert(offsetof(siginfo_t, si_perf_type) == 0x20);
|
||||
static_assert(offsetof(siginfo_t, si_perf_flags) == 0x24);
|
||||
static_assert(offsetof(siginfo_t, si_band) == 0x10);
|
||||
static_assert(offsetof(siginfo_t, si_fd) == 0x14);
|
||||
|
||||
@@ -149,10 +149,8 @@ static inline void signal_compat_build_tests(void)
|
||||
|
||||
BUILD_BUG_ON(offsetof(siginfo_t, si_perf_data) != 0x18);
|
||||
BUILD_BUG_ON(offsetof(siginfo_t, si_perf_type) != 0x20);
|
||||
BUILD_BUG_ON(offsetof(siginfo_t, si_perf_flags) != 0x24);
|
||||
BUILD_BUG_ON(offsetof(compat_siginfo_t, si_perf_data) != 0x10);
|
||||
BUILD_BUG_ON(offsetof(compat_siginfo_t, si_perf_type) != 0x14);
|
||||
BUILD_BUG_ON(offsetof(compat_siginfo_t, si_perf_flags) != 0x18);
|
||||
|
||||
CHECK_CSI_OFFSET(_sigpoll);
|
||||
CHECK_CSI_SIZE (_sigpoll, 2*sizeof(int));
|
||||
|
||||
@@ -235,7 +235,6 @@ typedef struct compat_siginfo {
|
||||
struct {
|
||||
compat_ulong_t _data;
|
||||
u32 _type;
|
||||
u32 _flags;
|
||||
} _perf;
|
||||
};
|
||||
} _sigfault;
|
||||
|
||||
@@ -324,7 +324,7 @@ int send_sig_mceerr(int code, void __user *, short, struct task_struct *);
|
||||
|
||||
int force_sig_bnderr(void __user *addr, void __user *lower, void __user *upper);
|
||||
int force_sig_pkuerr(void __user *addr, u32 pkey);
|
||||
int send_sig_perf(void __user *addr, u32 type, u64 sig_data);
|
||||
int force_sig_perf(void __user *addr, u32 type, u64 sig_data);
|
||||
|
||||
int force_sig_ptrace_errno_trap(int errno, void __user *addr);
|
||||
int force_sig_fault_trapno(int sig, int code, void __user *addr, int trapno);
|
||||
|
||||
@@ -99,7 +99,6 @@ union __sifields {
|
||||
struct {
|
||||
unsigned long _data;
|
||||
__u32 _type;
|
||||
__u32 _flags;
|
||||
} _perf;
|
||||
};
|
||||
} _sigfault;
|
||||
@@ -165,7 +164,6 @@ typedef struct siginfo {
|
||||
#define si_pkey _sifields._sigfault._addr_pkey._pkey
|
||||
#define si_perf_data _sifields._sigfault._perf._data
|
||||
#define si_perf_type _sifields._sigfault._perf._type
|
||||
#define si_perf_flags _sifields._sigfault._perf._flags
|
||||
#define si_band _sifields._sigpoll._band
|
||||
#define si_fd _sifields._sigpoll._fd
|
||||
#define si_call_addr _sifields._sigsys._call_addr
|
||||
@@ -272,11 +270,6 @@ typedef struct siginfo {
|
||||
* that are of the form: ((PTRACE_EVENT_XXX << 8) | SIGTRAP)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Flags for si_perf_flags if SIGTRAP si_code is TRAP_PERF.
|
||||
*/
|
||||
#define TRAP_PERF_FLAG_ASYNC (1u << 0)
|
||||
|
||||
/*
|
||||
* SIGCHLD si_codes
|
||||
*/
|
||||
|
||||
@@ -6530,8 +6530,8 @@ static void perf_sigtrap(struct perf_event *event)
|
||||
if (current->flags & PF_EXITING)
|
||||
return;
|
||||
|
||||
send_sig_perf((void __user *)event->pending_addr,
|
||||
event->attr.type, event->attr.sig_data);
|
||||
force_sig_perf((void __user *)event->pending_addr,
|
||||
event->attr.type, event->attr.sig_data);
|
||||
}
|
||||
|
||||
static void perf_pending_event_disable(struct perf_event *event)
|
||||
|
||||
@@ -1814,7 +1814,7 @@ int force_sig_pkuerr(void __user *addr, u32 pkey)
|
||||
}
|
||||
#endif
|
||||
|
||||
int send_sig_perf(void __user *addr, u32 type, u64 sig_data)
|
||||
int force_sig_perf(void __user *addr, u32 type, u64 sig_data)
|
||||
{
|
||||
struct kernel_siginfo info;
|
||||
|
||||
@@ -1826,18 +1826,7 @@ int send_sig_perf(void __user *addr, u32 type, u64 sig_data)
|
||||
info.si_perf_data = sig_data;
|
||||
info.si_perf_type = type;
|
||||
|
||||
/*
|
||||
* Signals generated by perf events should not terminate the whole
|
||||
* process if SIGTRAP is blocked, however, delivering the signal
|
||||
* asynchronously is better than not delivering at all. But tell user
|
||||
* space if the signal was asynchronous, so it can clearly be
|
||||
* distinguished from normal synchronous ones.
|
||||
*/
|
||||
info.si_perf_flags = sigismember(¤t->blocked, info.si_signo) ?
|
||||
TRAP_PERF_FLAG_ASYNC :
|
||||
0;
|
||||
|
||||
return send_sig_info(info.si_signo, &info, current);
|
||||
return force_sig_info(&info);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3468,7 +3457,6 @@ void copy_siginfo_to_external32(struct compat_siginfo *to,
|
||||
to->si_addr = ptr_to_compat(from->si_addr);
|
||||
to->si_perf_data = from->si_perf_data;
|
||||
to->si_perf_type = from->si_perf_type;
|
||||
to->si_perf_flags = from->si_perf_flags;
|
||||
break;
|
||||
case SIL_CHLD:
|
||||
to->si_pid = from->si_pid;
|
||||
@@ -3546,7 +3534,6 @@ static int post_copy_siginfo_from_user32(kernel_siginfo_t *to,
|
||||
to->si_addr = compat_ptr(from->si_addr);
|
||||
to->si_perf_data = from->si_perf_data;
|
||||
to->si_perf_type = from->si_perf_type;
|
||||
to->si_perf_flags = from->si_perf_flags;
|
||||
break;
|
||||
case SIL_CHLD:
|
||||
to->si_pid = from->si_pid;
|
||||
@@ -4727,7 +4714,6 @@ static inline void siginfo_buildtime_checks(void)
|
||||
CHECK_OFFSET(si_pkey);
|
||||
CHECK_OFFSET(si_perf_data);
|
||||
CHECK_OFFSET(si_perf_type);
|
||||
CHECK_OFFSET(si_perf_flags);
|
||||
|
||||
/* sigpoll */
|
||||
CHECK_OFFSET(si_band);
|
||||
|
||||
Reference in New Issue
Block a user