From owner-freebsd-net@freebsd.org Wed Jul 19 01:04:27 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 A1F66DA4644 for ; Wed, 19 Jul 2017 01:04:27 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 33DFA65596; Wed, 19 Jul 2017 01:04:27 +0000 (UTC) (envelope-from v.maffione@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id 200so668984wmv.1; Tue, 18 Jul 2017 18:04:27 -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=f04aYgh0L3C45RcXs8Awl1KKpao+Wirhc9xNTxX2U+g=; b=EpouG78cA11Dt663H/cZSKG+yfl9TZ9bk48pGueU4RZnar9u1VBbLmXqY4La2efrAf 53NzG9aA+9DSaKVgBXtgwfQBs/hzm42aSIGM0pK4eSh8O3IWf9hm+89bMyhMptXKUOSK 5i7XIZTmxvueJuoEMFIRFdRVyzLeSjolNleOj0xVTJ9jglHnPsrBg7r+EPHzADUFbcn7 vig0qcqH0fUJ7e7AHAlurWzuh+8p5xuZDN4ih4kXIwcof2V9o8NzC8BA9Lp2nZDp+J/4 ps3ckyqrqk1zWk0NPLXCaz5ZDFGaZ1+A1+zJBQGLNNB2wgfWRD+EmI//F+TDUO3XH6Na dUng== 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=f04aYgh0L3C45RcXs8Awl1KKpao+Wirhc9xNTxX2U+g=; b=Y6g7O5zSnO3Np90hPVelfC6QyFuKD5B/YA7fy1D7dp1mrsDg80w2K2jfaeUWptwhYc SetAXwzt8HrFHKBUhGgEWfsTI1AYFnGLAPdDh0pj8J0pmg2x+go435krBdVE22vQkHnb cVrGFbpmEHCN9E9CB63psLAtFaYkG4vbnVyihUdox3xqxsaccVzL1fp1hxPYznFInbHn zSFQqvs7aAcQH/u6H+/lR0MgmxKyVtptwaS8gOUKFZk69AaRjYdx6YVwicN/2okEwsSC eG4mS1FHax48Mpb6PvX9w6h0LYAlCC6o3nh2SRjfYIOAsBqGhCflmanTMkDZnJAuhBUj 033A== X-Gm-Message-State: AIVw112m6t0gTGj7qajtObvqytaZS7aU2GJymdunMDVj/HUWzcF2bp4u lwk3YJNTq3xejgZmkE2v7jEnjBYCzA== X-Received: by 10.28.134.11 with SMTP id i11mr3890470wmd.77.1500426264889; Tue, 18 Jul 2017 18:04:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.178.133 with HTTP; Tue, 18 Jul 2017 18:04:24 -0700 (PDT) In-Reply-To: References: <20170705110512.GA28058@alchemy.franken.de> <20170711200510.GB60651@alchemy.franken.de> From: Vincenzo Maffione Date: Tue, 18 Jul 2017 18:04:24 -0700 Message-ID: Subject: Re: NULL pointer dereference bug triggered by netmap To: Luiz Otavio O Souza Cc: Marius Strobl , hps@freebsd.org, ae@freebsd.org, FreeBSD Net , "Eggert, Lars" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: Wed, 19 Jul 2017 01:04:27 -0000 Hi, Looks good to me, although I'm not sure whether if_transmit should assert(mbuf == NULL). Couldn't we just drop the mbuf if we receive it? Thanks, Vincenzo 2017-07-18 10:43 GMT-07:00 Luiz Otavio O Souza : > On 12 July 2017 at 02:19, Vincenzo Maffione wrote: > > Yes. > > > > Actually, we would also need one beteween the following two options: > > 1) Implementing a dummy if_start() for if_loop.c > > 2) Prevent netmap from using if_loop. > > Hi, > > Please, check the attached patches. > > Luiz > > > > > 2017-07-11 22:05 GMT+02:00 Marius Strobl : > > > >> On Thu, Jul 06, 2017 at 02:19:42PM -0700, Vincenzo Maffione wrote: > >> > Sure, can anyone commit this? > >> > >> The addition of KASSERTs like the below one to if_handoff() and > >> if_start()? Sure. > >> > >> Marius > >> > >> > > >> > Il 5 lug 2017 4:05 AM, "Marius Strobl" ha > scritto: > >> > > >> > > 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(). > -- Vincenzo Maffione