| From: |
| Linux Kernel Mailing List <linux-kernel@vger.kernel.org> |
| To: |
| BK Commits List:; |
| Subject: |
| Fix impressive call gate misuse DoS reported on bugtraq. |
| Date: |
| Thu, 14 Nov 2002 17:41:55 +0000 |
ChangeSet 1.848, 2002/11/14 09:41:55-08:00, torvalds@home.transmeta.com
Fix impressive call gate misuse DoS reported on bugtraq.
# This patch includes the following deltas:
# ChangeSet 1.847 -> 1.848
# arch/i386/kernel/entry.S 1.42 -> 1.43
#
entry.S | 13 +++++++++++++
1 files changed, 13 insertions(+)
diff -Nru a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
--- a/arch/i386/kernel/entry.S Thu Nov 14 10:04:04 2002
+++ b/arch/i386/kernel/entry.S Thu Nov 14 10:04:04 2002
@@ -66,7 +66,9 @@
OLDSS = 0x38
CF_MASK = 0x00000001
+TF_MASK = 0x00000100
IF_MASK = 0x00000200
+DF_MASK = 0x00000400
NT_MASK = 0x00004000
VM_MASK = 0x00020000
@@ -134,6 +136,17 @@
movl %eax,EFLAGS(%esp) #
movl %edx,EIP(%esp) # Now we move them to their "normal" places
movl %ecx,CS(%esp) #
+
+ #
+ # Call gates don't clear TF and NT in eflags like
+ # traps do, so we need to do it ourselves.
+ # %eax already contains eflags (but it may have
+ # DF set, clear that also)
+ #
+ andl $~(DF_MASK | TF_MASK | NT_MASK),%eax
+ pushl %eax
+ popfl
+
movl %esp, %ebx
pushl %ebx
andl $-8192, %ebx # GET_THREAD_INFO
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html