Commit 12aaa085 authored by Zachary Amsden's avatar Zachary Amsden Committed by Linus Torvalds

[PATCH] i386 / desc_empty macro is incorrect

Chuck Ebbert noticed that the desc_empty macro is incorrect.  Fix it.

Thankfully, this is not used as a security check, but it can falsely
overwrite TLS segments with carefully chosen base / limits.  I do not
believe this is an issue in practice, but it is a kernel bug.
Signed-off-by: default avatarZachary Amsden <zach@vmware.com>
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>

[ x86-64 had the same problem, and the same fix. Linus ]
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5153f7e6
...@@ -29,7 +29,7 @@ struct desc_struct { ...@@ -29,7 +29,7 @@ struct desc_struct {
}; };
#define desc_empty(desc) \ #define desc_empty(desc) \
(!((desc)->a + (desc)->b)) (!((desc)->a | (desc)->b))
#define desc_equal(desc1, desc2) \ #define desc_equal(desc1, desc2) \
(((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#define ID_MASK 0x00200000 #define ID_MASK 0x00200000
#define desc_empty(desc) \ #define desc_empty(desc) \
(!((desc)->a + (desc)->b)) (!((desc)->a | (desc)->b))
#define desc_equal(desc1, desc2) \ #define desc_equal(desc1, desc2) \
(((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment