From owner-freebsd-hackers Tue Sep 7 7:58:49 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from gatekeeper.tsc.tdk.com (gatekeeper.tsc.tdk.com [207.113.159.21]) by hub.freebsd.org (Postfix) with ESMTP id 774E915641; Tue, 7 Sep 1999 07:58:44 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from sunrise.gv.tsc.tdk.com (root@sunrise.gv.tsc.tdk.com [192.168.241.191]) by gatekeeper.tsc.tdk.com (8.8.8/8.8.8) with ESMTP id HAA20887; Tue, 7 Sep 1999 07:58:30 -0700 (PDT) (envelope-from gdonl@tsc.tdk.com) Received: from salsa.gv.tsc.tdk.com (salsa.gv.tsc.tdk.com [192.168.241.194]) by sunrise.gv.tsc.tdk.com (8.8.5/8.8.5) with ESMTP id HAA02575; Tue, 7 Sep 1999 07:58:29 -0700 (PDT) Received: (from gdonl@localhost) by salsa.gv.tsc.tdk.com (8.8.5/8.8.5) id HAA00426; Tue, 7 Sep 1999 07:58:28 -0700 (PDT) From: Don Lewis Message-Id: <199909071458.HAA00426@salsa.gv.tsc.tdk.com> Date: Tue, 7 Sep 1999 07:58:28 -0700 In-Reply-To: Matthew Dillon "Re: mbuf shortage situations" (Sep 5, 9:18pm) X-Mailer: Mail User's Shell (7.2.6 alpha(3) 7/19/95) To: Matthew Dillon , Bosko Milekic Subject: Re: mbuf shortage situations Cc: freebsd-hackers@FreeBSD.ORG, freebsd-security@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sep 5, 9:18pm, Matthew Dillon wrote: } Subject: Re: mbuf shortage situations } : The only reason that I see for which we would actually panic() in } :this situation (as opposed to suffer the packet loss) is if we get to the } :point where we're losing packets because some script kid starts up } :something that will eat up sockbuf space and continuously fork, then we } :would lose all remote access to the machine in question (since all packets } :would be dropped) and we wouldn't really mind a panic() for obvious } :practical reasons. Well, I really would mind the panic(). } : In any case, I, personally, would prefer to suffer packet loss as } :opposed to a panic (especially now that Brian is in the process of writing } :diffs that will allow us to limit socket buffer space per UID through } :login.conf!) } : Having MGET store that null (e.g. fail as opposed to panic) on a } :M_WAIT seems fairly easy to fix, and would probably require some patching } :that would ensure that the packet loss is handeled relatively 'cleanly' } :(probably some debugging), but I wouldn't mind doing this. However, I'd } :like to know if there are objections to doing this or, in fact, if there } :are any suggestions on how to handle mbuf shortage situations (aside from } :just limiting -- although limiting is in itself a good solution and I'm } :glad that Brian F. is working on that). At least historically most of the panics have been caused by the code not properly checking the result of the MGET and dereferencing a NULL pointer. Any of those that are still in the code need to be fixed. My impression is that for reasonably recent versions of FreeBSD this attack doesn't panic the machine but just wedges the network system due to mbuf exhaustion. The problem is that if you get to this point you're basically hosed. It's OK to toss packets that you receive from the net as long as you haven't sent an ack for them, toss outgoing UDP packets, and block writes to stream sockets, but you can't toss acked TCP packets that you've received, or the data queued to a stream socket by write(). This particular attack does the latter, so the only possible fix is to prevent all the mbufs from being consumed by it in the first place. } The issue is basically having someone find the time to figure out } how to gracefully unwind various pieces of network code when an } mbuf cannot be allocated. Once that is done, the panic can be } turned into a (rate-limited) printf. That won't help. All that does is keep a root spinning on a failed syscall instead of blocking on MGET when he's trying to log in to kill the errant process. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message