Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jun 2022 13:02:39 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 14f7dd4744e4 - stable/13 - rip6: Fix a lock order reversal in rip6_bind()
Message-ID:  <202206211302.25LD2dKT073644@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=14f7dd4744e4ff0e4447fb6b07aea24dbfbda31c

commit 14f7dd4744e4ff0e4447fb6b07aea24dbfbda31c
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-06-14 15:27:38 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-06-21 12:53:34 +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
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit a14465e1b9a53d6abf58f42e113c1888ffeebe42)
---
 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 aaba91c6d5e7..445912c965ba 100644
--- a/sys/netinet6/raw_ip6.c
+++ b/sys/netinet6/raw_ip6.c
@@ -791,11 +791,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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202206211302.25LD2dKT073644>