Skip to content

Commit

Permalink
[PATCH] i386 / desc_empty macro is incorrect
Browse files Browse the repository at this point in the history
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: Zachary Amsden <zach@vmware.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>

[ x86-64 had the same problem, and the same fix. Linus ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Zachary Amsden authored and Linus Torvalds committed Aug 16, 2005
1 parent 5153f7e commit 12aaa08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/asm-i386/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct desc_struct {
};

#define desc_empty(desc) \
(!((desc)->a + (desc)->b))
(!((desc)->a | (desc)->b))

#define desc_equal(desc1, desc2) \
(((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
Expand Down
2 changes: 1 addition & 1 deletion include/asm-x86_64/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define ID_MASK 0x00200000

#define desc_empty(desc) \
(!((desc)->a + (desc)->b))
(!((desc)->a | (desc)->b))

#define desc_equal(desc1, desc2) \
(((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
Expand Down

0 comments on commit 12aaa08

Please sign in to comment.