From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388036; b=t0mJTtggPo+Jrv5W+aRNaJRpQMzx7svPyCZK1oENYFJ0zX9wiGmsv5ARr7F4W42dmEbd FXH+6YFKWGnor/CKKGpR0cs1QxqvnYN65GeYqJvBdCMv1zsYdJNS2TNC36zRXeFxkPh64 anru0Gsg6FAEUnWkVUuaRRLrfp97xzXrJdOPsbgCvJ4TOYn+ryBbj/CoIpLkafZQrZ0o6 oXEf3utizqDDluW9BP+P7LL7oMtVYHkTpsGqOT67qLOS2xHcREWGLjq4m5cb5HxyXXktY WKTC/KB2Vb0Kyr6w4JjZC8Mtw5tso3crtiZiEOjBLlkRl+0zxW6dJyWXm+yxX2QcgXA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388036; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=DDGZpzgNOucyimmNG/DA1s20s2PCnhyUq1uA0Dfegds=; b=L27fulDMnQEq7O10E+tDfhINLqryWeCKj3JkBA2CusIKRCTNa8vHAlLlg/gnMCZ6t/Fn Z2NnF80tvkZdMAw3BFGIaVCzZgO8sgM6zP7qvoU8uKFU6U720F8ggcfPyURUhFHOilAi4 sggZAf4+pixYu8f3xhoMLrja+svxuCyw0/NZVSacbUG2lkKU9WbILB9/yHEOpirzIUDBb CrBwCkTBUs70IPH00LtRaq+aiausqz/3J17qDN19jeubnd+SkctsjJOQZaIMplc49Knjv ulMvXB4U4ZBibb3WSacu8BiZ2Ckm/46s9Nt1yUnV40bzf7AyITvjHenJO3mZtUIjCkw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FGNWhrky; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CC86606A322; Fri, 4 Dec 2026 12:40:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FGNWhrky Received: by smtp.kernel.org (Postfix) with ESMTPSA id C493F1F000C2; Fri, 4 Dec 2026 12:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388036; bh=DDGZpzgNOucyimmNG/DA1s20s2PCnhyUq1uA0Dfegds=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FGNWhrkyIcE4lKeIe9itcPZ3GTvxBW6NBGe7kgEgdtFT6FhfjYPu8bkIJFLeI48yd ExHwHh3MlZBqBixqYEk3ndI/mFtZ8Y4SSuossSLrPHsZF5QruuKKkHh/r62SPA99y/ dBsMai83pjNPw9yCuXqdcqC3y0w2m0Oh0P337MdE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, John Johansen , Sasha Levin Subject: [PATCH 6.1 0460/1059] apparmor: fix check SCTP bind, and connect permission checks Date: Fri, 4 Dec 2026 18:59:51 +0900 Message-ID: <20261204100656.190878987@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: John Johansen [ Upstream commit 7a82f9a06459ff1c37b5e97b204430442cc076e3 ] SCTP mediation of bind is not being checked correctly because bind permission needs to be checked in the sctp_bind_connect() hook. Require for bind permissions when CTP_SET_PEER_PRIMARY_ADDR, and SCTP_SOCKOPT_BINDX_ADD are asked for. The peer initialized ASCONF cases (SCTP_PARAM_ADD_IP and SCTP_PARAM_SET_PRIMARY) are processed in softirq context and are not mediated atm. SCTP_PRIMATEY_ADDR, and SCTP_SET_PEER_PRIMARY_ADDR only select among address already in the association. Fixes: 56974a6fcfef ("apparmor: add base infastructure for socket mediation") Signed-off-by: John Johansen Signed-off-by: Sasha Levin --- security/apparmor/lsm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 65d09c76a0670..325dd91e3f4df 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -920,6 +920,11 @@ static int apparmor_sctp_bind_connect(struct sock *sk, int optname, struct sockaddr *address, int addrlen) { switch (optname) { + /* Bind checks */ + case SCTP_SET_PEER_PRIMARY_ADDR: + case SCTP_SOCKOPT_BINDX_ADD: + return aa_sk_perm(OP_BIND, AA_MAY_BIND, sk); + /* Connect checks */ case SCTP_SOCKOPT_CONNECTX: case SCTP_SENDMSG_CONNECT: return aa_sk_perm(OP_CONNECT, AA_MAY_CONNECT, sk); -- 2.53.0