Перейти к содержимому

Nx bit в биосе что это

  • автор:

No-Execute Memory Protect

Большинство современных процессоров позволяют аппаратно запретить исполнение программ из области, явно предназначенной для хранения данных, а не кода (так называемый DEP в терминах Microsoft или NX и XD bit в терминах производителей процессоров). Таким образом обеспечивается дополнительная защита компьютера от хакерских атак, вирусов и т.п. угроз. Если ваш процессор поддерживает эту технологию, включите (Enabled) эту опцию. Ну а для более ранних моделей процессоров, лишенных поддержки этой функции, установите значение Disabled.

Аппаратная поддержка запрета исполнения кода программ из области данных впервые появилась в процессорах фирмы AMD Athlon 64 (и Sempron на их основе). Компания Intel ввела этот механизм начиная с последних модификаций Pentium 4 (и Celeron на их базе).

Execute Disable Bit Quick Review

Execute Disable Bit - The BIOS Optimization Guide

This BIOS feature is a toggle for the processor’s Execute Disable Bit option. In fact, the acronym XD is short for Execute Disable and is specific to Intel’s implementation. AMD’s implementation is called NX, short for No Execute.

When enabled, the processor prevents the execution of code in data-only memory pages. This provides some protection against buffer overflow attacks.

When disabled, the processor will not restrict code execution in any memory area. This makes the processor more vulnerable to buffer overflow attacks.

It is highly recommended that you enable this BIOS feature for increased protection against buffer overflow attacks.

However, please note that the Execute Disable Bit feature is a hardware feature present only in newer Intel processors. If your processor does not support Execute Disable Bit, then this BIOS feature will have no effect.

In addition, you must use an operating system that supports the Execute Disable Bit feature. Currently, that includes the following operating systems :

  • Microsoft Windows Server 2003 with Service Pack 1, or later.
  • Microsoft Windows XP with Service Pack 2, or later.
  • Microsoft Windows XP Tablet PC Edition 2005, or later.
  • SUSE Linux 9.2, or later.
  • Red Hat Enterprise Linux 3 Update 3, or later.

Incidentally, some applications and device drivers attempt to execute code from the kernel stack for improved performance. This will cause a page-fault error if Execute Disable Bit is enabled. In such cases, you will need to disable this BIOS feature.

Execute Disable Bit Details

Buffer overflow attacks are a major threat to networked computers. For example, a worm may infect a computer and flood the processor with code, bringing the system down to a halt. The worm will also propagate throughout the network, paralyzing each and every system it infects.

Due to the prevalence of such attacks, Intel enhanced their processor architecture with a feature called Execute Disable Bit, which is designed to protect the computer against certain buffer overflow attacks. First released for the 64-bit Intel Itanium processor in 2001, this feature only appeared in Intel desktop and workstation processors from November 2004 onwards. Intel mobile processors with Execute Disable Bit only started shipping in February, 2005.

Processors that come with this feature can restrict memory areas in which application code can be executed. When paired with an operating system that supports the Execute Disable Bit feature, the processor adds a new attribute bit (the Execute Disable Bit) in the paging structures used for address translation.

If the Execute Disable Bit of a memory page is set to 1, that page can only be used to store data. It will not be used to store executable code. But if the Execute Disable Bit of a memory page is set to 0, that page can be used to store data or executable code.

The processor will henceforth check the Execute Disable Bit whenever it executes code. It will not execute code in a memory page with the Execute Disable Bit set to 1. Any attempt to execute code in such a protected memory page will result in a page-fault exception.

So, if a worm or virus inserts code into the buffer, the processor prevents the code from being executed and the attack fails. This also prevents the worm or virus from propagating to other computers on the network.

This BIOS feature is a toggle for the processor’s Execute Disable Bit option. In fact, the acronym XD is short for Execute Disable and is specific to Intel’s implementation. AMD’s implementation is called NX, short for No Execute.

When enabled, the processor prevents the execution of code in data-only memory pages. This provides some protection against buffer overflow attacks.

