public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Artiom Morozov <artiom@phreaker.net>
Cc: linux-kernel@vger.kernel.org, Kiretchko Serguei <spk@csp.org.by>
Subject: Re: select() call corrupts stack
Date: Wed, 27 Feb 2002 21:28:07 +0100	[thread overview]
Message-ID: <jek7sypt48.fsf@sykes.suse.de> (raw)
In-Reply-To: <20020227214056.A6740@cyan.csp.org.by>
In-Reply-To: <20020227214056.A6740@cyan.csp.org.by> (Artiom Morozov's message of "Wed, 27 Feb 2002 21:40:56 +0200")

Artiom Morozov <artiom@phreaker.net> 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.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
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."

  parent reply	other threads:[~2002-02-27 20:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-27 19:40 select() call corrupts stack Artiom Morozov
2002-02-27 20:19 ` Brian Gerst
2002-02-27 20:28 ` Andreas Schwab [this message]
2002-02-27 21:08 ` Jakob Østergaard
2002-02-28 16:33 ` Byron Stanoszek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jek7sypt48.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=artiom@phreaker.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spk@csp.org.by \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox