From owner-freebsd-bugs@freebsd.org Wed Jan 24 23:21:39 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3385DECC42F for ; Wed, 24 Jan 2018 23:21:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2B657D5EF for ; Wed, 24 Jan 2018 23:21:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 1F6731E7AE for ; Wed, 24 Jan 2018 23:21:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w0ONLbvJ017252 for ; Wed, 24 Jan 2018 23:21:37 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w0ONLbCV017251 for freebsd-bugs@FreeBSD.org; Wed, 24 Jan 2018 23:21:37 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 225438] panic in6_unlink_ifa() due to race Date: Wed, 24 Jan 2018 23:21:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: daveb@spectralogic.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 23:21:39 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225438 --- Comment #1 from Dave Baukus --- Patching in6_unlink_ifa() with something like below only pushes the the cra= sh to a double free in in6_leavegroup(): #11 0xffffffff804bf103 in panic (fmt=3D)=20 #12 0xffffffff8073765e in uma_dbg_free (zone=3D0xfffff81b7ffce000, ...) #13 0xffffffff807370d4 in uma_zfree_arg (zone=3D0xfffff81b7ffce000, ...) #14 0xffffffff8049a91b in free (addr=3D0xfffff801eb278c20, mtp=3D0xffffffff80b5a980) #15 0xffffffff80684b6f in in6_leavegroup (imm=3D0xfffff801eb278c20)=20 #16 0xffffffff8067e83b in in6_purgeaddr (ifa=3D0xfffff8015b270600)=20 #17 0xffffffff8067c355 in in6_control () % diff -du in6.c.orig in6.c --- in6.c.orig 2018-01-24 16:15:52.742977158 -0700 +++ in6.c 2018-01-24 16:17:29.140814668 -0700 @@ -1288,8 +1288,16 @@ int remove_lle; IF_ADDR_WLOCK(ifp); - TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family =3D=3D AF_INET6 && + (struct in6_ifaddr *)ifa =3D=3D ia) { + TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_li= nk); + break; + } + } IF_ADDR_WUNLOCK(ifp); + if (ifa =3D=3D NULL) + return; ifa_free(&ia->ia_ifa); /* if_addrhead */ --=20 You are receiving this mail because: You are the assignee for the bug.=