When disabled, the processor will not restrict code execution in any memory area. This makes the processor more vulnerable to buffer overflow attacks.

It is highly recommended that you enable this BIOS feature for increased protection against buffer overflow attacks.

However, please note that the Execute Disable Bit feature is a hardware feature present only in newer Intel processors. If your processor does not support Execute Disable Bit, then this BIOS feature will have no effect.

In addition, you must use an operating system that supports the Execute Disable Bit feature. Currently, that includes the following operating systems :

  • Microsoft Windows Server 2003 with Service Pack 1, or later.
  • Microsoft Windows XP with Service Pack 2, or later.
  • Microsoft Windows XP Tablet PC Edition 2005, or later.
  • SUSE Linux 9.2, or later.
  • Red Hat Enterprise Linux 3 Update 3, or later.

Incidentally, some applications and device drivers attempt to execute code from the kernel stack for improved performance. This will cause a page-fault error if Execute Disable Bit is enabled. In such cases, you will need to disable this BIOS feature.

Go Back To > The BIOS Optimization Guide | Home

Support Tech ARP!

If you like our work, you can help support our work by visiting our sponsors, participating in the Tech ARP Forums, or even donating to our fund. Any help you can render is greatly appreciated!

NX bit

The NX bit, which stands for Never eXecute, is a technology used in CPUs to segregate areas of memory for use by either storage of processor instructions (or code) or for storage of data, a feature normally only found in Harvard architecture processors. However, the NX bit is being increasingly used in conventional operating system with support for the NX bit may mark certain areas of memory as non-executable. The processor will then refuse to execute any code residing in these areas of memory. The general technique, known as Intel markets the feature as the XD bit, for eXecute Disable. ARM architecture refers to the feature as XN for eXecute Never; it was introduced in ARM v6.

Contents

Hardware background [ ]

x86 processors, since the 80286, included a similar capability implemented at the segment level. However, current operating systems implementing the flat memory model cannot use this capability. There was no ‘Executable’ flag in the page table entry (page descriptor) in the 80386 and later x86 processors, until, to make this capability available to operating systems using the flat memory model, AMD added a «not executable» or NX bit to the page table entry in its AMD64 architecture, providing a mechanism that can control execution per DEC’s (now HP’s) Alpha, SPARC , and IBM’s z/Architecture and PowerPC. Intel implemented a similar feature in its IA-64 architecture—in 2001, but did not bring it to the more popular x86 processor families (Pentium, Celeron, Xeon, etc.) In the x86 architecture it was implemented by AMD, as NX bit, for use by its AMD64 line of processors, such as the Physical Address Extension (PAE) page table format, because the x86’s original 32-bit page table format has no bit 63 and therefore no bit to disable/enable execution.

Software emulation of feature [ ]

Prior to the onset of this feature within the hardware, various operating systems attempted to emulate this feature through software.

An operating system with the ability to emulate and/or take advantage of an NX bit may prevent the exploits from succeeding, particularly those that inject and execute code, such as the Sasser and OS implementations [ ]

Microsoft Windows [ ]

Starting with Windows XP Service Pack 2 and Windows Server 2003 Service Pack 1, the NX features were implemented for the first time on the x86 architecture.

Microsoft Windows uses NX protection on critical Windows services exclusively by default. Under Windows XP or Server 2003, the feature is called disable DEP during an attack. The elaborates on why ASLR is necessary; a proof-of-concept was produced detailing a method by which DEP could be circumvented in the absence of ASLR. It may be possible to develop a successful attack if the address of prepared data such as corrupted images or MP3s can be known by the attacker. Microsoft added ASLR functionality in Windows Vista and Windows Server 2008 to address this avenue of attack.

Outside of the x86 sphere, a version of NX also exists for Intel’s IA-64 which is implemented in Windows on that architecture.

  • Hardware Supported Processors: x86-64 (AMD64 and Intel 64), IA-64 , Efficeon , AMD Sempron (later revisions)
  • Emulation: No
  • Other Supported: None
  • Standard Distribution: Windows XP Service Pack 2, Windows Server 2003 Service Pack 1, Windows XP Professional x64 Edition, Windows Vista
  • Release Date: August 6, 2004

