Nmap Development mailing list archives

Fwd: Sean Rivera Progress report 13/17


From: sean rivera <sean.au.rivera () gmail com>
Date: Tue, 24 Jul 2012 11:19:06 -0600

---------- Forwarded message ----------
From: Sean Rivera <rivera.shadowoftruth () gmail com>
Date: Tue, Jul 24, 2012 at 11:05 AM
Subject: Re: Sean Rivera Progress report 13/17
To: David Fifield <david () bamsoftware com>


On 07/23/2012 09:52 PM, David Fifield wrote:

On Mon, Jul 23, 2012 at 09:23:38PM -0600, sean rivera wrote:

Priorities,
Finish fixing the race condition here from this todo race condition.
[NPING] At least on my (Fyodor) system, I get errors like "READ-PCAP
   killed: Resource temporarily unavailable" with some commands.
   Example:
   # nping --tcp -p80 -c1 scanme.nmap.org
    I've currently found that it exists for tcp, udp, and icmp, and
isolated
it down to a couple of lines. I hope to fix this soon.

Can you briefly summarize what the problem is and the lines you've
isolated it to?

David Fifield
______________________________**_________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/**mailman/listinfo/nmap-dev<http://cgi.insecure.org/mailman/listinfo/nmap-dev>
Archived at http://seclists.org/nmap-dev/

Hey David,

Sorry for the delay in getting back to you. I crashed somewhat early
yesterday.

The problem is somewhere in lines 398-410 (Or 448-460 for icmp and arp
packets).
From my testing I've noticed that the error does not show up with the -N
flag (So it needs the scheduled packet read) and it only works on a single
packet sent (-c1).
I've also found that setting the delay can change the error message or
eliminate it all together.
By running a simple shell script that caught stderr and tossed into a file
--delay flag value I've found some interesting results for single packet
sends.
Results:
Delay = 2
Always prints two
nping_event_handler(): READ-PCAP killed: Resource temporarily unavailable
nping_event_handler(): READ-PCAP killed: Resource temporarily unavailable
Which I believe comes from
 nsock_pcap_read_packet(nsp, pcap_nsi, nping_event_handler, o.getDelay(),
NULL);

Delay =1
Race condition exists here which makes sense, as delay=1 is the default
value

Delay <1 and delay is greater then .1
Same deal with the race conditions.

Delay <=.1
I've tried running this hundreds of times and I cannot get the
nping_event_handler(): TIMER killed: Resource temporarily unavailable.

From my testing so far I think the race condition is a combo of the

"nsock_pcap_read_packet(nsp, pcap_nsi, nping_event_handler, o.getDelay(),
NULL);"

scheduled event and the

"nsock_timer_create(nsp, nping_event_handler, 1, &pkts2send[pc]);"

that is called only on the first time.

I am also pretty sure that it is because of that hard coded 1 for time out.
(Every other time it is o.getDelay() but I'll need to test that.

Other thoughts/suggestions?



-- 

~Sean Rivera
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: