[理工] [計系]-師大100-資工

看板Grad-ProbAsk作者 (I'dont kown)時間12年前 (2012/02/06 21:08), 編輯推噓3(3012)
留言15則, 3人參與, 最新討論串1/1
第四題我想要觀念釐清 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

02/06 22:13, , 1F
11. 他根本直接抄恐龍書上的code跟圖 請看P628
02/06 22:13, 1F

02/06 22:15, , 2F
他這個程式沒做Boound checking 灌超過Buffer size
02/06 22:15, 2F

02/06 22:15, , 3F
的Data 就會爆裂
02/06 22:15, 3F

02/06 22:19, , 4F
他的目的是要改寫return address讓他指到 自己的
02/06 22:19, 4F

02/06 22:20, , 5F
的attacking program 的Code不懂就去看那裏巴
02/06 22:20, 5F

02/06 22:21, , 6F
他會把自己的Code的address放在超過Buffer Size後面
02/06 22:21, 6F

02/06 22:22, , 7F
這樣這個程式就會把 return address改掉
02/06 22:22, 7F

02/06 22:22, , 8F
你沒做Bound checking就可以這樣把address改掉
02/06 22:22, 8F

02/06 22:22, , 9F
這我按恐龍講的
02/06 22:22, 9F

02/06 22:25, , 10F
師大這考Protection那章的 這章還是看一下比較好
02/06 22:25, 10F

02/06 22:25, , 11F
交大也蠻喜歡考的
02/06 22:25, 11F

02/06 22:50, , 12F
謝謝P大,我找到了,真的是一翻兩瞪眼的題目,沒看完全
02/06 22:50, 12F

02/06 22:51, , 13F
不會,看了原來是蠻簡單的觀念
02/06 22:51, 13F

02/07 11:05, , 14F
請問第四小題(a)1450ps(b)40/29 這樣對嗎?
02/07 11:05, 14F

09/11 14:53, , 15F
他的目的是要改寫ret https://daxiv.com
09/11 14:53, 15F
文章代碼(AID): #1FBz2pca (Grad-ProbAsk)