From nobody Tue Jun 14 16:01:11 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EC494831BDC; Tue, 14 Jun 2022 16:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LMtTM64xJz4v12; Tue, 14 Jun 2022 16:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655222471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KegTVpoEUqOlkj2jU3Z6vwRqNNslzFS4FOBcljjGpjY=; b=dKL9vuKoIkAkCtCtVhp0C80yPKxBEEFnDwwvjIe30EMqQurOiWIiFgSkfE6VffeOrQ/dDL zdjvfgXffRV1j9015MGhM22yqIWJ4n07c+vsYT5kh5lrF21VFNK5LdtYqho0hSqStuBdSG M9Nxu3arUJrK1Q6ACMmrJIqPwNVa1JCmwV1mQXCbWjm3RUlgwmQuv9M6vWuEMWbLelriWD I1c6xZbZ47pQADl5jq7Nw4pLGxTyne3qImu8sl9aNh0gB3H0Ev7H1VlsJQEXOM0AlusPpM BV3AcoHupRKYTWS6vJ0ffSzuJ4mLT6IsHPetM8i0UOpYkuZ0oodIg6AhdWorjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A13E4568B; Tue, 14 Jun 2022 16:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25EG1BTX082577; Tue, 14 Jun 2022 16:01:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25EG1BkL082576; Tue, 14 Jun 2022 16:01:11 GMT (envelope-from git) Date: Tue, 14 Jun 2022 16:01:11 GMT Message-Id: <202206141601.25EG1BkL082576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a14465e1b9a5 - main - rip6: Fix a lock order reversal in rip6_bind() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a14465e1b9a53d6abf58f42e113c1888ffeebe42 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655222471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KegTVpoEUqOlkj2jU3Z6vwRqNNslzFS4FOBcljjGpjY=; b=D9Cs9/A5XeVAv0Qp7aCaf3wJMXNz7W5o5qNWmZt8IkqieT1/t6RllS0G4ma/SJFukEK61f RnpcyariUnBopQSOUJBuAQnkR4aASwVBRg5dq3QEeDQ0hJMb+Sy+cRdmXvVKqUFskLtjdH Pfa5AyToxJIpUQIlVMS9/s5btLBAoSnH7ngCFuexYVU9HEBTFEgqVaLRlizCV7sVeuPFRK 953yTcc225EB51D+0BiVazwuYN26d8YrpD/SEizy0toKhXXUz7l4je43U2PM8lb25WxjVe VFpSPgd+F5AXVYdxVDWVT4GihXA0X/i5femrnE+l82s5vwStgYaCTZKaSZ5qlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655222471; a=rsa-sha256; cv=none; b=al0jRtAREfzKs/FOdHZktC5FgZQaWfjC7pxl5g0XpU+RgYABHuP1W9rjt8j4j1dMGdHlb5 +ymnNtHRzB/x0Xd4gnMpyGzOHX1v13Vn/ZUrC0Kx8oCn4OZMg8X/0dryYxOYTXPEV/mp/Q cZLNUUwWHN8vFcnFMzqM20CoViYl53IlAsUmu66XmyAhtDLr3SzIjjKg/1gRQ/X/ToF9Rf dsM6PP9v5hj00js2v9HkXAcmyQVMBga34zl2B3ZONyLm/AnAp86B+OKqBWY7T3or9HpasO wewqsGoc2MLDiY/fxiyYWFOMK4icCWWNfVeg9dfBKnJ2tpXW7qGrX+wEBxkIZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a14465e1b9a53d6abf58f42e113c1888ffeebe42 commit a14465e1b9a53d6abf58f42e113c1888ffeebe42 Author: Mark Johnston AuthorDate: 2022-06-14 15:27:38 +0000 Commit: Mark Johnston CommitDate: 2022-06-14 16:00:59 +0000 rip6: Fix a lock order reversal in rip6_bind() See also commit 71a1539e3783. Reported by: syzbot+9b461b6a07a83cc10daa@syzkaller.appspotmail.com Reported by: syzbot+b6ce0aec16f5fdab3282@syzkaller.appspotmail.com Reviewed by: glebius MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35472 --- sys/netinet6/raw_ip6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 04137a8ed0a6..be7c57a52cfe 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -760,11 +760,11 @@ rip6_bind(struct socket *so, struct sockaddr *nam, struct thread *td) return (EADDRNOTAVAIL); } NET_EPOCH_EXIT(et); - INP_INFO_WLOCK(&V_ripcbinfo); INP_WLOCK(inp); + INP_INFO_WLOCK(&V_ripcbinfo); inp->in6p_laddr = addr->sin6_addr; - INP_WUNLOCK(inp); INP_INFO_WUNLOCK(&V_ripcbinfo); + INP_WUNLOCK(inp); return (0); }