From owner-freebsd-net@freebsd.org Fri Jul 7 01:47:09 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D562D96BF4 for ; Fri, 7 Jul 2017 01:47:09 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: from mail-wr0-x22d.google.com (mail-wr0-x22d.google.com [IPv6:2a00:1450:400c:c0c::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39F4D256C; Fri, 7 Jul 2017 01:47:09 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: by mail-wr0-x22d.google.com with SMTP id k67so26148586wrc.2; Thu, 06 Jul 2017 18:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fgJr87hGIj6tpXNTmuShftXcx0/ZZcYB5esTKtoJ+I4=; b=GS9WItO+sjouiMsw5pmgA9TxYhA+dQIuz94sleuL1zJ6SsNccAq8bYKpflLvbXZ+U2 eXROCtNqTKdz0bk5dDR+36+K0/rNl8ITWTdOQGyBdTQswR6w2E0XVcyclRcc/tOmJVGz sRsf9dQ8ibamX6CsxJwENs2uYDMYH/kU+b4/C6s40DayJ5WbP6bileCxcUU48MKinrt1 azZkonJ0wuvhc/GzQs/eQBKVOVcSXN0xvEs0xopdSmAj6hei4VITihneSTUsltFWQK2u z2T0RVvsII1Kk8QJ6KHRXy51XNXGjRdpWX4AOMkXMo8JXQMAd70HHssUwiviScrnBF/2 Q6jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fgJr87hGIj6tpXNTmuShftXcx0/ZZcYB5esTKtoJ+I4=; b=h2dGjMb27D5XV18QvaFMJAOoW1/MvdYLAQM2XEQAMdqxqjVnvIoawcxDw9FZbtolm3 S7EFOyWpVjDArJqspYu7GoGkr8+3CxkZ6h2CXaKPU2OxWv9vTJ0FYnnC3ScJM/9GKh0B 7A5WF7GsW2w8IcvZjOivcSzi3ohQ+oYVsTd+kq3P3q6GxPzMCk/FYIRqsS/MeqVh/EhP i1k7md+ye+02AlbNo6uok7pq9gc5QIEGRnB2kJZZ3WlxlRWAA0ChQUsTOVSzWzQ+4x/8 lVtlne7YJaBNFdOFjw7avLcDDfcuAp1VUXXpGFBmd7UT2qQMSwMkVOH3UrTARIiFzW0T +U4A== X-Gm-Message-State: AIVw111XoUnRyXqAtr69trw1y53HPZKx6JkXEXDXYS9vWXpdEsQB/2wf WRV62F6D/pk50EcPzbWNg+NcoaIJWv7p X-Received: by 10.80.215.30 with SMTP id t30mr490977edi.19.1499392026393; Thu, 06 Jul 2017 18:47:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.137.173 with HTTP; Thu, 6 Jul 2017 18:47:05 -0700 (PDT) In-Reply-To: <20170705110512.GA28058@alchemy.franken.de> References: <20170705110512.GA28058@alchemy.franken.de> From: Luiz Otavio O Souza Date: Thu, 6 Jul 2017 22:47:05 -0300 Message-ID: Subject: Re: NULL pointer dereference bug triggered by netmap To: Marius Strobl Cc: Vincenzo Maffione , FreeBSD Net Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jul 2017 01:47:09 -0000 On 5 July 2017 at 08:05, Marius Strobl wrote: > On Mon, Jul 03, 2017 at 05:08:09PM +0200, Vincenzo Maffione wrote: >> Details here: >> >> https://github.com/luigirizzo/netmap/issues/322 >> >> Is it acceptable to commit the proposed patch? > > As suggested by hselasky@, the outliner problem at hand is better solved > by a dummy if_start method in order to not hurt the fast-path. Thus, if > anything at all, a KASSERT(ifp->if_start != NULL, "no if_start method") > should be added to if_handoff() and if_start(). As noted by ae@, if_transmit() is not supported on the loopback interface. In any case, the loopback interface could provide a dummy if_transmit() method to not queue the packets, not call if_start() and print a warning/panic. Luiz