OSDN Git Service

[PATCH] i386: fix long long cast in pte macro
authorPaX Team <pageexec@freemail.hu>
Thu, 31 Aug 2006 17:51:28 +0000 (18:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Oct 2006 20:10:41 +0000 (22:10 +0200)
commit6a596bb708adcff58f95df367f04d4d8d1883603
tree7973273f601d8b29d87472bb3b00068ae1c802b5
parente43de1caaa32af8fbdc9714413c6d74476537275
[PATCH] i386: fix long long cast in pte macro

From PaX Team :
the current idiom used for initializing a structure of two unsigned longs
from unsigned long long is wrong, it effectively loses the upper 32 bits
which in this particular case could turn a non-executable PTE into an
executable one on NX capable i386 (i.e., it's a potential security bug).
fortunately the in-tree users in 2.4 (drivers/char/drm-4.0/ffb_drv.c
and arch/mips/baget/baget.c) are not affected.

Added the (unsigned long long) cast as suggested by Ralf Baechle to
silent gcc when shifting right 32-bit arguments.

Acked-by: Willy Tarreau <w@1wt.eu>
include/asm-i386/page.h