Главная страница


ru.linux

 
 - RU.LINUX ---------------------------------------------------------------------
 From : Zahar Kiselev                        2:5030/382.1   13 Oct 2004  21:46:46
 To : Nick Gazaloff
 Subject : Re: неисполняемый стэк в 2.4 ?
 -------------------------------------------------------------------------------- 
 
 
 Oct 13 11:59 04, Nick Gazaloff wrote to Zahar Kiselev:
 
  >>  NG> Смотрим на ключевое слово "сегмент" и вспоминаем о flat 32-bit 
  >>  NG> memory.
  >> А это никак не проблема _аппаратной_ платформы. Платформа поддерживает 
  >> все что нужно, это ОС не пользуется этой поддержкой.
  NG> Значит, openwall дураки писали? Вместо того, чтобы задействовать 
  NG> аппаратную защиту (которую дурак LT не смог включить), они ее стали 
  NG> эмулировать?
 
 А вот файлик с сайта http://pax.grsecurity.net/docs
 
    ----- segmexec.txt begins -----
 1. Design
 
    The goal of SEGMEXEC is to implement the non-executable page feature using
    the segmentation logic of IA-32 based CPUs.
 
    On IA-32 Linux runs in protected mode with paging enabled. This means that
    for every memory access (be that instruction fetch or normal data access)
    the CPU will perform a two step address translation. In the first step the
    logical address decoded from the instruction is translated into a linear
    (or in another terminology, virtual) address. This translation is done by
    the segmentation logic whose details are explained in a separate document.
 
    While Linux effectively does not use segmentation by creating 0 based and
    4 GB limited segments for both code and data accesses (therefore logical
    addresses are the same as linear addresses), it is possible to set up
    segments that allow to implement non-executable pages.
 
    The basic idea is that we divide the 3 GB userland linear address space
    into two equal halves and use one to store mappings meant for data access
    (that is, we define a data segment descriptor to cover the 0-1.5 GB linear
    address range) and the other for storing mappings for execution (that is,
    we define a code segment descriptor to cover the 1.5-3 GB linear address
    range). Since an executable mapping can be used for data accesses as well,
    we will have to ensure that such mappings are visible in both segments
    and mirror each other. This setup will then separate data accesses from
    instruction fetches in the sense that they will hit different linear
    addresses and therefore allow for control/intervention based on the access
    type. In particular, if a data-only (and therefore non-executable) mapping
    is present only in the 0-1.5 GB linear address range, then instruction
    fetches to the same logical addresses will end up in the 1.5-3 GB linear
    address range and will raise a page fault hence allow detecting such
    execution attempts.
 2. Implementation
 
    The core of SEGMEXEC is vma mirroring which is discussed in a separate
    document. The mirrors for executable file mappings are set up in do_mmap()
    (an inline function defined in include/linux/mm.h) except for a special
    case with RANDEXEC (see separate document). do_mmap() is the one common
    function called by both userland and kernel originated mapping requests.
 
    The special code and data segment descriptors are placed into a new GDT
    called gdt_table2 in arch/i386/kernel/head.S. The separate GDT is needed
    for two reasons: first it simplifies the implementation in that the CS/SS
    selectors used for userland do not have to change, and second, this setup
    prevents a simple attack that a single GDT setup would be subject to (the
    retf and other instructions could be abused to break out of the restricted
    code segment used for SEGMEXEC tasks). Since the GDT stores the userland
    code/data descriptors which are different for SEGMEXEC tasks, we have
    to modify the low-level context switching code called __switch_to() in
    arch/i386/kernel/process.c and the last steps of load_elf_binary() in
    fs/binfmt_elf.c (where the task is first prepared to execute in userland).
 
    The GDT also has APM specific descriptors which are set up at runtime and
    must be propagated to the second GDT as well (in arch/i386/kernel/apm.c).
    Finally the GDT stores also the per CPU TSS and LDT descriptors whose
    content must be synchronized between the two GDTs (in set_tss_desc() and
    set_ldt_desc() in arch/i386/kernel/traps.c).
 
    Since the kernel allows userland to define its own code segment descriptors
    in the LDT, we have to disallow it since it could be used to break out of
    the SEGMEXEC specific restricted code segment (the extra checks are in
    write_ldt() in arch/i386/kernel/ldt.c).
    ----- segmexec.txt ends -----
  NG> -- 
  NG> Best regards,
  NG> Nick
  NG> (GPG Key ID: 4396B2D0, fingerprint: 648E C3FE ACF6 A730 FF52 D717 
  NG> 776D 
  NG> 1CB0 4396 B2D0)
  NG> -+- ifmail v.2.15dev5.3
  NG>  + Origin: RTComm.RU (2:5020/400)
 Zahar(@spbdept.rbc.ru) Остров Большой Березовый: http://birch-island.spb.ru
 
 --- Msged/LNX 6.1.1
  * Origin: N:60.17'54" E:28.39'40" (2:5030/382.1)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 неисполняемый стэк в 2.4 ?   Zahar Kiselev   09 Oct 2004 02:46:36 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   09 Oct 2004 05:11:39 
 Re: неисполняемый стэк в 2.4 ?   Sergey_Afonin   09 Oct 2004 13:55:07 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   09 Oct 2004 21:03:42 
 Re: неисполняемый стэк в 2.4 ?   Sergey_Afonin   09 Oct 2004 22:51:14 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   10 Oct 2004 06:11:10 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   09 Oct 2004 20:41:58 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   09 Oct 2004 22:56:48 
 Re: неисполняемый стэк в 2.4 ?   Max Krasilnikov   09 Oct 2004 23:43:53 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   09 Oct 2004 23:57:39 
 Re: неисполняемый стэк в 2.4 ?   Max Krasilnikov   10 Oct 2004 00:08:36 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   10 Oct 2004 01:56:12 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   10 Oct 2004 10:39:22 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   10 Oct 2004 17:12:30 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   11 Oct 2004 01:57:11 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   11 Oct 2004 09:15:57 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   11 Oct 2004 09:27:52 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   11 Oct 2004 09:33:43 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   11 Oct 2004 09:43:40 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   11 Oct 2004 10:15:16 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   11 Oct 2004 11:05:29 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   11 Oct 2004 11:18:25 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   11 Oct 2004 11:29:50 
 Re: неисполняемый стэк в 2.4 ?   Sergey Kudriavtsev   12 Oct 2004 15:41:28 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   11 Oct 2004 13:15:34 
 Re: неисполняемый стэк в 2.4 ?   Sergey Kudriavtsev   12 Oct 2004 15:56:59 
 Re: неисполняемый стэк в 2.4 ?   Sergey Kudriavtsev   12 Oct 2004 15:35:46 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   13 Oct 2004 14:42:50 
 Re: неисполняемый стэк в 2.4 ?   Sergey Kudriavtsev   13 Oct 2004 19:53:13 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   12 Oct 2004 19:23:38 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   12 Oct 2004 23:36:14 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   13 Oct 2004 02:33:28 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   13 Oct 2004 11:59:08 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   13 Oct 2004 14:15:14 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   13 Oct 2004 23:07:35 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   14 Oct 2004 00:29:08 
 Re: неисполняемый стэк в 2.4 ?   Roman Belenov   14 Oct 2004 11:40:48 
 Re: неисполняемый стэк в 2.4 ?   Sergey Kudriavtsev   15 Oct 2004 22:58:33 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   14 Oct 2004 10:16:11 
 Re: неисполняемый стэк в 2.4 ?   Sergey Kudriavtsev   15 Oct 2004 22:56:43 
 Re: неисполняемый стэк в 2.4 ?   Sergey Mudry   13 Oct 2004 23:16:54 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   14 Oct 2004 00:59:28 
 Re: неисполняемый стэк в 2.4 ?   Sergey Mudry   14 Oct 2004 23:47:30 
 Re: неисполняемый стэк в 2.4 ?   Kirill Frolov   15 Oct 2004 00:26:31 
 Re: неисполняемый стэк в 2.4 ?   Zahar Kiselev   13 Oct 2004 21:46:46 
 Re: неисполняемый стэк в 2.4 ?   Sergey Kudriavtsev   15 Oct 2004 22:57:32 
 Re: неисполняемый стэк в 2.4 ?   Slava Astashonok   16 Oct 2004 14:07:35 
 Re: неисполняемый стэк в 2.4 ?   Sergey Kudriavtsev   13 Oct 2004 19:56:25 
 Re: неисполняемый стэк в 2.4 ?   Nick Gazaloff   15 Oct 2004 14:49:59 
 Re: =?koi8-r?B?zsXJ09DPzM7Rxc3ZyiDT1NzLINcgMi40ID8=?=   Unrau Alexander   15 Oct 2004 17:35:19 
 Re: неисполняемый стэк в 2.4 ?   Alexei Takaseev   10 Oct 2004 13:15:41 
 Re: неисполняемый стэк в 2.4 ?   Sergey_Afonin   09 Oct 2004 13:55:07 
 Re: неисполняемый стэк в 2.4 ?   Max Krasilnikov   09 Oct 2004 23:45:57 
Архивное /ru.linux/3288416d5512.html, оценка 2 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional