From nobody@FreeBSD.org  Fri May  2 14:23:05 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A645106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  2 May 2008 14:23:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id F39778FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  2 May 2008 14:23:04 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m42EMKmo055060
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 2 May 2008 14:22:20 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m42EMK6k055059;
	Fri, 2 May 2008 14:22:20 GMT
	(envelope-from nobody)
Message-Id: <200805021422.m42EMK6k055059@www.freebsd.org>
Date: Fri, 2 May 2008 14:22:20 GMT
From: Shelby Cain <scain@exgenesis.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Enabling samba wins in nsswitch.conf causes sshd, ftpd, etc services to die
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         123330
>Category:       conf
>Synopsis:       [nsswitch.conf] Enabling samba wins in nsswitch.conf causes sshd, ftpd, etc services to die
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 02 14:30:02 UTC 2008
>Closed-Date:    
>Last-Modified:  Mon Dec 01 10:22:45 UTC 2008
>Originator:     Shelby Cain
>Release:        7.0-REL
>Organization:
>Environment:
FreeBSD freebsdlol.localdomain 7.0-RELEASE FreeBSD 7.0-RELEASE #1: Mon Apr 14 17:59:26 CDT 2008     root@freebsdlol.localdomain:/usr/obj/usr/src/sys/MYKERN  i386
>Description:
Background:  I have a mixed home network of Windows, Linux and (now) FreeBSD.  In order to facilitate easy communication between the systems I install Samaba and enable wins resolution in nsswitch.conf on all non-windows boxes so that netbios name resolution can occur.

Problem:  Once I've added "hosts: files dns wins" to my nsswitch.conf on FreeBSD any system service that appears to rely on name resolution will segfault when it attempts to handle incoming connections.

I realize that netbios name resolution functionality probably isn't a super high priority but causing a denial of service by enabling something that should work without issue strikes me as a serious bug so I marked it as such.  I also tried getting a backtrace from one of the ftpd.core files and gdb listed thousands of stack frames which I assume means some form of stack corruption has occurred.

>How-To-Repeat:
1) Install FreeBSD 7.0-i386.
2) Enable various network services such as sshd and ftpd.
3) Establish ssh session to the server.
4) Build and install Samba3 from ports.
5) Change hosts line in /etc/nsswitch.conf to read "hosts: files dns wins"
6) Verify that you can resolve windows netbios names via a tool like ping.  Do not close your existing ssh session at this point as you'll be unable to log back in!
7) Attempt to create a new ssh or ftp session.  The attempt will fail and a message about the (I assume forked) process being terminated with signal 11 will be logged in /var/log/messages.  This will continue for as long as "wins" is left in /etc/nsswitch.conf.
8) Removing the "wins" entry will restore normal behavior.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri May 2 20:55:46 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123330 

From: <julian@precisium.com>
To: <bug-followup@FreeBSD.org>, <scain@exgenesis.com>
Subject: Re: conf/123330: [nsswitch.conf] Enabling samba wins in nsswitch.conf causes sshd, ftpd, etc services to die
Date: Sun, 30 Nov 2008 05:25:27 -0000

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_055B_01C952AC.0DBCCF60
 Content-Type: text/plain;
 	charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 
 This problem still occurs in 7.1-BETA2.
 
 e.g
 'netstat -ap tcp'   dies saying "segmentation fault" when the wins entry =
 is in place.  (netstat -anp tcp  works ok)
 
 This stops the system from being used as a samba server whilst also =
 using centralized wins for netbios name resolution.
 
 ------=_NextPart_000_055B_01C952AC.0DBCCF60--

>Unformatted:
