From owner-svn-src-all@FreeBSD.ORG Wed May 22 11:12:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EE5333B8; Wed, 22 May 2013 11:12:38 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) by mx1.freebsd.org (Postfix) with ESMTP id E0587E60; Wed, 22 May 2013 11:12:37 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id x53so1101531wes.19 for ; Wed, 22 May 2013 04:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=UIoPTVAGeJ617ITYxw54m9FvWnBAqEgnEc9P6JVymio=; b=SqzGTcgVYpASfmZcJajwkP7tgPrZpxSER/gcrgFHnG20wRh21hAAMdw3yD5JocqE7K 78Bj+OyDAxDvnVOA+04EzZznLjQjNBvjynLeKS1KoWhUUwXJiOB3kEWwsa6MwX6OjfPj DvHhigWLxz+r47t0wW2VJh/HTuphoWFQgeBJg/s6BafSLmFJPjeBHX8nkz89NvM0BVyR O9CyaEN+pTl2gU0dFKT9a1p5Asdi2C/JUa+hCU5OY2Tn3pPihv01PW3wN1uUqWz3Iuwu U2mgbJUqxGpmtdLl1oD7MQCEOZRPWh+e8eLi/L6y6yTw/eT9MU/fJdwRrLd+PWC8hYar 7bJQ== X-Received: by 10.180.105.161 with SMTP id gn1mr13816085wib.5.1369221156966; Wed, 22 May 2013 04:12:36 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id fz8sm28167989wib.2.2013.05.22.04.12.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 22 May 2013 04:12:35 -0700 (PDT) Date: Wed, 22 May 2013 13:12:32 +0200 From: Mateusz Guzik To: Gleb Smirnoff Subject: Re: svn commit: r250890 - head/sys/kern Message-ID: <20130522111232.GB11792@dft-labs.eu> References: <201305212158.r4LLw1Ed076595@svn.freebsd.org> <20130522092148.GM67170@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130522092148.GM67170@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, pjd@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 May 2013 11:12:39 -0000 On Wed, May 22, 2013 at 01:21:48PM +0400, Gleb Smirnoff wrote: > On Tue, May 21, 2013 at 09:58:01PM +0000, Mateusz Guzik wrote: > M> Author: mjg > M> Date: Tue May 21 21:58:00 2013 > M> New Revision: 250890 > M> URL: http://svnweb.freebsd.org/changeset/base/250890 > M> > M> Log: > M> passing fd over unix socket: fix a corner case where caller > M> wants to pass no descriptors. > M> > M> Previously the kernel would leak memory and try to free a potentially > M> arbitrary pointer. > M> > M> Reviewed by: pjd > > Is it possible to make code more strict: assert that fdcount > 0, and > do not perform any processing if number of fds is 0? > stable/9 returns with a non-zero length message in such cases and your patch changes it. Apparently with your patch we would get behaviour present in Linux. Whether it matters in practice I don't know. That being said I have no strong opinion either way. If you want, please go ahead and change this. -- Mateusz Guzik