Functional comparison of technologies [ ]

Here, features of the NX technologies will be compared and contrasted.

Generally, NX bit emulation is available only on x86 CPUs. The sections within dealing with emulation are concerned only with x86 CPUs unless otherwise stated.

While it has been proven that some NX bit emulation methods incur an extremely low overhead, it has also been proven that such methods can become inaccurate. On the other hand, other methods may incur an extremely high overhead and be absolutely accurate. No method has been discovered as of yet without a significant trade-off, whether in processing power, accuracy, or virtual memory space.

Overhead [ ]

Overhead is the amount of extra CPU processing power that is required for each technology to function. It is important because technologies which somehow emulate or supply an NX bit will usually impose a measurable overhead; while using a hardware supplied NX bit will impose no measurable overhead. All technologies create overhead due to the extra programming logic that must be created to control the state of the NX bit for various areas of memory; however, evaluation is usually handled by the CPU itself when a hardware NX bit exists, and thus produces no overhead.

Accuracy [ ]

Some technologies approximately emulate (or approximate) an NX bit on CPUs which do not support them. Others strictly emulate an NX bit for these CPUs, but decrease performance or virtual memory space significantly.

Control over restrictions [ ]

Some technologies allow executable programs to be marked so that the operating system knows to relax the restrictions imposed by the NX technology for that particular program. Various systems provide various controls; such controls are described here.

Windows [ ]

When NX is supported, it is enabled by default. Windows allows programs to control which pages disallow execution through its Win32 API calls VirtualAlloc[Ex] and VirtualProtect[Ex]. In these functions, a page protection setting is specified by the programmer. Each page may be individually flagged as executable or non-executable. Despite the lack of previous x86 hardware support, both executable and non-executable page settings have been provided since the beginning. On pre-NX CPUs, the presence of the ‘executable’ attribute has no effect. It was documented as if it did function, and, as a result, most programmers used it properly.

In the PE file format, each section can specify its executability. The execution flag has existed since the beginning of the format; standard Xbox [ ]

In Microsoft’s Xbox, although the CPU does not have the NX bit, newer versions of the XDK set the code segment limit to the beginning of the kernel’s .data section (no code should be after this point in normal circumstances). This was probably in response to the 007: Agent Under Fire saved game exploit; however, this change does not fix the problem, as the memory from which the payload executes is well below the beginning of the kernel’s .data section.

Starting with version 51xx, this change was also implemented into the kernel of new Xboxes. This broke the techniques old exploits used to become a External links [ ]

NX-Bit

NX-Bit (No eXecute Bit — в AMD), или XD-Bit (Execute Disable Bit — в Intel) — антивирус, способный предотвратить «заражение» ПК некоторыми типами вредоносного ПО. Борется с искусственно-вызванной ошибкой переполнения буфера. С данным антивирусом имеет тесную связь технология Microsoft DEP.

Технология может работать только если:

  • Имеется поддержка процессора на аппаратном уровне (от Intel Pentium 4 серии 6xx и выше, а также все модификации AMD Athlon 64);
  • Установлена ОС с поддержкой данной технологии (Linux с ядром, начиная от версии 2.3.23; Windows XP Service Pack 2 и выше);
  • Применяется PAE или архитектура x86-64.

Иногда технология способна вызвать конфликт программного характера с некоторыми видами программного обеспечения. Так, в BIOS’е материнских плат, поддерживающих процессоры с EDB, имеется возможность отключения этой технологии.

NX (XD) — атрибут страницы памяти, употребляемый в архитектурах x86 и x86-64, предназначенный для укрепления защиты системы от программных ошибок, вирусов, троянских коней и других вредоносных программ.

  • NX (No eXecute) — терминология AMD;
  • XD (eXecution Disable) — терминология Intel.

