[so] Tema5: Protectie ciudata
Claudiu-Florin FILIMON
so@cursuri.cs.pub.ro
Sat, 12 Feb 2005 12:59:45 +0200
This is a multi-part message in MIME format.
------=_NextPart_000_002B_01C51102.B9AAC330
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
mmap intoarce adresa OK, dar si_addr este 0.
Have FUN,
FeeL E!
----- Original Message -----=20
From: zvirid traian=20
To: so@cursuri.cs.pub.ro=20
Sent: Saturday, February 12, 2005 12:44 PM
Subject: Re: [so] Tema5: Protectie ciudata
int dif =3D (int)(info->si_addr - (void*)adr_v);
da un printf inainte si dupa ca sa fi sigur ca esti in handler
unde adr_v e adresa intoarsa de mmap.
Claudiu-Florin FILIMON <fili@mymail.ro> wrote:
Problema cam aiurea pe linux:
Mapez o zona de memorie anonima cu mmap si protectie NONE. Apoi =
setez un handler pe SIGSEGV cu sigaction.
Daca accesez zona de memorie imi intra in handler, imi completeaza =
corect signum si info->si_signo, dar info->si_addr este pe 0, orice i-as =
face.
Chestia asta imi cam baga niste bete in roate... Are cineva idee de =
la ce e?
Have FUN,
FeeL E!
-------------------------------------------------------------------------=
-----
Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'=20
Publicitate:
-------------------------------------------------------------------------=
-----
Posteaza un anunt gratuit
Posteaza gratuit anunturi de orice dimensiune si ai audienta de sute =
de mii, lunar.
------=_NextPart_000_002B_01C51102.B9AAC330
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>mmap intoarce adresa OK, dar si_addr =
este=20
0.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Have FUN,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>FeeL E!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
<A title=3Dtraian3082@yahoo.com =
href=3D"mailto:traian3082@yahoo.com">zvirid=20
traian</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dso@cursuri.cs.pub.ro=20
href=3D"mailto:so@cursuri.cs.pub.ro">so@cursuri.cs.pub.ro</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Saturday, February 12, =
2005 12:44=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [so] Tema5: =
Protectie=20
ciudata</DIV>
<DIV><BR></DIV>
<DIV><FONT size=3D2>
<P> </P>
<P>int dif =3D (int)(info->si_addr - (void*)adr_v);</P>
<P>da un printf inainte si dupa ca sa fi sigur ca esti in handler</P>
<P>unde adr_v e adresa intoarsa de =
mmap.</FONT><BR><BR><B><I>Claudiu-Florin=20
FILIMON <<A =
href=3D"mailto:fili@mymail.ro">fili@mymail.ro</A>></I></B>=20
wrote:</P>
<BLOCKQUOTE class=3Dreplbq=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px =
solid">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
<DIV><FONT face=3DArial size=3D2>Problema cam aiurea pe =
linux:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Mapez o zona de memorie anonima cu =
mmap si=20
protectie NONE. Apoi setez un handler pe SIGSEGV cu =
sigaction.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Daca accesez zona de memorie imi =
intra in=20
handler, imi completeaza corect signum si info->si_signo, dar=20
info->si_addr este pe 0, orice i-as face.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Chestia asta imi cam baga niste =
bete in=20
roate... Are cineva idee de la ce e?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Have FUN,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>FeeL =
E!</FONT></DIV></BLOCKQUOTE></DIV>
<P>
<HR SIZE=3D1>
Do you Yahoo!?<BR>Yahoo! Search presents - <A=20
=
href=3D"http://us.rd.yahoo.com/evt=3D30648/*http://movies.yahoo.com/movie=
s/feature/jibjabinaugural.html">Jib=20
Jab's 'Second Term'</A> <BR><BR>Publicitate:<BR>
<HR>
<A href=3D"http://anunturi.acasa.ro/">Posteaza un anunt =
gratuit</A><BR>Posteaza=20
gratuit anunturi de orice dimensiune si ai audienta de sute de mii, =
lunar.=20
</BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_002B_01C51102.B9AAC330--