看板 Grad-ProbAsk 關於我們 聯絡資訊
第四題我想要觀念釐清 4.The processing times needed for the five stages in a pipelined datapath are 400ps, 150ps, 200ps, 350ps,and 150ps,respectively.A register with 50ps access time is needed between consecutive stages. (a) What is the fastest clock frequency this datapath can operate? (b) What is the maximum speed-up when compared to the single cycle implementation of the datapath? 請問(a)小題是要直接算整個IF,ID,EX,MEM,WB的clock frequency為1450ps,還是要比較 lw,R-type,branch指令誰執行最少的clock? (b)小題的single cycle是取決於最大指令clock cycle 還是說取決於最大執行stage 400ps然後再乘以五(個stages)? 第11題我就真的不太會了 11.Buffer overflow is one of the most common attack to operating systems. Please explain how a hacker can use the code below to gain a system shell and enter the system. #include <stdio.h> #define BUFFER_SIZE 256 int main(int argc, char *argv[]) { char buffer[BUFFER_SIZE]; if (argc < 2) return -1; else { strcpy(buffer,argv[1]); return 0; } } 他給的圖: bottom _____________ frame pointer ∣ ∣ return address ∣ ←————— ∣ ∣————————————∣ ∣ ∣ saved frame pointer ∣ ∣ ∣————————————∣ ∣ ∣ ∣ ∣ ∣————————————∣ ∣ ∣automatic variables ∣ ∣ ∣————————————∣ ↓ ∣ parameters ∣ top ∣____________∣ 請高手幫幫忙 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 175.98.50.200
pikachu123:11. 他根本直接抄恐龍書上的code跟圖 請看P628 02/06 22:13
pikachu123: 他這個程式沒做Boound checking 灌超過Buffer size 02/06 22:15
pikachu123:的Data 就會爆裂 02/06 22:15
pikachu123: 他的目的是要改寫return address讓他指到 自己的 02/06 22:19
pikachu123:的attacking program 的Code不懂就去看那裏巴 02/06 22:20
pikachu123:他會把自己的Code的address放在超過Buffer Size後面 02/06 22:21
pikachu123:這樣這個程式就會把 return address改掉 02/06 22:22
pikachu123:你沒做Bound checking就可以這樣把address改掉 02/06 22:22
pikachu123:這我按恐龍講的 02/06 22:22
pikachu123:師大這考Protection那章的 這章還是看一下比較好 02/06 22:25
pikachu123:交大也蠻喜歡考的 02/06 22:25
love5566188:謝謝P大,我找到了,真的是一翻兩瞪眼的題目,沒看完全 02/06 22:50
love5566188:不會,看了原來是蠻簡單的觀念 02/06 22:51
love5566188:請問第四小題(a)1450ps(b)40/29 這樣對嗎? 02/07 11:05
sneak: 他的目的是要改寫ret https://daxiv.com 09/11 14:53