summaryrefslogtreecommitdiffstats
path: root/sys/x86/include/psl.h
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2013-11-14 15:37:20 +0000
committeremaste <emaste@FreeBSD.org>2013-11-14 15:37:20 +0000
commit9dcbb8e88d3f051a7ee6593c53e5ad49e4904bfd (patch)
treee176fc3a1f9254f29a0794cb5f498dea6487cc1e /sys/x86/include/psl.h
parent544cc7da1e2d2b5eaee7344d5fdaebfba13d6ec5 (diff)
downloadFreeBSD-src-9dcbb8e88d3f051a7ee6593c53e5ad49e4904bfd.zip
FreeBSD-src-9dcbb8e88d3f051a7ee6593c53e5ad49e4904bfd.tar.gz
x86: Allow users to change PSL_RF via ptrace(PT_SETREGS...)
Debuggers may need to change PSL_RF. Note that tf_eflags is already stored in the signal context during signal handling and PSL_RF previously could be modified via sigreturn, so this change should not provide any new ability to userspace. For background see the thread at: http://lists.freebsd.org/pipermail/freebsd-i386/2007-September/005910.html Reviewed by: jhb, kib Sponsored by: DARPA, AFRL
Diffstat (limited to 'sys/x86/include/psl.h')
-rw-r--r--sys/x86/include/psl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/x86/include/psl.h b/sys/x86/include/psl.h
index 12d05c5..47851e0 100644
--- a/sys/x86/include/psl.h
+++ b/sys/x86/include/psl.h
@@ -77,8 +77,16 @@
* is undesirable but it may as well be allowed since users can inflict
* it on the kernel directly. Changes to PSL_AC are silently ignored on
* 386's.
+ *
+ * Users are allowed to change the privileged flag PSL_RF. The cpu sets PSL_RF
+ * in tf_eflags for faults. Debuggers should sometimes set it there too.
+ * tf_eflags is kept in the signal context during signal handling and there is
+ * no other place to remember it, so the PSL_RF bit may be corrupted by the
+ * signal handler without us knowing. Corruption of the PSL_RF bit at worst
+ * causes one more or one less debugger trap, so allowing it is fairly
+ * harmless.
*/
#define PSL_USERCHANGE (PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | PSL_T \
- | PSL_D | PSL_V | PSL_NT | PSL_AC | PSL_ID)
+ | PSL_D | PSL_V | PSL_NT | PSL_RF | PSL_AC | PSL_ID)
#endif /* !_MACHINE_PSL_H_ */
OpenPOWER on IntegriCloud