From patchwork Thu Feb 28 22:43:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Casey Schaufler X-Patchwork-Id: 10834151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8EBB41805 for ; Thu, 28 Feb 2019 22:44:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 812542FA84 for ; Thu, 28 Feb 2019 22:44:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75B892FB90; Thu, 28 Feb 2019 22:44:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38D3E2FA84 for ; Thu, 28 Feb 2019 22:44:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730732AbfB1Wo3 (ORCPT ); Thu, 28 Feb 2019 17:44:29 -0500 Received: from sonic307-10.consmr.mail.bf2.yahoo.com ([74.6.134.49]:40842 "EHLO sonic307-10.consmr.mail.bf2.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729286AbfB1Wo3 (ORCPT ); Thu, 28 Feb 2019 17:44:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1551393868; bh=DZ6t+DXWOolC0BApfZ0rPkxLybTRQPdYfxYwy99dDN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References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4Ax18XmK2R4OQq5rIYf5FdYHDm 2_XlBAaO_rv8g0Z0d9JxFVhAeB3ov8odG0VOvyJzTIQPfm0FkY1Y1orgi7c73AC6GaREjHqVLsEy Mt.t9ObRsSQa5FoKuMy9k_7_N8bHwW_A.PouLnqH3kv4LIKVIiX9aTdvZdlsuNucO2_Dx99DjbZR 41cqLs9jwkZsW1g2Y7wLbBMQ_yQxQKtm3RRDqifA6uSaN4ITUEQqP6tv7prCq2mG0yTT062Wz.Pp 8Qx2RHtS9Kmw8GqG08wAb914xtCit0J9lzg9cbd1iVAAxv4PFwOrlBEIhWi4TJo77G1_sODBQm91 pHEuNinl7Iwat7spNcw6GqaFa6TP2ECLYKxGaCrxP65F7f22s2KiZUCcqaiYoUckwR9JKWOFVXXU CwOxcZxTDuXW8QaIIEURWmGSR0f1_HOvL3bUl57z2I8UeyE1LbpqN2FDG Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.bf2.yahoo.com with HTTP; Thu, 28 Feb 2019 22:44:28 +0000 Received: from c-67-169-65-224.hsd1.ca.comcast.net (EHLO localhost.localdomain) ([67.169.65.224]) by smtp415.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 46c3ca42412e81058eafbaa96f791691; Thu, 28 Feb 2019 22:44:26 +0000 (UTC) From: Casey Schaufler To: jmorris@namei.org, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Cc: keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, paul@paul-moore.com Subject: [PATCH 87/97] Smack: Let netlabel do the work on connections Date: Thu, 28 Feb 2019 14:43:46 -0800 Message-Id: <20190228224356.2608-18-casey@schaufler-ca.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190228224356.2608-1-casey@schaufler-ca.com> References: <20190228224356.2608-1-casey@schaufler-ca.com> Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Rather than removing the netlabel socket attribute on connections set the ambient domain. This is more in line with the way netlabel "should" be used. Signed-off-by: Casey Schaufler --- security/smack/smack_lsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index d9055a0df75c..f965c9e6287e 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -4057,7 +4057,7 @@ static int smack_inet_conn_request(struct sock *sk, struct sk_buff *skb, if (hskp == NULL) rc = netlbl_req_setattr(req, &skp->smk_netlabel); else - netlbl_req_delattr(req); + rc = netlbl_req_setattr(req, &smack_net_ambient->smk_netlabel); return rc; }