摘要:
在寫C的過程中,我們會很自然地以為,我連續宣告一堆大小不一的char array。經過Complier之後這些char array未必是連續擺放。至於為什麼就要談到我們今天的主角了alignment以x86-32bit為例,他喜歡一次讀取 4 Bytes (i.e. 32 bits),記憶中可以想成一格一格為 4 Bytes.其indes從 0 ~ 2^32 - 1我們可以用 printf(sizeof(void *)); 來得知。machine在讀取指令時以多少Bytes為單位。printf(sizeof(unsigned long));也行。好讓每次讀取的位置皆為4的倍數,e.g. 0, 阅读全文
摘要:
CLONE_NEWUSER trickery: CVE-2013-1858Recent kernels (3.8+ something) introduced a feature calleduser-namespaces (user-ns,CLONE_NEWUSERflag)in which you can have your own UID 0.Think of it as a container solution, so you canset up compartments on a host. A nice thing,but it has some security implicat 阅读全文