From nobody Tue Apr 19 11:04:50 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 0FF9A11D212D; Tue, 19 Apr 2022 11:04:51 +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 4KjLYG71g0z3M10; Tue, 19 Apr 2022 11:04:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650366291; 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=OMGld0ALnt/TJ3Igvf+5uR8aemx4P/cm5EwWw7R5KoA=; b=AlcEzX0gVwvKB8EZbftq9NRMIA6KTAnEizoUJb53sN2pUVU82iL/XmGY/066kTwr9Hd4oa WrqK3J4KpXytdY3dwvuccUefQg7YtpBYIlc0c/bNn+fcmM3ZB7X1jZZExcWefMWDszBXX2 F3IeS92k0e6zL4+p814dW1zyWy9viCVQtDy3Sb/yH52y2fND8VK6jMmIURam/XaIFEmrvr VMmys3h6Nxj4dsqOBTNqnQDKI0q3ExrlCHAK7lgvJUjAmnCEtKlzhZ71iLVAu8DYMo8ySr 7JaPBusgOOsvWwZMMSPmfno+GyADiUT1ocQbjNpm9JKoGL5vMBScFv+7haUgSQ== 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 CCCF325FCF; Tue, 19 Apr 2022 11:04:50 +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 23JB4oo9094512; Tue, 19 Apr 2022 11:04:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23JB4oQh094511; Tue, 19 Apr 2022 11:04:50 GMT (envelope-from git) Date: Tue, 19 Apr 2022 11:04:50 GMT Message-Id: <202204191104.23JB4oQh094511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: a12d89332efe - main - sctp: hold the inp lock while calling ip6_output 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a12d89332efe0b02307c580a6f3025652374cd47 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650366291; 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=OMGld0ALnt/TJ3Igvf+5uR8aemx4P/cm5EwWw7R5KoA=; b=pgKq9YwMFaDKFQAJdAdNVC66EJHyKvrTXkPZB48z3zGXqJTn2W3QN5W/UqQyfJFHRGp28e Tx16wVpvsJKCdfMhkIerxk7kKMi97+8PTfxOaIgzLAzgn6o2tdbX1Axk0FqkMVw0VMERGH JFozw4NDm1Kd1hAZbFt8Y1lSdC/Dqob11PO3q6cnfULZ9+WuA3BWvJYOYDeWBo6qOmZV8q HznAIr6yUT+/mFvn5jBqshtlgWsUMMMFxf1M9piwA+k99oZBe210Cdzq0lrHjiLA3sF9wG 3sv9W9xfnLjY4az5qK8EdiUEPIfDohzNiGsDgcCNeqHUlgbhmrGfV+wXx6tvlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650366291; a=rsa-sha256; cv=none; b=O/K8IVnVC1f8NMov2r4Qe60/sWuqBCBl4HNouJBY/cQLNYtblS41DuFBQ4rC9DZq+ELWLn Vn8qGCbVEx2FHkQZuMSyU/4neXoebqBBj8Vh5t6KjGxnlIsZrCDQq+s1/9IKMvVeQYvNlC HArXFSA28TqObHszOPHlCDRPKrk7QoXaFLWvUWOkl9XGXTf6lLqML1JDxI/9i31hoxsXq3 rKJObP6wnYCrSd013//EYcQMDwLS0WiAJq9+3IXOJ0KACR460Ez14vSgM0KeSWbd2BVm++ dD4DkGONW1GjrdxDMEQKFZROsRb/w6ejrFHxSnL0vqmQMptrL0J7JjyurVCqGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a12d89332efe0b02307c580a6f3025652374cd47 commit a12d89332efe0b02307c580a6f3025652374cd47 Author: Michael Tuexen AuthorDate: 2022-04-19 11:03:08 +0000 Commit: Michael Tuexen CommitDate: 2022-04-19 11:03:08 +0000 sctp: hold the inp lock while calling ip6_output This fixes an issue with handling IPPROTO_IPV6 level socket options. Reported by: syzbot+66ede232c3d1271c6226@syzkaller.appspotmail.com MFC after: 3 days --- sys/netinet/sctp_os_bsd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h index e8d08588fbfb..faca8a3b6276 100644 --- a/sys/netinet/sctp_os_bsd.h +++ b/sys/netinet/sctp_os_bsd.h @@ -428,9 +428,11 @@ typedef struct route sctp_route_t; \ m_clrprotoflags(o_pak); \ if (local_inp != NULL) { \ + INP_RLOCK(&local_inp->ip_inp.inp); \ result = ip6_output(o_pak, \ local_inp->ip_inp.inp.in6p_outputopts, \ (ro), 0, 0, ifp, NULL); \ + INP_RUNLOCK(&local_inp->ip_inp.inp); \ } else { \ result = ip6_output(o_pak, NULL, (ro), 0, 0, ifp, NULL); \ } \