From owner-freebsd-bugs@FreeBSD.ORG Tue Feb 24 09:30:01 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EE4D106566C for ; Tue, 24 Feb 2009 09:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5EE9C8FC1B for ; Tue, 24 Feb 2009 09:30:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n1O9U1Bf014220 for ; Tue, 24 Feb 2009 09:30:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n1O9U1qn014219; Tue, 24 Feb 2009 09:30:01 GMT (envelope-from gnats) Resent-Date: Tue, 24 Feb 2009 09:30:01 GMT Resent-Message-Id: <200902240930.n1O9U1qn014219@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, david gueluy Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C73E9106568B for ; Tue, 24 Feb 2009 09:26:38 +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 B59488FC18 for ; Tue, 24 Feb 2009 09:26:38 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n1O9QcVu099524 for ; Tue, 24 Feb 2009 09:26:38 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n1O9QciE099523; Tue, 24 Feb 2009 09:26:38 GMT (envelope-from nobody) Message-Id: <200902240926.n1O9QciE099523@www.freebsd.org> Date: Tue, 24 Feb 2009 09:26:38 GMT From: david gueluy To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/132050: bad usage of the shutdown system call produce a packet with null ip addresses X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2009 09:30:02 -0000 >Number: 132050 >Category: kern >Synopsis: bad usage of the shutdown system call produce a packet with null ip addresses >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 24 09:30:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: david gueluy >Release: 7.1-PRERELEASE >Organization: netasq >Environment: /usr/obj/usr/src/sys/GENERIC i386 >Description: By using a PFIL_HOOK on FreeBSD 7.1-prerelease, I notice that I receive some packets from 0.0.0.0 to 0.0.0.0. A bugged software in userland produce these packets when the shutdown system call is used on a socket which is not connected. Even if it's a bad usage of a system call, this case can produce strange behaviours, I think it's necessary to add some checks in tcp_usr_shutdown. >How-To-Repeat: Just open a socket and call directly the shutdown function fd = socket(AF_INET, SOCK_STREAM, 0); shutdown(fd, SHUT_RDWR); close(fd); Add some debug in usr/src/sys/netinet/ip_output.c to dump outgoing packets ./test proto 6 src 0.0.0.0 dst 0.0.0.0 ttl 64 >Fix: >Release-Note: >Audit-Trail: >Unformatted: