[lkml]   [2002]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: select() call corrupts stack
Artiom Morozov <> writes:

|> Hello,
|> Here's a sample program. Try running it and open about 2k of
|> connections to port 5222 (you'll need ulimit -n 10000 or like
|> that). It will segfault. Simple asm like this
|> __asm__(
|> "pushl %eax \n\t" "movl 0(%ebp), %eax \n\t"
|> "cmp $65535, %eax \n\t"
|> "ja isok \n\t"
|> "xor %eax, %eax \n\t"
|> "movl %eax, 0(%eax) \n\t" "isok: \n\t"
|> "popl %eax \n\t"
|> );
|> after each subroutine call will show you that after select() [ebp] have
|> weird value. While this is unlikely to be a security flaw, i think this is
|> a bug.
|> ps: it's okay for 1k of connections or so

/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024

Use poll(3) instead.


Andreas Schwab, SuSE Labs,
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:24    [W:0.066 / U:0.404 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site