From owner-freebsd-bugs@FreeBSD.ORG Mon Nov 29 12:00:38 2010 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 A617C1065675 for ; Mon, 29 Nov 2010 12:00:38 +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 6774C8FC1D for ; Mon, 29 Nov 2010 12:00:38 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oATC0cFj009409 for ; Mon, 29 Nov 2010 12:00:38 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oATC0cgE009394; Mon, 29 Nov 2010 12:00:38 GMT (envelope-from gnats) Resent-Date: Mon, 29 Nov 2010 12:00:38 GMT Resent-Message-Id: <201011291200.oATC0cgE009394@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, Aleksey Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CC491065670 for ; Mon, 29 Nov 2010 11:58:18 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF838FC08 for ; Mon, 29 Nov 2010 11:58:18 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id oATBwIhm091638 for ; Mon, 29 Nov 2010 11:58:18 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id oATBwI3M091637; Mon, 29 Nov 2010 11:58:18 GMT (envelope-from nobody) Message-Id: <201011291158.oATBwI3M091637@red.freebsd.org> Date: Mon, 29 Nov 2010 11:58:18 GMT From: Aleksey To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/152667: [ipfw][patch]: Change of result of a rule containing "not" after "skipto" 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: Mon, 29 Nov 2010 12:00:38 -0000 >Number: 152667 >Category: kern >Synopsis: [ipfw][patch]: Change of result of a rule containing "not" after "skipto" >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Nov 29 12:00:37 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Aleksey >Release: 8.1-RELEASE >Organization: MKC >Environment: FreeBSD nas2.test 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #1: Sat Nov 27 10:06:28 OMST 2010 root@nas2.test:/usr/obj/usr/src/sys/GW i386 >Description: In a rule of the following after "skipto" change the logic of the modifier "not" >How-To-Repeat: The elementary firewall allow only outgoing connections: ipfw add 310 check-state ipfw add 400 skipto 500 ip from not me to any ipfw add 410 allow ip from any to any keep-state ipfw add 500 deny all from any to any Allow all incoming connections if add: ipfw add 300 skipto 400 ip from not me to any >Fix: Patch attached with submission follows: --- /usr/src/sys/netinet/ipfw/ip_fw2.c.orig 2010-06-14 09:09:06.000000000 +0700 +++ /usr/src/sys/netinet/ipfw/ip_fw2.c 2010-11-29 15:53:28.000000000 +0600 @@ -2016,7 +2016,7 @@ f = chain->map[f_pos]; l = f->cmd_len; cmd = f->cmd; - match = 1; + if (!cmd->len & F_NOT) match = 1; cmdlen = 0; skip_or = 0; break; >Release-Note: >Audit-Trail: >Unformatted: