From owner-svn-src-all@freebsd.org Fri Dec 16 22:45:41 2016 Return-Path: Delivered-To: svn-src-all@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 2CC13C835B2; Fri, 16 Dec 2016 22:45:41 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wj0-x244.google.com (mail-wj0-x244.google.com [IPv6:2a00:1450:400c:c01::244]) (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 B0B251DC3; Fri, 16 Dec 2016 22:45:40 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wj0-x244.google.com with SMTP id he10so16179241wjc.2; Fri, 16 Dec 2016 14:45:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OKBlclS2Tn/CIiqvAoKhxYZlj+EEHFw2+yxq4HgQo28=; b=FMPGMnOeURTrVr5aW/Lhz9SbydnPb53XIzW7V1CNAACNbrJ9JvgLi+LgCPt8dny74p HOieUggnbfQ6rX8LVFzMGTARHF+Tn4leYVM1TO9WF9V1VLcUWjRm9dbY24NVUhh62L51 inL6cb2LxhMMYz7mxlO5UxHPx5ctP24TuovX8CJHmwVhJ9aoUa2ypziBplI6J0PcqQgY 8/131+havVMewW+7iZTRDRJiGibdrxSiU7LCjFX8+NzDrnA0nBxt5gBaI8jreBf9QSwz +/A8ciJoYsYNPNkgbu6G5sdkXueoOX7QPeqtFmlrt9O4JOESoWXyUQ4HT1YMzVeoNd2+ P5DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OKBlclS2Tn/CIiqvAoKhxYZlj+EEHFw2+yxq4HgQo28=; b=ihUHNtsA3KAOmczNk7M86QPfakaztbZoLJIkbazhf9Y4Fgttjl+Rdsl6AUDBULFbhx goeGJ1pcTuNfe324yqU0LtI7Tp9KLA29se1DPQ6LIai4iBY+Y+Qce8wt40AiywsVGWn5 TuTCogkPsQTgWZvGcxUWbqjbhvOxZL4m1uvSy1+moSBVbnbO/wWBtLEFpOZ5Q6nuZOB8 CBNbxXwCf7y7frXUotG9HZM/jVXrJ4vmxAiRaNvJKxV9Xnc5GFgK2NR+zliOSjZTvGNY 0rFdvKvFU3d8d52MAnvZWM0KzmLNFrwA/N5TBzTkXsrxmQICon/a2yET3PNOrjvQqdGE DLxw== X-Gm-Message-State: AKaTC020mzzmYSmIEc3pQ10a3j1g6sCGYLsCYhMmCoJC2rJbTcVz7tDeXJcA4IYdr/2oWQ== X-Received: by 10.194.171.200 with SMTP id aw8mr4440711wjc.79.1481928338860; Fri, 16 Dec 2016 14:45:38 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id gk6sm8711236wjc.46.2016.12.16.14.45.37 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 16 Dec 2016 14:45:38 -0800 (PST) Date: Fri, 16 Dec 2016 23:45:35 +0100 From: Mateusz Guzik To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310180 - head/sys/net Message-ID: <20161216224535.GA6408@dft-labs.eu> References: <201612162239.uBGMdVSL027853@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201612162239.uBGMdVSL027853@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Dec 2016 22:45:41 -0000 On Fri, Dec 16, 2016 at 10:39:31PM +0000, Alan Somers wrote: > Author: asomers > Date: Fri Dec 16 22:39:30 2016 > New Revision: 310180 > URL: https://svnweb.freebsd.org/changeset/base/310180 > > Log: > Fix panic during lagg destruction with simultaneous status check > > If you run "ifconfig lagg0 destroy" and "ifconfig lagg0" at the same time a > page fault may result. The first process will destroy ifp->if_lagg in > lagg_clone_destroy (called by if_clone_destroy). Then the second process > will observe that ifp->if_lagg is NULL at the top of lagg_port_ioctl and > goto fallback: where it will promptly dereference ifp->if_lagg anyway. > > The solution is to repeat the NULL check for ifp->if_lagg > I don't understand how this solves the problem. What prevents the object from getting freed after the pointer got NULLified? That is, it seems the patch turns a null pointer deref into a use-after-free. There seems to be a refcounting issue here. That said, I only did cursory reading. -- Mateusz Guzik