From owner-freebsd-current@FreeBSD.ORG Fri Aug 1 11:45:56 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 283E6106567C; Fri, 1 Aug 2008 11:45:56 +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 D9A438FC13; Fri, 1 Aug 2008 11:45:55 +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 4C90B63365D; Fri, 1 Aug 2008 13:40:45 +0200 (CEST) Received: from baby-jane-lamaiziere-net.local (localhost [127.0.0.1]) by baby-jane.lamaiziere.net (Postfix) with ESMTP id BAB3157A7D1; Fri, 1 Aug 2008 13:45:53 +0200 (CEST) Date: Fri, 1 Aug 2008 13:45:52 +0200 From: Patrick =?ISO-8859-15?Q?Lamaizi=E8re?= To: current@freebsd.org Message-ID: <20080801134552.1a7930be@baby-jane-lamaiziere-net.local> In-Reply-To: <20080731174536.243579d1@baby-jane-lamaiziere-net.local> References: <20080722081449.GA3241@garage.freebsd.pl> <20080731123246.365d0b1f@baby-jane-lamaiziere-net.local> <20080731132136.GC4088@garage.freebsd.pl> <20080731174536.243579d1@baby-jane-lamaiziere-net.local> 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: Pawel Jakub Dawidek 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: Fri, 01 Aug 2008 11:45:56 -0000 Le Thu, 31 Jul 2008 17:45:36 +0200, Patrick Lamaizière a écrit : > Le Thu, 31 Jul 2008 15:21:36 +0200, > Pawel Jakub Dawidek a écrit : > > Hello, > > > > 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. > > > > Great catch! What do you think about using old sessid? I think it's > > ok to do so and a bit safer, because session ID is only 32bit long > > so we may get collision once we start from 0 again. Sorry but i forget this : Since the free sessions are at the head of the TAILQ, i suggest to use a TAILQ_FOREACH_REVERSE instead TAILQ_FOREACH in freession() and process() to skip the free sessions. Regards.