From pst@Shockwave.COM  Thu Feb  6 13:25:01 1997
Received: from precipice.shockwave.com (ppp-206-170-5-34.rdcy01.pacbell.net [206.170.5.34])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id NAA06448
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 6 Feb 1997 13:24:53 -0800 (PST)
Received: (from pst@localhost) by precipice.shockwave.com (8.8.4/8.7.3) id NAA01371; Thu, 6 Feb 1997 13:24:44 -0800 (PST)
Message-Id: <199702062124.NAA01371@precipice.shockwave.com>
Date: Thu, 6 Feb 1997 13:24:44 -0800 (PST)
From: Paul Traina <pst@Shockwave.COM>
Reply-To: pst@Shockwave.COM
To: FreeBSD-gnats-submit@freebsd.org
Subject: bind of a local domain socket does not respect umask
X-Send-Pr-Version: 3.2

>Number:         2680
>Category:       kern
>Synopsis:       bind of a local domain socket does not respect umask
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    wollman
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb  6 13:30:02 PST 1997
>Closed-Date:    Fri Aug 15 06:54:11 PDT 1997
>Last-Modified:  Fri Aug 15 06:56:20 PDT 1997
>Originator:     Paul Traina
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

FreeBSD -current and 2.x

>Description:

	Unix domain sockets are always created with mode ACCESSPERMS.
	This is incorrect, they should be created with ACCESSPERMS & umask.

	This is a critical flaw, because there is no way to avoid a
	race condition even if you immediately chmod() the socket after
	creation.


>How-To-Repeat:

	umask(022);
	bind to a domain socket

	ls -l path

>Fix:

	In uipc_usrreq.c, vattr.va_mode is set to ACCESSPERMS.
	It should be set to ACCESSPERMS & current umask if the uap is
	available (is it always available at this point?)
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bde 
Responsible-Changed-By: pst 
Responsible-Changed-When: Fri Feb 14 10:06:25 PST 1997 
Responsible-Changed-Why:  
Bruce (or David or John) know their way around this bit of code much better 
than I do. 

From: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To: pst@Shockwave.COM
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: kern/2680: bind of a local domain socket does not respect umask
Date: Mon, 7 Apr 1997 20:17:34 -0400 (EDT)

 <<On Thu, 6 Feb 1997 13:24:44 -0800 (PST), Paul Traina <pst@Shockwave.COM> said:
 
 >> Synopsis:       bind of a local domain socket does not respect umask
 
 I have the (trivial) fix for this, but I'm waiting to get a chance to
 rebuild my tree... it's tied up with a lot of other changes I had
 hoped to get to last Sunday.  With luck, I should fix this in -current
 fairly soon.
 
 -GAWollman
 

From: Paul Traina <pst@shockwave.com>
To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/2680: bind of a local domain socket does not respect umask 
Date: Tue, 08 Apr 1997 14:32:48 -0700

 This is kinda a security thing, 2.2 would be a good idea.
 
   From: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
   Subject: kern/2680: bind of a local domain socket does not respect umask
   <<On Thu, 6 Feb 1997 13:24:44 -0800 (PST), Paul Traina <pst@Shockwave.COM> sa
 >>id:
   
   >> Synopsis:       bind of a local domain socket does not respect umask
   
   I have the (trivial) fix for this, but I'm waiting to get a chance to
   rebuild my tree... it's tied up with a lot of other changes I had
   hoped to get to last Sunday.  With luck, I should fix this in -current
   fairly soon.
   
   -GAWollman
   
State-Changed-From-To: open->closed 
State-Changed-By: wollman 
State-Changed-When: Fri Aug 15 06:54:11 PDT 1997 
State-Changed-Why:  
Fixed in -current by rev 1.23 and in 2.2 by rev 1.15.4.2. 


Responsible-Changed-From-To: bde->wollman 
Responsible-Changed-By: wollman 
Responsible-Changed-When: Fri Aug 15 06:54:11 PDT 1997 
Responsible-Changed-Why:  
I fixed it. 
>Unformatted:
