Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp452587pxb; Tue, 15 Feb 2022 18:17:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSZhT1LLI4F7pfRwpAN3QiouBuUaUjcQs3AKTOw1PUHxpfKK4V3vmkDNvpAdJ0x/pXJCJG X-Received: by 2002:a05:6402:50c6:b0:410:a107:e9f4 with SMTP id h6-20020a05640250c600b00410a107e9f4mr717111edb.274.1644977837620; Tue, 15 Feb 2022 18:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644977837; cv=none; d=google.com; s=arc-20160816; b=r7udAHlLHkT1UPa7IAve/Ek+mc5hOAwQ5PoPKHBI6jT2ewVZAmEn5r4SZUQyC3XwbN VD73uXzdWpiXaSLOaqiYILcyAciZHQ4MgVzeGha4vo31PbOHL4ZkX3Tfk6DlItYz+OpB k7RpyubS80bPeWMjMAXPLUMPI2dxw3G52bTE1cEcexBoqnL6Tstyiq/vz6UIOHwKESQT knaKLFUUapRFEYFmOO88Bm3QwQExrJay3QzsEXFmbCy2+V5KGoS87TxgkiqhY/O/MJ9M OcsEg6WS1i8xKTTF7DOU9FMTjCFD24nVhWeDnVJcJS+6ln3d6W2YRXRNqpGjwlSX6LnF DYTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BhJlt5ZCYoidBqqNJ5EsFOz8HUlOmyfI7AV8Vc3JkYk=; b=ptcQtZWNKIm+3eLuaPTkQhFSEIU4amkNk2xuPfNW8HDnItPPx5GF0ewv9d9XjUVK+L qXlVdBcuWA2hm8A74+fIhG7rD1qPoqqn/H1IZ7m6XHsl/NEkmQE5/3he/rb8zn1lKNjZ FV/+xFHj2Gs1EAAVrUljjuISd5h3vsbOaifGG6sjFK/BoKCbIvpMXda8/GZJPS5YFySR xHkdHqa7EJtDdDTwOebBGrAy4zIcPg3NWegd9Am+S1AtkZT0H7R01QXn+S6qnnu5Av9k GBgRG/2QS4GmNkbDADO/Ifmj0WBqcKivWbnYS2c/1lousveH3HMFXl5YOVszeGlu4zzh r1qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=ADoOeEn8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu8si11587569ejc.280.2022.02.15.18.16.54; Tue, 15 Feb 2022 18:17:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore-com.20210112.gappssmtp.com header.s=20210112 header.b=ADoOeEn8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242602AbiBOUJG (ORCPT + 99 others); Tue, 15 Feb 2022 15:09:06 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231674AbiBOUJF (ORCPT ); Tue, 15 Feb 2022 15:09:05 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A388CB0C41 for ; Tue, 15 Feb 2022 12:08:54 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id p15so46643344ejc.7 for ; Tue, 15 Feb 2022 12:08:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BhJlt5ZCYoidBqqNJ5EsFOz8HUlOmyfI7AV8Vc3JkYk=; b=ADoOeEn89ke3US6l0YM5nqedXSf+e9ChVnMnFsvfT7bO8qng9v6Ta1Rj8Ds/J4fnho JC3kI6BGKVlJgdUYnf82vkkoyXm/N71P0w6DJKZrzd5Cu2zgnNl0NhFzos5niPdtMbSU /MILDymIqGvkOWWPqa6cWe4U7kVCqXpjwmKgrV1zBUhAGK3e/8SCtoYhjzWpNOQT9g6n hCMwtfdf6Zb5rSnDACVc3b0BhSXs8+Jbakg1KlxkGOFZ/8pexlNdDMUNwSWZeFvOqi/o 1rnk/qIn72rf6ybZ3U8mlqscNN1JRZYSq23BpzPUuDC9AQzkkxmqYrHEGoA5LH1Pr/2N c60A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BhJlt5ZCYoidBqqNJ5EsFOz8HUlOmyfI7AV8Vc3JkYk=; b=Q87dGXcgs6M+QyceAYdWI+AR4esLD0NVmz0dltZ6DiQ2rHbkBsKZFGdDMnusEdPBoR YAHYUcK6j2j7a+09kqcN66J8rxOZlTGoizytXl9hIB2pHKTaXL1PiVTktJm0t35T8jc7 meTFgJ/e9P9rqEKMm2nqUfbO5eWbrtzSSJukS4fjUJ1uvNzuD0W09Fjsu79h3+Au07lU +N1VaK9RygTJZqNqiETNw00bSAkQm+qksadafV2CtrGG8xM9Nt0aeAYUq9jUC9R9fBUv mzxU6plLZeieHt2l+KDRlS2brn8hhVbQb99kHOLlIvfBd5h+2z0ySxKpL4dgj4lhMY23 4AFQ== X-Gm-Message-State: AOAM531QnRlG7Z0TQsK4Hbno7zJoIWgQ8i9yYxKBeHLOWcfveCk5zIO7 YXsTywl+b5+GSTaqRObNL/N+7jyLFYVXtwyFhoxO X-Received: by 2002:a17:906:6498:: with SMTP id e24mr639141ejm.12.1644955733109; Tue, 15 Feb 2022 12:08:53 -0800 (PST) MIME-Version: 1.0 References: <20220212175922.665442-1-omosnace@redhat.com> In-Reply-To: <20220212175922.665442-1-omosnace@redhat.com> From: Paul Moore Date: Tue, 15 Feb 2022 15:08:42 -0500 Message-ID: Subject: Re: [PATCH net v3 0/2] security: fixups for the security hooks in sctp To: Ondrej Mosnacek Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, selinux@vger.kernel.org, Xin Long , Richard Haines , Vlad Yasevich , Neil Horman , Marcelo Ricardo Leitner , linux-sctp@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 12, 2022 at 12:59 PM Ondrej Mosnacek wrote: > > This is a third round of patches to fix the SCTP-SELinux interaction > w.r.t. client-side peeloff. The patches are a modified version of Xin > Long's patches posted previously, of which only a part was merged (the > rest was merged for a while, but was later reverted): > https://lore.kernel.org/selinux/cover.1635854268.git.lucien.xin@gmail.com/T/ > > In gist, these patches replace the call to > security_inet_conn_established() in SCTP with a new hook > security_sctp_assoc_established() and implement the new hook in SELinux > so that the client-side association labels are set correctly (which > matters in case the association eventually gets peeled off into a > separate socket). > > Note that other LSMs than SELinux don't implement the SCTP hooks nor > inet_conn_established, so they shouldn't be affected by any of these > changes. > > These patches were tested by selinux-testsuite [1] with an additional > patch [2] and by lksctp-tools func_tests [3]. > > Changes since v2: > - patches 1 and 2 dropped as they are already in mainline (not reverted) > - in patch 3, the return value of security_sctp_assoc_established() is > changed to int, the call is moved earlier in the function, and if the > hook returns an error value, the packet will now be discarded, > aborting the association > - patch 4 has been changed a lot - please see the patch description for > details on how the hook is now implemented and why > > [1] https://github.com/SELinuxProject/selinux-testsuite/ > [2] https://patchwork.kernel.org/project/selinux/patch/20211021144543.740762-1-omosnace@redhat.com/ > [3] https://github.com/sctp/lksctp-tools/tree/master/src/func_tests > > Ondrej Mosnacek (2): > security: add sctp_assoc_established hook > security: implement sctp_assoc_established hook in selinux > > Documentation/security/SCTP.rst | 22 ++++---- > include/linux/lsm_hook_defs.h | 2 + > include/linux/lsm_hooks.h | 5 ++ > include/linux/security.h | 8 +++ > net/sctp/sm_statefuns.c | 8 +-- > security/security.c | 7 +++ > security/selinux/hooks.c | 90 ++++++++++++++++++++++++--------- > 7 files changed, 103 insertions(+), 39 deletions(-) This patchset has been merged into selinux/next, thanks everyone! -- paul-moore.com