From patchwork Thu Jun 9 12:59:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Moore X-Patchwork-Id: 9166971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 19EAA6048F for ; Thu, 9 Jun 2016 13:00:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B00221BED for ; Thu, 9 Jun 2016 13:00:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F40A228340; Thu, 9 Jun 2016 13:00:48 +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=-1.9 required=2.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received: from emsm-gh1-uea10.nsa.gov (smtp.nsa.gov [8.44.101.8]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5531B21BED for ; Thu, 9 Jun 2016 13:00:47 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.26,444,1459814400"; d="scan'208";a="14487927" IronPort-PHdr: =?us-ascii?q?9a23=3AJF3UrR0RoyRDg9e5smDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?segTL/ad9pjvdHbS+e9qxAeQG96LurQb1qGK4+jJYi8p39WoiDg6aptCVhsI24?= =?us-ascii?q?09vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09?= =?us-ascii?q?fr2zQd6DyZvqnLzis7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP?= =?us-ascii?q?5Xz247bXianhL7+9vitMU7q3cYhuglv/Jkfe26Ov1gDO8QMDNzN2Ez+d2urkKS?= =?us-ascii?q?FSOR6XYGFGYbiBxFB07C9h6pcI32t37Cv/d5kAydOtf7BeQsXDOl9apDUhLkiC?= =?us-ascii?q?4bcTU+9TeE2YRLkKtHrUf59FREyInObdTQbaJz?= X-IPAS-Result: =?us-ascii?q?A2GqBQB2Z1lX/wHyM5BeGwEBAYMggVOKLrJYIoV3A4E9TAE?= =?us-ascii?q?BAQEBAQICYieCMIIdAiQTFCALAwMJAhcIIQgIAwEtFR8LBRgEiA6+KAsBAQEjh?= =?us-ascii?q?ieBf4ZeAhEBaIUOBZhVl2sXhUMCj2VUggccgWdSiEQPF4EeAQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jun 2016 13:00:45 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u59D0KHK002912; Thu, 9 Jun 2016 09:00:27 -0400 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id u59D0HZa209976 for ; Thu, 9 Jun 2016 09:00:17 -0400 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id u59D0Gfp002903 for ; Thu, 9 Jun 2016 09:00:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1DkAQAkaFlXfhy3hNFeGgEBAQGEc4ourlqECRKGAYE7TAEBAQEBARMBAQsLCQkhhR4EUjAFAiYCSSmIL60ckQ0xgQGFJoF/hl58gjWCWQWYVZdrhVoCj2WCWxyBZyAyiESBRAEBAQ X-IPAS-Result: A1DkAQAkaFlXfhy3hNFeGgEBAQGEc4ourlqECRKGAYE7TAEBAQEBARMBAQsLCQkhhR4EUjAFAiYCSSmIL60ckQ0xgQGFJoF/hl58gjWCWQWYVZdrhVoCj2WCWxyBZyAyiESBRAEBAQ X-IronPort-AV: E=Sophos;i="5.26,444,1459828800"; d="scan'208";a="5502139" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 09 Jun 2016 08:59:59 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3Ai3n5BRbytL2QG8uH3ITQNbn/LSx+4OfEezUN459i?= =?us-ascii?q?sYplN5qZpci6bnLW6fgltlLVR4KTs6sC0LqH9f+9EjBQqb+681k8M7V0Hycfjs?= =?us-ascii?q?sXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJP?= =?us-ascii?q?K/jvHcaK1oLsh7H0pMCYP1UArQH+SI0xBS3+lR/WuMgSjNkqAYcK4TyNnEF1ff?= =?us-ascii?q?9Lz3hjP1OZkkW0zM6x+Jl+73YY4Kp5pIYTGZn9KqA5S6FISS99Yjgd+sLmr1/A?= =?us-ascii?q?QBGJ639aVX8ZwTRSBA2Q1BjnWt/UtSzgu6IpwCydOtf7Zao5VTSr8+FgTxq+23?= =?us-ascii?q?RPDCIw7GyC0p84t6lcuh/0/xE=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0HpAgB2Z1lXfhy3hNFeGwEBAYRzii6uW?= =?us-ascii?q?oQJEoYBgTtMAQEBAQEBAgIPAQELCwkJIS+CMII/BFIwBQImAkkpiC+tG5ENDCW?= =?us-ascii?q?BAYUmgX+GXnyCNYJZBZhVl2uFWgKPZYJbHIFnIDKIRIFEAQEB?= X-IPAS-Result: =?us-ascii?q?A0HpAgB2Z1lXfhy3hNFeGwEBAYRzii6uWoQJEoYBgTtMAQE?= =?us-ascii?q?BAQEBAgIPAQELCwkJIS+CMII/BFIwBQImAkkpiC+tG5ENDCWBAYUmgX+GXnyCN?= =?us-ascii?q?YJZBZhVl2uFWgKPZYJbHIFnIDKIRIFEAQEB?= X-IronPort-AV: E=Sophos;i="5.26,444,1459814400"; d="scan'208";a="14487877" Received: from mx1.redhat.com ([209.132.183.28]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jun 2016 12:59:55 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C55AA8E666; Thu, 9 Jun 2016 12:59:54 +0000 (UTC) Received: from [127.0.0.1] (vpn-238-254.phx2.redhat.com [10.3.238.254]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u59CxrD0032253; Thu, 9 Jun 2016 08:59:53 -0400 Subject: [PATCH] iucv: properly clone LSM attributes to newly created child sockets From: Paul Moore To: linux-s390@vger.kernel.org Date: Thu, 09 Jun 2016 08:59:53 -0400 Message-ID: <146547719343.9258.4899338680484754606.stgit@localhost> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 09 Jun 2016 12:59:54 +0000 (UTC) X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: Cc: netdev@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP From: Paul Moore Much like we had to do for AF_BLUETOOTH and AF_ALG, make sure we properly clone the parent socket's LSM attributes to newly created child sockets. Signed-off-by: Paul Moore --- net/iucv/af_iucv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index fc3598a..a0d1e36 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -530,8 +531,10 @@ static void iucv_sock_close(struct sock *sk) static void iucv_sock_init(struct sock *sk, struct sock *parent) { - if (parent) + if (parent) { sk->sk_type = parent->sk_type; + security_sk_clone(parent, sk); + } } static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio, int kern)