Nmap Development mailing list archives

Re: [BUG] NSE/Nsock filehandle exhaustion


From: majek04 <majek04 () gmail com>
Date: Thu, 30 Aug 2007 20:45:34 +0200

On 8/28/07, Brandon Enright <bmenrigh () ucsd edu> wrote:
Maybe there needs to be some (tunable) cap on the number parallel NSE
scripts or number of sockets allowed open by NSE at a time.  I'm thinking
that nmap.new_socket() could block if the number of connected/open sockets
goes above some threshold.

Brandon

Hi!

I implemented it exactly as you proposed. nsock_connect blocks when the
number of opened connections exceeds some threshold.

For this moment this threshold is hardcoded  in
#define NSOCK_DESCRIPTORS_THRESHOLD 768
(btw. in future maybe it's good idea to decrease this value to 1 for
easier nse debugging, you know, only one script running at a time)

My patch is rather hackish but it should work.
(It can run two times lua_yield on lua thread, but it seems that it isn't
bad, although it's not theoretically proper I think),


Cheers!
 Marek Majkowski

(patch attached)

Attachment: nmap-4.22SOC6-nse-descriptor-limit.diff
Description:


_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: