diff options
author | Peter Collingbourne <pcc@google.com> | 2020-11-20 12:33:45 -0800 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2020-11-23 10:31:06 -0600 |
commit | 6ac05e832a9e96f9b1c42a8917cdd317d7b6c8fa (patch) | |
tree | 72e13727569f07efa33909831e2de1e7e9743bef /include/linux/signal.h | |
parent | a54f0dfda754c5cecc89a14dab68a3edc1e497b5 (diff) | |
download | linux-6ac05e832a9e96f9b1c42a8917cdd317d7b6c8fa.tar.gz linux-6ac05e832a9e96f9b1c42a8917cdd317d7b6c8fa.tar.bz2 linux-6ac05e832a9e96f9b1c42a8917cdd317d7b6c8fa.zip |
signal: define the SA_EXPOSE_TAGBITS bit in sa_flags
Architectures that support address tagging, such as arm64, may want to
expose fault address tag bits to the signal handler to help diagnose
memory errors. However, these bits have not been previously set,
and their presence may confuse unaware user applications. Therefore,
introduce a SA_EXPOSE_TAGBITS flag bit in sa_flags that a signal
handler may use to explicitly request that the bits are set.
The generic signal handler APIs expect to receive tagged addresses.
Architectures may specify how to untag addresses in the case where
SA_EXPOSE_TAGBITS is clear by defining the arch_untagged_si_addr
function.
Signed-off-by: Peter Collingbourne <pcc@google.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Link: https://linux-review.googlesource.com/id/I16dd0ed2081f091fce97be0190cb8caa874c26cb
Link: https://lkml.kernel.org/r/13cf24d00ebdd8e1f55caf1821c7c29d54100191.1605904350.git.pcc@google.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/signal.h')
-rw-r--r-- | include/linux/signal.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/signal.h b/include/linux/signal.h index b256f9c65661..205526c4003a 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h @@ -469,4 +469,18 @@ struct seq_file; extern void render_sigset_t(struct seq_file *, const char *, sigset_t *); #endif +#ifndef arch_untagged_si_addr +/* + * Given a fault address and a signal and si_code which correspond to the + * _sigfault union member, returns the address that must appear in si_addr if + * the signal handler does not have SA_EXPOSE_TAGBITS enabled in sa_flags. + */ +static inline void __user *arch_untagged_si_addr(void __user *addr, + unsigned long sig, + unsigned long si_code) +{ + return addr; +} +#endif + #endif /* _LINUX_SIGNAL_H */ |