title: Buffer overflow not working as expected
body: <p>I am trying to execute a buffer overflow. I got it almost working as EIP points to the first instruction of my shellcode. However, when doing this in GDB it produces a SIGSEGV and I do not understand why.</p>
  
  <p>Here is what the situation looks like when my program exits:</p>
  
  <pre><code>gdb$ run conf160
  
  Program received signal SIGSEGV, Segmentation fault.
  --------------------------------------------------------------------------[regs]
    EAX: 0x90909090  EBX: 0x62413961  ECX: 0x00000000  EDX: 0xBFFFFAB0  o d I t S z a P c 
    ESI: 0x31624130  EDI: 0x41326241  EBP: 0x62413362  ESP: 0xBFFFFAE4  EIP: 0xBFFFFB21
    CS: 0073  DS: 007B  ES: 007B  FS: 0000  GS: 0033  SS: 007B
  --------------------------------------------------------------------------[code]
  =&gt; 0xbffffb21:  xor    eax,eax
     0xbffffb23:  push   eax
     0xbffffb24:  push   0x68732f2f
     0xbffffb29:  push   0x6141622f
     0xbffffb2e:  xor    BYTE PTR [ecx+0x61],al
     0xbffffb31:  xor    DWORD PTR [ecx+0x61],eax
     0xbffffb34:  xor    al,BYTE PTR [ecx+0x61]
     0xbffffb37:  xor    ebp,ecx
  --------------------------------------------------------------------------------
  0xbffffb21 in ?? ()
  </code></pre>
  
  <p>Why doesn't the program executes the instruction at 0xbffffb21?</p>
  
  <p>Thanks</p>