。 万国邮联不知道贵源的结束之处,它只是从记忆中 f和脱条。
通常在<代码>末尾处有点零的dding。 关于32-bit x86,00 00
decodes as add [eax],al
, 添加一个记忆-点。 该编码为64个轨道。 如果俄罗斯宇宙航空研究开发机构没有点到一个可书写的网页,这将错过1。
RISC-V specifically chose its opcodes so 00 00 00 00
(and 00 00
compressed instructions) would be invalid instructions that fault, definitely not a NOP, so regions of zero-padding can t work as NOP sleds for exploits send execution nearby instead of exactly to the bytes they want to execute. Some other RISCs do run all-zero bytes as a NOP or non-faulting ALU instruction.
If execution gets past whatever 00
or non-zero garbage bytes are in memory, eventually it ll come to an unmapped or non-executable page. This will also lead to an invalid page fault, just like a data access for a bad pointer, so you also get SIGSEGV on Unix-like systems.
(关于没有记忆保护的原始CPU的法令,教员可以总结。) e. 例如,在8086年,来自CS的代码表:IP包裹不影响CS,因此,在64Ki实施的暗中 lo。 B区域,如果它采用所有直线代码而不跳跃的话。
If you re curious, run under a debugger and look at disassembly of the faulting instruction, and the hexdump of its machine code in case you recognize it as ASCII data or 00
padding. (Don t put data in the path of execution either.)
Footnote 1: hardware #PF
exception -> software SIGSEGV
The x86 CPU exception is #PF
, a page fault. The CPU will run the kernel s page-fault handler, which checks whether the process should be allowed to access that virtual address.
如果是,它可以复制或分配新的一页,或只是将页码输入“wire”一页,从页数输入过程的地址空间、小卡或软页错。 或者,I/O要从磁盘(主要或硬页的过错)上接上页。
But in this case, we re talking about a page the process doesn t have mapped, so it s an invalid page fault. The kernel s page-fault handler will deliver a SIGSEGV
segmentation-fault signal if this is a Unix-like OS, or do something similar for other OSes like Windows.