From owner-freebsd-current@FreeBSD.ORG Sat Feb 9 15:04:41 2013 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF5CCBC9 for ; Sat, 9 Feb 2013 15:04:41 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-la0-x230.google.com (la-in-x0230.1e100.net [IPv6:2a00:1450:4010:c03::230]) by mx1.freebsd.org (Postfix) with ESMTP id 650E4E3C for ; Sat, 9 Feb 2013 15:04:41 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id fq13so4689080lab.35 for ; Sat, 09 Feb 2013 07:04:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=jQJakDNWSINowQqLrKjuayiyOEwJXZWxp9+i82VVkTk=; b=I+rKZkCaGCNcHc+nxWllwkYmR1G/07dg+srgm01kINsfVhq6+JXMLt5C25U8S4mRfO vCYLxcREfr50RxACGwKGDuWylK153edwyZR0Neke8uZmudZMJ/tX0u8ZZaaJTw5fU7ww 0Hfdc0bzWkmhLsirsddkRpxb4rbzoTszd/2lFchPWBbj11WQBRyr60jkYh0koby9O0hh zFZ0S0sUGrZIx05rkjmaUKqjeaGMgA38djNlpOQ4Ol7qDBjh3VM1y5XV2Ck6TPEpSGy2 Auei+sSqKmVZ47evMAB1MuDKZVu+dPF2LqaAYZ/YREAJdbIG9pOFhA0p+VyguQFkzDw6 zJqw== X-Received: by 10.152.46.131 with SMTP id v3mr5385962lam.57.1360422279946; Sat, 09 Feb 2013 07:04:39 -0800 (PST) Received: from zont-osx.local (ppp95-165-158-215.pppoe.spdop.ru. [95.165.158.215]) by mx.google.com with ESMTPS id ns7sm18623581lab.5.2013.02.09.07.04.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Feb 2013 07:04:38 -0800 (PST) Sender: Andrey Zonov Message-ID: <51166580.4080603@FreeBSD.org> Date: Sat, 09 Feb 2013 19:04:32 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Fabian Keil Subject: Re: geli(8) breaks after a couple hours of uptime References: <20130207141833.GA15884@acme.spoerlein.net> <20130207153322.5c371beb@fabiankeil.de> <20130207180153.GX35868@acme.spoerlein.net> <20130208095709.6ae61cff@fabiankeil.de> <20130208114825.GY35868@acme.spoerlein.net> <5114F390.4010302@FreeBSD.org> <20130209140733.0b753c60@fabiankeil.de> In-Reply-To: <20130209140733.0b753c60@fabiankeil.de> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2JIFTPCALEFSATLEMVGHW" X-Gm-Message-State: ALoCoQk0aslsp1p4vyxkX7wnrPbZQHfy9lmne+FbMinArIQx296+8ZQcoVXT7cHbuYVwrKuviKgh Cc: Eitan Adler , current@freebsd.org, Andriy Gapon X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 09 Feb 2013 15:04:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2JIFTPCALEFSATLEMVGHW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2/9/13 5:07 PM, Fabian Keil wrote: >=20 > This would at least prevent the segfault. >=20 I see two possibilities to get segfault: - no checking for result from memory allocation functions - too big stack I have no found any broken memory allocation checking, but I found two big objects on the stack. One is buf[MAXPHYS] in eli_genkey_files() and another is passbuf[MAXPHYS] in eli_genkey_passphrase(). If we change these two to malloc(), then we can handle error from malloc(), print some useful message and prevent segfault. --=20 Andrey Zonov ------enig2JIFTPCALEFSATLEMVGHW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJRFmWEAAoJEBWLemxX/CvTqykIAKS9djh3rFeDUNCHiOZNh9g/ Qfvmb62qYujYIO1dTdgsTi1zG7x56TftEV8rXktKcoVTWyNUEZ1BlmiBtv8YWJEW HFVCBBISzSgxtJw5j4c5CqwcE0IgJjSMLO7I61jJ46BcOtgc8VJsSieKVQnhYnEe 3CTGHK277UuwrGHvBirTMHpE49j14bu0cnPPROUFbxhhQSjWi+LFG5LzTbV8OJzY CtWd15xw/6dNLZKaltwxZH45vwNim/vNqilTG20R2cCwid7VpzhkiUuqAsxFXdA9 eSIm3uCgBJtDLCuNdkN8SclxkStSmbT0mfYD+FGKMO5+GrF56I13NFtYn/MJhiM= =C4e8 -----END PGP SIGNATURE----- ------enig2JIFTPCALEFSATLEMVGHW--