€•~ÖŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ!/translations/zh_CN/security/SCTP”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ!/translations/zh_TW/security/SCTP”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ!/translations/it_IT/security/SCTP”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ!/translations/ja_JP/security/SCTP”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ!/translations/ko_KR/security/SCTP”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ!/translations/pt_BR/security/SCTP”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ!/translations/sp_SP/security/SCTP”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ;/var/lib/git/docbuild/linux/Documentation/security/SCTP.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒSCTP”h]”hŒSCTP”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒSCTP LSM Support”h]”hŒSCTP LSM Support”…”�”}”(hhàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÝh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒSecurity Hooks”h]”hŒSecurity Hooks”…”�”}”(hhñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhîh²hh³hÇh´K ubhŒ paragraph”“”)�”}”(hŒNFor security module support, three SCTP specific hooks have been implemented::”h]”hŒMFor security module support, three SCTP specific hooks have been implemented:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´K hhîh²hubhŒ literal_block”“”)�”}”(hŒusecurity_sctp_assoc_request() security_sctp_bind_connect() security_sctp_sk_clone() security_sctp_assoc_established()”h]”hŒusecurity_sctp_assoc_request() security_sctp_bind_connect() security_sctp_sk_clone() security_sctp_assoc_established()”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Khhîh²hubj)�”}”(hŒ~The usage of these hooks are described below with the SELinux implementation described in the `SCTP SELinux Support`_ chapter.”h]”(hŒ^The usage of these hooks are described below with the SELinux implementation described in the ”…”�”}”(hjh²hh³Nh´NubhŒ reference”“”)�”}”(hŒ`SCTP SELinux Support`_”h]”hŒSCTP SELinux Support”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”ŒSCTP SELinux Support”Œrefid”Œsctp-selinux-support”uh1j'hjŒresolved”KubhŒ chapter.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´Khhîh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒsecurity_sctp_assoc_request()”h]”hŒsecurity_sctp_assoc_request()”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjFh²hh³hÇh´Kubj)�”}”(hŒŠPasses the ``@asoc`` and ``@chunk->skb`` of the association INIT packet to the security module. Returns 0 on success, error on failure. ::”h]”(hŒ Passes the ”…”�”}”(hjWh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ ``@asoc``”h]”hŒ@asoc”…”�”}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjWubhŒ and ”…”�”}”(hjWh²hh³Nh´Nubj`)�”}”(hŒ``@chunk->skb``”h]”hŒ @chunk->skb”…”�”}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjWubhŒ_ of the association INIT packet to the security module. Returns 0 on success, error on failure.”…”�”}”(hjWh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KhjFh²hubj)�”}”(hŒ^@asoc - pointer to sctp association structure. @skb - pointer to skbuff of association packet.”h]”hŒ^@asoc - pointer to sctp association structure. @skb - pointer to skbuff of association packet.”…”�”}”hj‹sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KhjFh²hubeh}”(h]”Œsecurity-sctp-assoc-request”ah ]”h"]”h$]”Œsecurity_sctp_assoc_request()”ah&]”uh1hÈhhîh²hh³hÇh´KŒ referenced”KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒsecurity_sctp_bind_connect()”h]”hŒsecurity_sctp_bind_connect()”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¢h²hh³hÇh´K#ubj)�”}”(hŒõPasses one or more ipv4/ipv6 addresses to the security module for validation based on the ``@optname`` that will result in either a bind or connect service as shown in the permission check tables below. Returns 0 on success, error on failure. ::”h]”(hŒZPasses one or more ipv4/ipv6 addresses to the security module for validation based on the ”…”�”}”(hj³h²hh³Nh´Nubj`)�”}”(hŒ ``@optname``”h]”hŒ@optname”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hj³ubhŒŒ that will result in either a bind or connect service as shown in the permission check tables below. Returns 0 on success, error on failure.”…”�”}”(hj³h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´K$hj¢h²hubj)�”}”(hX± @sk - Pointer to sock structure. @optname - Name of the option to validate. @address - One or more ipv4 / ipv6 addresses. @addrlen - The total length of address(s). This is calculated on each ipv4 or ipv6 address using sizeof(struct sockaddr_in) or sizeof(struct sockaddr_in6). ------------------------------------------------------------------ | BIND Type Checks | | @optname | @address contains | |----------------------------|-----------------------------------| | SCTP_SOCKOPT_BINDX_ADD | One or more ipv4 / ipv6 addresses | | SCTP_PRIMARY_ADDR | Single ipv4 or ipv6 address | | SCTP_SET_PEER_PRIMARY_ADDR | Single ipv4 or ipv6 address | ------------------------------------------------------------------ ------------------------------------------------------------------ | CONNECT Type Checks | | @optname | @address contains | |----------------------------|-----------------------------------| | SCTP_SOCKOPT_CONNECTX | One or more ipv4 / ipv6 addresses | | SCTP_PARAM_ADD_IP | One or more ipv4 / ipv6 addresses | | SCTP_SENDMSG_CONNECT | Single ipv4 or ipv6 address | | SCTP_PARAM_SET_PRIMARY | Single ipv4 or ipv6 address | ------------------------------------------------------------------”h]”hX± @sk - Pointer to sock structure. @optname - Name of the option to validate. @address - One or more ipv4 / ipv6 addresses. @addrlen - The total length of address(s). This is calculated on each ipv4 or ipv6 address using sizeof(struct sockaddr_in) or sizeof(struct sockaddr_in6). ------------------------------------------------------------------ | BIND Type Checks | | @optname | @address contains | |----------------------------|-----------------------------------| | SCTP_SOCKOPT_BINDX_ADD | One or more ipv4 / ipv6 addresses | | SCTP_PRIMARY_ADDR | Single ipv4 or ipv6 address | | SCTP_SET_PEER_PRIMARY_ADDR | Single ipv4 or ipv6 address | ------------------------------------------------------------------ ------------------------------------------------------------------ | CONNECT Type Checks | | @optname | @address contains | |----------------------------|-----------------------------------| | SCTP_SOCKOPT_CONNECTX | One or more ipv4 / ipv6 addresses | | SCTP_PARAM_ADD_IP | One or more ipv4 / ipv6 addresses | | SCTP_SENDMSG_CONNECT | Single ipv4 or ipv6 address | | SCTP_PARAM_SET_PRIMARY | Single ipv4 or ipv6 address | ------------------------------------------------------------------”…”�”}”hjÓsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K*hj¢h²hubj)�”}”(hŒ5A summary of the ``@optname`` entries is as follows::”h]”(hŒA summary of the ”…”�”}”(hjáh²hh³Nh´Nubj`)�”}”(hŒ ``@optname``”h]”hŒ@optname”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjáubhŒ entries is as follows:”…”�”}”(hjáh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KDhj¢h²hubj)�”}”(hX SCTP_SOCKOPT_BINDX_ADD - Allows additional bind addresses to be associated after (optionally) calling bind(3). sctp_bindx(3) adds a set of bind addresses on a socket. SCTP_SOCKOPT_CONNECTX - Allows the allocation of multiple addresses for reaching a peer (multi-homed). sctp_connectx(3) initiates a connection on an SCTP socket using multiple destination addresses. SCTP_SENDMSG_CONNECT - Initiate a connection that is generated by a sendmsg(2) or sctp_sendmsg(3) on a new association. SCTP_PRIMARY_ADDR - Set local primary address. SCTP_SET_PEER_PRIMARY_ADDR - Request peer sets address as association primary. SCTP_PARAM_ADD_IP - These are used when Dynamic Address SCTP_PARAM_SET_PRIMARY - Reconfiguration is enabled as explained below.”h]”hX SCTP_SOCKOPT_BINDX_ADD - Allows additional bind addresses to be associated after (optionally) calling bind(3). sctp_bindx(3) adds a set of bind addresses on a socket. SCTP_SOCKOPT_CONNECTX - Allows the allocation of multiple addresses for reaching a peer (multi-homed). sctp_connectx(3) initiates a connection on an SCTP socket using multiple destination addresses. SCTP_SENDMSG_CONNECT - Initiate a connection that is generated by a sendmsg(2) or sctp_sendmsg(3) on a new association. SCTP_PRIMARY_ADDR - Set local primary address. SCTP_SET_PEER_PRIMARY_ADDR - Request peer sets address as association primary. SCTP_PARAM_ADD_IP - These are used when Dynamic Address SCTP_PARAM_SET_PRIMARY - Reconfiguration is enabled as explained below.”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KFhj¢h²hubj)�”}”(hŒ“To support Dynamic Address Reconfiguration the following parameters must be enabled on both endpoints (or use the appropriate **setsockopt**\(2))::”h]”(hŒ~To support Dynamic Address Reconfiguration the following parameters must be enabled on both endpoints (or use the appropriate ”…”�”}”(hjh²hh³Nh´NubhŒstrong”“”)�”}”(hŒ**setsockopt**”h]”hŒ setsockopt”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubhŒ(2)):”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´K_hj¢h²hubj)�”}”(hŒF/proc/sys/net/sctp/addip_enable /proc/sys/net/sctp/addip_noauth_enable”h]”hŒF/proc/sys/net/sctp/addip_enable /proc/sys/net/sctp/addip_noauth_enable”…”�”}”hj1sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Kbhj¢h²hubj)�”}”(hŒzthen the following *_PARAM_*'s are sent to the peer in an ASCONF chunk when the corresponding ``@optname``'s are present::”h]”(hŒthen the following ”…”�”}”(hj?h²hh³Nh´NubhŒemphasis”“”)�”}”(hŒ *_PARAM_*”h]”hŒ_PARAM_”…”�”}”(hjIh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jGhj?ubhŒD’s are sent to the peer in an ASCONF chunk when the corresponding ”…”�”}”(hj?h²hh³Nh´Nubj`)�”}”(hŒ ``@optname``”h]”hŒ@optname”…”�”}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hj?ubhŒ’s are present:”…”�”}”(hj?h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´Kehj¢h²hubj)�”}”(hŒÓ @optname ASCONF Parameter ---------- ------------------ SCTP_SOCKOPT_BINDX_ADD -> SCTP_PARAM_ADD_IP SCTP_SET_PEER_PRIMARY_ADDR -> SCTP_PARAM_SET_PRIMARY”h]”hŒÓ @optname ASCONF Parameter ---------- ------------------ SCTP_SOCKOPT_BINDX_ADD -> SCTP_PARAM_ADD_IP SCTP_SET_PEER_PRIMARY_ADDR -> SCTP_PARAM_SET_PRIMARY”…”�”}”hjssbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Khhj¢h²hubeh}”(h]”Œsecurity-sctp-bind-connect”ah ]”h"]”h$]”Œsecurity_sctp_bind_connect()”ah&]”uh1hÈhhîh²hh³hÇh´K#j¡KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒsecurity_sctp_sk_clone()”h]”hŒsecurity_sctp_sk_clone()”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj‰h²hh³hÇh´Koubj)�”}”(hŒ¡Called whenever a new socket is created by **accept**\(2) (i.e. a TCP style socket) or when a socket is 'peeled off' e.g userspace calls **sctp_peeloff**\(3). ::”h]”(hŒ+Called whenever a new socket is created by ”…”�”}”(hjšh²hh³Nh´Nubj)�”}”(hŒ **accept**”h]”hŒaccept”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjšubhŒX(2) (i.e. a TCP style socket) or when a socket is ‘peeled off’ e.g userspace calls ”…”�”}”(hjšh²hh³Nh´Nubj)�”}”(hŒ**sctp_peeloff**”h]”hŒ sctp_peeloff”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjšubhŒ(3).”…”�”}”(hjšh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´Kphj‰h²hubj)�”}”(hŒ‡@asoc - pointer to current sctp association structure. @sk - pointer to current sock structure. @newsk - pointer to new sock structure.”h]”hŒ‡@asoc - pointer to current sctp association structure. @sk - pointer to current sock structure. @newsk - pointer to new sock structure.”…”�”}”hjÌsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Kuhj‰h²hubeh}”(h]”Œsecurity-sctp-sk-clone”ah ]”h"]”h$]”Œsecurity_sctp_sk_clone()”ah&]”uh1hÈhhîh²hh³hÇh´Koj¡KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ!security_sctp_assoc_established()”h]”hŒ!security_sctp_assoc_established()”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjâh²hh³hÇh´K{ubj)�”}”(hŒnCalled when a COOKIE ACK is received, and the peer secid will be saved into ``@asoc->peer_secid`` for client::”h]”(hŒLCalled when a COOKIE ACK is received, and the peer secid will be saved into ”…”�”}”(hjóh²hh³Nh´Nubj`)�”}”(hŒ``@asoc->peer_secid``”h]”hŒ@asoc->peer_secid”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjóubhŒ for client:”…”�”}”(hjóh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´K|hjâh²hubj)�”}”(hŒa@asoc - pointer to sctp association structure. @skb - pointer to skbuff of the COOKIE ACK packet.”h]”hŒa@asoc - pointer to sctp association structure. @skb - pointer to skbuff of the COOKIE ACK packet.”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Khjâh²hubeh}”(h]”Œsecurity-sctp-assoc-established”ah ]”h"]”h$]”Œ!security_sctp_assoc_established()”ah&]”uh1hÈhhîh²hh³hÇh´K{j¡Kubeh}”(h]”Œsecurity-hooks”ah ]”h"]”h$]”Œsecurity hooks”ah&]”uh1hÈhhÝh²hh³hÇh´K j¡KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ1Security Hooks used for Association Establishment”h]”hŒ1Security Hooks used for Association Establishment”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj1h²hh³hÇh´K„ubj)�”}”(hŒ¶The following diagram shows the use of ``security_sctp_bind_connect()``, ``security_sctp_assoc_request()``, ``security_sctp_assoc_established()`` when establishing an association. ::”h]”(hŒ'The following diagram shows the use of ”…”�”}”(hjBh²hh³Nh´Nubj`)�”}”(hŒ ``security_sctp_bind_connect()``”h]”hŒsecurity_sctp_bind_connect()”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjBubhŒ, ”…”�”}”(hjBh²hh³Nh´Nubj`)�”}”(hŒ!``security_sctp_assoc_request()``”h]”hŒsecurity_sctp_assoc_request()”…”�”}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjBubhŒ, ”…”�”}”(hjBh²hh³Nh´Nubj`)�”}”(hŒ%``security_sctp_assoc_established()``”h]”hŒ!security_sctp_assoc_established()”…”�”}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjBubhŒ" when establishing an association.”…”�”}”(hjBh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´K†hj1h²hubj)�”}”(hXû SCTP endpoint "A" SCTP endpoint "Z" ================= ================= sctp_sf_do_prm_asoc() Association setup can be initiated by a connect(2), sctp_connectx(3), sendmsg(2) or sctp_sendmsg(3). These will result in a call to security_sctp_bind_connect() to initiate an association to SCTP peer endpoint "Z". INIT ---------------------------------------------> sctp_sf_do_5_1B_init() Respond to an INIT chunk. SCTP peer endpoint "A" is asking for a temporary association. Call security_sctp_assoc_request() to set the peer label if first association. If not first association, check whether allowed, IF so send: <----------------------------------------------- INIT ACK | ELSE audit event and silently | discard the packet. | COOKIE ECHO ------------------------------------------> sctp_sf_do_5_1D_ce() Respond to an COOKIE ECHO chunk. Confirm the cookie and create a permanent association. Call security_sctp_assoc_request() to do the same as for INIT chunk Response. <------------------------------------------- COOKIE ACK | | sctp_sf_do_5_1E_ca | Call security_sctp_assoc_established() | to set the peer label. | | | | If SCTP_SOCKET_TCP or peeled off | socket security_sctp_sk_clone() is | called to clone the new socket. | | ESTABLISHED ESTABLISHED | | ------------------------------------------------------------------ | Association Established | ------------------------------------------------------------------”h]”hXû SCTP endpoint "A" SCTP endpoint "Z" ================= ================= sctp_sf_do_prm_asoc() Association setup can be initiated by a connect(2), sctp_connectx(3), sendmsg(2) or sctp_sendmsg(3). These will result in a call to security_sctp_bind_connect() to initiate an association to SCTP peer endpoint "Z". INIT ---------------------------------------------> sctp_sf_do_5_1B_init() Respond to an INIT chunk. SCTP peer endpoint "A" is asking for a temporary association. Call security_sctp_assoc_request() to set the peer label if first association. If not first association, check whether allowed, IF so send: <----------------------------------------------- INIT ACK | ELSE audit event and silently | discard the packet. | COOKIE ECHO ------------------------------------------> sctp_sf_do_5_1D_ce() Respond to an COOKIE ECHO chunk. Confirm the cookie and create a permanent association. Call security_sctp_assoc_request() to do the same as for INIT chunk Response. <------------------------------------------- COOKIE ACK | | sctp_sf_do_5_1E_ca | Call security_sctp_assoc_established() | to set the peer label. | | | | If SCTP_SOCKET_TCP or peeled off | socket security_sctp_sk_clone() is | called to clone the new socket. | | ESTABLISHED ESTABLISHED | | ------------------------------------------------------------------ | Association Established | ------------------------------------------------------------------”…”�”}”hj†sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K‹hj1h²hubeh}”(h]”Œ1security-hooks-used-for-association-establishment”ah ]”h"]”Œ1security hooks used for association establishment”ah$]”h&]”uh1hÈhhÝh²hh³hÇh´K„ubeh}”(h]”Œsctp-lsm-support”ah ]”h"]”Œsctp lsm support”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Kj¡KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒSCTP SELinux Support”h]”hŒSCTP SELinux Support”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¤h²hh³hÇh´K¼ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒSecurity Hooks”h]”hŒSecurity Hooks”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjµh²hh³hÇh´K¿ubj)�”}”(hŒ}The `SCTP LSM Support`_ chapter above describes the following SCTP security hooks with the SELinux specifics expanded below::”h]”(hŒThe ”…”�”}”(hjÆh²hh³Nh´Nubj()�”}”(hŒ`SCTP LSM Support`_”h]”hŒSCTP LSM Support”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”ŒSCTP LSM Support”j9jžuh1j'hjÆj;KubhŒe chapter above describes the following SCTP security hooks with the SELinux specifics expanded below:”…”�”}”(hjÆh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KÁhjµh²hubj)�”}”(hŒusecurity_sctp_assoc_request() security_sctp_bind_connect() security_sctp_sk_clone() security_sctp_assoc_established()”h]”hŒusecurity_sctp_assoc_request() security_sctp_bind_connect() security_sctp_sk_clone() security_sctp_assoc_established()”…”�”}”hjèsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KÄhjµh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒsecurity_sctp_assoc_request()”h]”hŒsecurity_sctp_assoc_request()”…”�”}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjöh²hh³hÇh´KËubj)�”}”(hŒŠPasses the ``@asoc`` and ``@chunk->skb`` of the association INIT packet to the security module. Returns 0 on success, error on failure. ::”h]”(hŒ Passes the ”…”�”}”(hjh²hh³Nh´Nubj`)�”}”(hŒ ``@asoc``”h]”hŒ@asoc”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjubhŒ and ”…”�”}”(hjh²hh³Nh´Nubj`)�”}”(hŒ``@chunk->skb``”h]”hŒ @chunk->skb”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjubhŒ_ of the association INIT packet to the security module. Returns 0 on success, error on failure.”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KÌhjöh²hubj)�”}”(hŒ^@asoc - pointer to sctp association structure. @skb - pointer to skbuff of association packet.”h]”hŒ^@asoc - pointer to sctp association structure. @skb - pointer to skbuff of association packet.”…”�”}”hj9sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KÐhjöh²hubhŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hXçThe security module performs the following operations: IF this is the first association on ``@asoc->base.sk``, then set the peer sid to that in ``@skb``. This will ensure there is only one peer sid assigned to ``@asoc->base.sk`` that may support multiple associations. ELSE validate the ``@asoc->base.sk peer_sid`` against the ``@skb peer sid`` to determine whether the association should be allowed or denied. Set the sctp ``@asoc sid`` to socket's sid (from ``asoc->base.sk``) with MLS portion taken from ``@skb peer sid``. This will be used by SCTP TCP style sockets and peeled off connections as they cause a new socket to be generated. If IP security options are configured (CIPSO/CALIPSO), then the ip options are set on the socket. ”h]”(hŒterm”“”)�”}”(hŒ6The security module performs the following operations:”h]”hŒ6The security module performs the following operations:”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jRh³hÇh´KâhjNubhŒ definition”“”)�”}”(hhh]”(j)�”}”(hŒÕIF this is the first association on ``@asoc->base.sk``, then set the peer sid to that in ``@skb``. This will ensure there is only one peer sid assigned to ``@asoc->base.sk`` that may support multiple associations.”h]”(hŒ$IF this is the first association on ”…”�”}”(hjgh²hh³Nh´Nubj`)�”}”(hŒ``@asoc->base.sk``”h]”hŒ@asoc->base.sk”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjgubhŒ#, then set the peer sid to that in ”…”�”}”(hjgh²hh³Nh´Nubj`)�”}”(hŒ``@skb``”h]”hŒ@skb”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjgubhŒ:. This will ensure there is only one peer sid assigned to ”…”�”}”(hjgh²hh³Nh´Nubj`)�”}”(hŒ``@asoc->base.sk``”h]”hŒ@asoc->base.sk”…”�”}”(hj“h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjgubhŒ( that may support multiple associations.”…”�”}”(hjgh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KÔhjdubj)�”}”(hŒ�ELSE validate the ``@asoc->base.sk peer_sid`` against the ``@skb peer sid`` to determine whether the association should be allowed or denied.”h]”(hŒELSE validate the ”…”�”}”(hj«h²hh³Nh´Nubj`)�”}”(hŒ``@asoc->base.sk peer_sid``”h]”hŒ@asoc->base.sk peer_sid”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hj«ubhŒ against the ”…”�”}”(hj«h²hh³Nh´Nubj`)�”}”(hŒ``@skb peer sid``”h]”hŒ @skb peer sid”…”�”}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hj«ubhŒB to determine whether the association should be allowed or denied.”…”�”}”(hj«h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KØhjdubj)�”}”(hŒåSet the sctp ``@asoc sid`` to socket's sid (from ``asoc->base.sk``) with MLS portion taken from ``@skb peer sid``. This will be used by SCTP TCP style sockets and peeled off connections as they cause a new socket to be generated.”h]”(hŒ Set the sctp ”…”�”}”(hjÝh²hh³Nh´Nubj`)�”}”(hŒ ``@asoc sid``”h]”hŒ @asoc sid”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjÝubhŒ to socket’s sid (from ”…”�”}”(hjÝh²hh³Nh´Nubj`)�”}”(hŒ``asoc->base.sk``”h]”hŒ asoc->base.sk”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjÝubhŒ) with MLS portion taken from ”…”�”}”(hjÝh²hh³Nh´Nubj`)�”}”(hŒ``@skb peer sid``”h]”hŒ @skb peer sid”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjÝubhŒt. This will be used by SCTP TCP style sockets and peeled off connections as they cause a new socket to be generated.”…”�”}”(hjÝh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KÛhjdubj)�”}”(hŒaIf IP security options are configured (CIPSO/CALIPSO), then the ip options are set on the socket.”h]”hŒaIf IP security options are configured (CIPSO/CALIPSO), then the ip options are set on the socket.”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´Kàhjdubeh}”(h]”h ]”h"]”h$]”h&]”uh1jbhjNubeh}”(h]”h ]”h"]”h$]”h&]”uh1jLh³hÇh´KâhjIubah}”(h]”h ]”h"]”h$]”h&]”uh1jGhjöh²hh³hÇh´Nubeh}”(h]”Œid2”ah ]”h"]”h$]”jŸah&]”uh1hÈhjµh²hh³hÇh´KËj¡KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒsecurity_sctp_bind_connect()”h]”hŒsecurity_sctp_bind_connect()”…”�”}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjHh²hh³hÇh´Kåubj)�”}”(hŒZChecks permissions required for ipv4/ipv6 addresses based on the ``@optname`` as follows::”h]”(hŒAChecks permissions required for ipv4/ipv6 addresses based on the ”…”�”}”(hjYh²hh³Nh´Nubj`)�”}”(hŒ ``@optname``”h]”hŒ@optname”…”�”}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjYubhŒ as follows:”…”�”}”(hjYh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KæhjHh²hubj)�”}”(hXs------------------------------------------------------------------ | BIND Permission Checks | | @optname | @address contains | |----------------------------|-----------------------------------| | SCTP_SOCKOPT_BINDX_ADD | One or more ipv4 / ipv6 addresses | | SCTP_PRIMARY_ADDR | Single ipv4 or ipv6 address | | SCTP_SET_PEER_PRIMARY_ADDR | Single ipv4 or ipv6 address | ------------------------------------------------------------------ ------------------------------------------------------------------ | CONNECT Permission Checks | | @optname | @address contains | |----------------------------|-----------------------------------| | SCTP_SOCKOPT_CONNECTX | One or more ipv4 / ipv6 addresses | | SCTP_PARAM_ADD_IP | One or more ipv4 / ipv6 addresses | | SCTP_SENDMSG_CONNECT | Single ipv4 or ipv6 address | | SCTP_PARAM_SET_PRIMARY | Single ipv4 or ipv6 address | ------------------------------------------------------------------”h]”hXs------------------------------------------------------------------ | BIND Permission Checks | | @optname | @address contains | |----------------------------|-----------------------------------| | SCTP_SOCKOPT_BINDX_ADD | One or more ipv4 / ipv6 addresses | | SCTP_PRIMARY_ADDR | Single ipv4 or ipv6 address | | SCTP_SET_PEER_PRIMARY_ADDR | Single ipv4 or ipv6 address | ------------------------------------------------------------------ ------------------------------------------------------------------ | CONNECT Permission Checks | | @optname | @address contains | |----------------------------|-----------------------------------| | SCTP_SOCKOPT_CONNECTX | One or more ipv4 / ipv6 addresses | | SCTP_PARAM_ADD_IP | One or more ipv4 / ipv6 addresses | | SCTP_SENDMSG_CONNECT | Single ipv4 or ipv6 address | | SCTP_PARAM_SET_PRIMARY | Single ipv4 or ipv6 address | ------------------------------------------------------------------”…”�”}”hjysbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KéhjHh²hubj)�”}”(hŒ›`SCTP LSM Support`_ gives a summary of the ``@optname`` entries and also describes ASCONF chunk processing when Dynamic Address Reconfiguration is enabled.”h]”(j()�”}”(hŒ`SCTP LSM Support`_”h]”hŒSCTP LSM Support”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”ŒSCTP LSM Support”j9jžuh1j'hj‡j;KubhŒ gives a summary of the ”…”�”}”(hj‡h²hh³Nh´Nubj`)�”}”(hŒ ``@optname``”h]”hŒ@optname”…”�”}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hj‡ubhŒd entries and also describes ASCONF chunk processing when Dynamic Address Reconfiguration is enabled.”…”�”}”(hj‡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´KýhjHh²hubeh}”(h]”Œid3”ah ]”h"]”h$]”j‡ah&]”uh1hÈhjµh²hh³hÇh´Kåj¡KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒsecurity_sctp_sk_clone()”h]”hŒsecurity_sctp_sk_clone()”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¾h²hh³hÇh´Mubj)�”}”(hX4Called whenever a new socket is created by **accept**\(2) (i.e. a TCP style socket) or when a socket is 'peeled off' e.g userspace calls **sctp_peeloff**\(3). ``security_sctp_sk_clone()`` will set the new sockets sid and peer sid to that contained in the ``@asoc sid`` and ``@asoc peer sid`` respectively. ::”h]”(hŒ+Called whenever a new socket is created by ”…”�”}”(hjÏh²hh³Nh´Nubj)�”}”(hŒ **accept**”h]”hŒaccept”…”�”}”(hj×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÏubhŒX(2) (i.e. a TCP style socket) or when a socket is ‘peeled off’ e.g userspace calls ”…”�”}”(hjÏh²hh³Nh´Nubj)�”}”(hŒ**sctp_peeloff**”h]”hŒ sctp_peeloff”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÏubhŒ(3). ”…”�”}”(hjÏh²hh³Nh´Nubj`)�”}”(hŒ``security_sctp_sk_clone()``”h]”hŒsecurity_sctp_sk_clone()”…”�”}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjÏubhŒD will set the new sockets sid and peer sid to that contained in the ”…”�”}”(hjÏh²hh³Nh´Nubj`)�”}”(hŒ ``@asoc sid``”h]”hŒ @asoc sid”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjÏubhŒ and ”…”�”}”(hjÏh²hh³Nh´Nubj`)�”}”(hŒ``@asoc peer sid``”h]”hŒ@asoc peer sid”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjÏubhŒ respectively.”…”�”}”(hjÏh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´Mhj¾h²hubj)�”}”(hŒ‡@asoc - pointer to current sctp association structure. @sk - pointer to current sock structure. @newsk - pointer to new sock structure.”h]”hŒ‡@asoc - pointer to current sctp association structure. @sk - pointer to current sock structure. @newsk - pointer to new sock structure.”…”�”}”hj7sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´M hj¾h²hubeh}”(h]”Œid4”ah ]”h"]”h$]”jàah&]”uh1hÈhjµh²hh³hÇh´Mj¡KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ!security_sctp_assoc_established()”h]”hŒ!security_sctp_assoc_established()”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjLh²hh³hÇh´Mubj)�”}”(hŒbCalled when a COOKIE ACK is received where it sets the connection's peer sid to that in ``@skb``::”h]”(hŒZCalled when a COOKIE ACK is received where it sets the connection’s peer sid to that in ”…”�”}”(hj]h²hh³Nh´Nubj`)�”}”(hŒ``@skb``”h]”hŒ@skb”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hj]ubhŒ:”…”�”}”(hj]h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´MhjLh²hubj)�”}”(hŒa@asoc - pointer to sctp association structure. @skb - pointer to skbuff of the COOKIE ACK packet.”h]”hŒa@asoc - pointer to sctp association structure. @skb - pointer to skbuff of the COOKIE ACK packet.”…”�”}”hj}sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´MhjLh²hubeh}”(h]”Œid5”ah ]”h"]”h$]”j'ah&]”uh1hÈhjµh²hh³hÇh´Mj¡Kubeh}”(h]”Œid1”ah ]”h"]”h$]”j/ah&]”uh1hÈhj¤h²hh³hÇh´K¿j¡KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒPolicy Statements”h]”hŒPolicy Statements”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj™h²hh³hÇh´Mubj)�”}”(hŒUThe following class and permissions to support SCTP are available within the kernel::”h]”hŒTThe following class and permissions to support SCTP are available within the kernel:”…”�”}”(hjªh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´Mhj™h²hubj)�”}”(hŒ/class sctp_socket inherits socket { node_bind }”h]”hŒ/class sctp_socket inherits socket { node_bind }”…”�”}”hj¸sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Mhj™h²hubj)�”}”(hŒ5whenever the following policy capability is enabled::”h]”hŒ4whenever the following policy capability is enabled:”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´M hj™h²hubj)�”}”(hŒ policycap extended_socket_class;”h]”hŒ policycap extended_socket_class;”…”�”}”hjÔsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´M"hj™h²hubj)�”}”(hŒ«SELinux SCTP support adds the ``name_connect`` permission for connecting to a specific port type and the ``association`` permission that is explained in the section below.”h]”(hŒSELinux SCTP support adds the ”…”�”}”(hjâh²hh³Nh´Nubj`)�”}”(hŒ``name_connect``”h]”hŒ name_connect”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjâubhŒ; permission for connecting to a specific port type and the ”…”�”}”(hjâh²hh³Nh´Nubj`)�”}”(hŒ``association``”h]”hŒ association”…”�”}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j_hjâubhŒ3 permission that is explained in the section below.”…”�”}”(hjâh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÿh³hÇh´M$hj™h²hubj)�”}”(hŒuIf userspace tools have been updated, SCTP will support the ``portcon`` statement as shown in the following example::”h]”(hŒ