From owner-freebsd-security@FreeBSD.ORG Fri Mar 12 07:10:34 2004 Return-Path: Delivered-To: freebsd-security@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6564916A4CE; Fri, 12 Mar 2004 07:10:34 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2252143D2F; Fri, 12 Mar 2004 07:10:34 -0800 (PST) (envelope-from nectar@celabo.org) Received: from localhost (localhost [127.0.0.1]) by gw.celabo.org (Postfix) with ESMTP id AA8F754883; Fri, 12 Mar 2004 09:10:33 -0600 (CST) Received: from gw.celabo.org ([127.0.0.1]) by localhost (hellblazer.celabo.org [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 94285-09; Fri, 12 Mar 2004 09:10:23 -0600 (CST) Received: from lum.celabo.org (lum.celabo.org [10.0.1.107]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "lum.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id D0B5A54846; Fri, 12 Mar 2004 09:09:52 -0600 (CST) Received: by lum.celabo.org (Postfix, from userid 501) id 5794B162788; Fri, 12 Mar 2004 06:58:20 -0600 (CST) Date: Fri, 12 Mar 2004 06:58:20 -0600 From: "Jacques A. Vidrine" To: Marc Olzheim Message-ID: <20040312125820.GA8574@lum.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Marc Olzheim , Ruslan Ermilov , Morten Rodal , security@FreeBSD.org References: <200403120922.i2C9M0jC002510@stud326.idi.ntnu.no> <20040312104914.GA52099@ip.net.ua> <20040312105730.GA99925@stud326.idi.ntnu.no> <20040312110657.GB52099@ip.net.ua> <20040312111526.GA14260@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040312111526.GA14260@stack.nl> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: Morten Rodal cc: Ruslan Ermilov cc: security@FreeBSD.org Subject: Re: bin/64150: [PATCH] ls(1) coredumps when started via execve(2) with no argv. X-BeenThere: freebsd-security@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Security issues [members-only posting] List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2004 15:10:34 -0000 On Fri, Mar 12, 2004 at 12:15:26PM +0100, Marc Olzheim wrote: > On Fri, Mar 12, 2004 at 01:06:57PM +0200, Ruslan Ermilov wrote: > > And the fact that optind is initially set to 1. I wonder what > > could be the implications for setuid programs. There could be > > quite unpredictable results, as the "argv" pointer is incorrectly > > advanced in this case, and at least several setuid programs that > > I've glanced at are vulnerable to this attack. > > See also: http://www.freebsd.org/cgi/query-pr.cgi?pr=33738 Thanks Ruslan, Marc, I think kern/33738 is on the money. I do not see any immediate ramifications, but for peace of mind I believe that exec should fail if the argument array pointer is NULL. I believe this would be consistent with the relevant standards: POSIX already requires (a) that the first argument ``should point to a filename that is associated with the process being started'' and (b) ``the last member of this array is a null pointer''--- i.e. the array pointer cannot be NULL. Cheers, -- Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org