lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 29 Oct 2008 23:58:11 +1100
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Joe Damato <ice799@...il.com>
CC:	linux-x86_64@...r.kernel.org, linux-newbie@...r.kernel.org,
	kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/12] x86: Add static initiazlier for descriptors

Joe Damato wrote:
> Add static initializer for LDT/GDT/TSS descriptors.
>
> Signed-off-by: Joe Damato <ice799@...il.com>
> ---
>  include/asm-x86/desc_defs.h |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/include/asm-x86/desc_defs.h b/include/asm-x86/desc_defs.h
> index a1c6516..5119051 100644
> --- a/include/asm-x86/desc_defs.h
> +++ b/include/asm-x86/desc_defs.h
> @@ -91,6 +91,20 @@ typedef struct desc_struct tss_desc;
>                  , .dpl = (hi >> 13) & 3 \
>                  , .p   = (hi >> 15) & 1 \
>                  , .base1 = (hi >> 16) & 0xffff }
> +#define __DESC_INITIALIZER(lo,hi) \
> +                { .limit0 = lo & 0xffff \
> +                , .base0  = (lo >> 16) & 0xffff \
> +                , .base1  = hi & 0xff \
> +                , .type   = (hi >> 8) & 0xf \
> +                , .s      = (hi >> 12) & 1 \
> +                , .dpl    = (hi >> 13) & 3 \
> +                , .p      = (hi >> 15) & 1 \
> +                , .limit  = (hi >> 16) & 0xf \
> +                , .avl    = (hi >> 20) & 1 \
> +                , .l      = (hi >> 21) & 1 \
> +                , .d      = (hi >> 22) & 1 \
> +                , .g      = (hi >> 23) & 1 \
> +                ,.base2   = (hi >> 24) & 0xf }
>   

Reasonable as a transition, I guess, but it would be better to just make 
the initializers pass in proper values.  But I think it would be better 
to implement this with a union rather than repacking the packed values.

    J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