From owner-freebsd-current@FreeBSD.ORG Thu Jul 31 10:32:50 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B0E51065674; Thu, 31 Jul 2008 10:32:50 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [91.121.44.19]) by mx1.freebsd.org (Postfix) with ESMTP id E4B778FC13; Thu, 31 Jul 2008 10:32:49 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from baby-jane.lamaiziere.net (106.6.192-77.rev.gaoland.net [77.192.6.106]) by smtp.lamaiziere.net (Postfix) with ESMTPA id 18D2063365B; Thu, 31 Jul 2008 12:27:52 +0200 (CEST) Received: from baby-jane-lamaiziere-net.local (localhost [127.0.0.1]) by baby-jane.lamaiziere.net (Postfix) with ESMTP id C5DE35789FA; Thu, 31 Jul 2008 12:32:47 +0200 (CEST) Date: Thu, 31 Jul 2008 12:32:46 +0200 From: Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= To: Pawel Jakub Dawidek Message-ID: <20080731123246.365d0b1f@baby-jane-lamaiziere-net.local> In-Reply-To: <20080722081449.GA3241@garage.freebsd.pl> References: <20080722081449.GA3241@garage.freebsd.pl> Organization: /dave/nulle X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; i386-apple-darwin9.3.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Cc: current@freebsd.org Subject: Re: Recent Padlock changes break ssh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2008 10:32:50 -0000 Le Tue, 22 Jul 2008 10:14:49 +0200, Pawel Jakub Dawidek a écrit : Hello, > Could you try this patch? Those are the only changes that could > eventually change the behaviour. > > http://people.freebsd.org/~pjd/patches/padlock.c.patch > I think that one problem is that the session id (ses->ses_id) is not updated when a free session is reused. The session id is set to zero by bzero() in padlock_freesession(). So we can have several active sessions with the same ses->ses_id == 0 if the sessions are reused. padlock_freession() padlock_hash_free(ses); bzero(ses, sizeof(*ses)); ses->ses_used = 0; TAILQ_INSERT_HEAD(&sc->sc_sessions, ses, ses_next); and in padlock_newsession() /* * Free sessions goes first, so if first session is used, we need to * allocate one. */ ses = TAILQ_FIRST(&sc->sc_sessions); if (ses == NULL || ses->ses_used) ses = NULL; else { TAILQ_REMOVE(&sc->sc_sessions, ses, ses_next); ses->ses_used = 1; + ses->ses_id = sc->sc_sid++; TAILQ_INSERT_TAIL(&sc->sc_sessions, ses, ses_next); } Regards.