NX-bit — самый старший разряд элемента 64-битных таблиц страниц, которые применяются процессором для распределения памяти в адресном пространстве. 64-разрядные таблицы страниц используются только в ОС, работающих в 64-битном режиме, либо с включенным расширением физических адресов (PAE).

В настоящее время, компьютерные системы обладают памятью, разделенной на страницы с определенными атрибутами. Так, в новые серии продуктов разработчики процессоров добавили еще один атрибут — запрет исполнения кода на странице (страница может быть использована для хранения данных, но не для хранения программного кода). В случае возникновения попытки передать управление на подобного рода страницу, процессор генерирует специальную ошибку страницы, и программа прекращает свою работу в аварийном порядке.

Атрибут защиты от исполнения внедряли и в другие микропроцессорные архитектуры, но только в x86-системах эта защита реализовывалась на уровне программных сегментов. Сегодня такая защита внедрена и на уровне отдельных страниц.

В современных ПО наблюдается четкое разделение на сегменты кода («text»), данных («data») и неинициализированных данных («bss»). Кроме того, имеется и динамически-распределяемый сегмент памяти, который, в свою очередь, делится на:

  • кучу («heap»);
  • программный стек («stack»).

Если при написании программы не было допущено никаких ошибок, указатель команд не выйдет за пределы сегментов кода. Но в случае программных ошибок, управление может быть передано в другие области памяти. Это повлечет за собой блокирование процессора перед операциями по запрограммированным действиям, и начало произвольного выполнения случайной последовательности команд. Так будет продолжаться до тех пор, пока процессор не идентифицирует недопустимую последовательность, тогда сработает внутренняя система защиты. Так или иначе, программа завершится аварийно. Кроме того, процессору может попасться последовательность, которая интерпретируется как команда перехода к пройденному адресу. В этом случае, процессор попадет в бесконечный цикл, а программа «зависнет». Чтобы предотвратить подобные случаи, специалисты ввели дополнительный атрибут, который определяет следующее условие: если какая-то область памяти не предназначена для хранения программного кода, то все ее страницы должны помечаться NX-битом, а в случае возникновения попытки передать управление, процессор сформирует команду, и операционная система мгновенно завершит программу. Ключевой причиной введения данного атрибута было не столько обеспечение быстрой реакции на такие ошибки, сколько распространенность подобных ошибок среди злоумышленников, которые использовали их для несанкционированного доступа к ПК. Написанные ими всевозможные вирусы и черви искали уязвимые места в распространенных ПО.

Тех. детали

Зачастую, буфер переполняется в тех случаях, когда разработчик делает его фиксированной длины. Полагая, что отведенного пространства будет достаточно, разработчик не проверяет выход данных за границы, при манипуляции ими, в результате чего поступающие данные могут занять не предназначенный для них сегмент памяти, уничтожив при этом хранящуюся в тех сегментах информацию.

Нередко временные буферы выделяются внутри подпрограмм, память для которых определена в программном стеке. В нем, помимо всего прочего, расположены адреса возвратов в вызывающую подпрограмму. Изучив код программы, злоумышленник может обнаружить подобную ошибку, и после передать в программу определенную последовательность данных, при обработке которой программа по ошибке заменит адрес возврата в стеке на адрес, требуемый злоумышленнику. По завершению подпрограммы, инструкция возврата (RET) вытолкнет из стека в указатель команд адрес входа в процедуру злоумышленника, и он получит контроль над компьютером. Атрибут NX делает такую манипуляцию невозможной. Область стека отмечается NX-битом, а любое выполнение кода — запрещается. Так, если передать управление стеку, то сработает защита.

Для запуска программ, использующих выполнение кода в стеке/куче под операционной системой Windows, необходимо отключать функцию NX на протяжении всего сеанса работы. Для повторной ее активации требуется перезагрузка компьютера. Несмотря на то, что в Windows предусмотрен механизм белого списка приложений, этот метод не всегда корректно работает.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *