Received: by 10.213.65.68 with SMTP id h4csp809911imn; Sat, 7 Apr 2018 10:04:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+QD8bFq4n+HGpp07NztJ0T9N8ZOw3j9knTpCwtsGaLtz639BO1JzatvbdzfaUE2Tp39UdO X-Received: by 2002:a17:902:2b84:: with SMTP id l4-v6mr32643026plb.65.1523120641926; Sat, 07 Apr 2018 10:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523120641; cv=none; d=google.com; s=arc-20160816; b=yGG0m4v1St4laLlyEqrwuDKJz+/GRpwg8UPJSQl1ZFRbbojrFKl/48LkVg0H42r8rZ hnVLJUyOafy0V4LBTQ+CG1JBHCDKSPAe7QhTsCIXEN6fF5FOImnIGMeeFpQPCuyo/1gh K2rQNWsVEqUPMUE7i+B4Z1N5fQUUBHei87mi2FYL1No/JVqCRETSo8HxurQtEmlBS64Z EsleCSnPhbs7tbQfIE08TE7528TQg1JLFXUn5SScdiYJ6UAvEzTFb8p1YDPdAsPdRmPi 2fbg+KHWZ/qD1RIzhbbiSmVFAWXeCgbBP+1V2wafLhM1xqYFqstdP5rXd8hj3rDgoC0s kUtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=TZvzcGMPuQ1I4hxtBt/ViVtxZpAD8LvlE1sl9iBA3AE=; b=EqP1GK4AsiDwdXBqZV0zr/E0J6xHHK1xiDRHFt/Nq/0/Gfy0LkhA7rGKMqy/CFzJr/ pstcG6dIai7XcQT/MsIWRZYvfPim9Nk+i1mHbQwqIUeKuZhBC3UIr8QqynjmZipk+3US jGsYAMmGT0OFiDJn/2rscj+X7dGBDwt6kpsVMJ6qIX7NJQdyOoGQyjEyiQ1JrnwS2QCo nNmdCywtzE1STImlGxmn4cbK63hsJEkOEDAjj29DblZ9uob6kkX49uo8hvuqQQmL2ZV5 pQNo3aEFobzQZ6NuBd+AB+Qz3fEo0yt1lpuKzbvHzlLIbtpQUurNkVo8XdZbFUsXxUUZ aJ+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@btinternet.com header.s=btcpcloud header.b=gZPaPJfA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=btinternet.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2-v6si11948261pli.501.2018.04.07.10.03.23; Sat, 07 Apr 2018 10:04:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@btinternet.com header.s=btcpcloud header.b=gZPaPJfA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=btinternet.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862AbeDGRAm (ORCPT + 99 others); Sat, 7 Apr 2018 13:00:42 -0400 Received: from rgout0804.bt.lon5.cpcloud.co.uk ([65.20.0.151]:6916 "EHLO rgout0804.bt.lon5.cpcloud.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbeDGRAk (ORCPT ); Sat, 7 Apr 2018 13:00:40 -0400 X-Greylist: delayed 377 seconds by postgrey-1.27 at vger.kernel.org; Sat, 07 Apr 2018 13:00:40 EDT X-OWM-Source-IP: 86.134.200.89 (GB) X-OWM-Env-Sender: richard_c_haines@btinternet.com X-RazorGate-Vade-Classification: clean X-RazorGate-Vade-Verdict: clean 0 X-VadeSecure-score: verdict=clean score=0/300, class=clean X-SNCR-VADESECURE: CLEAN X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedtgedrhedtgddutdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkuffhvfffjghftgfoggfgsehtjeertdertdejnecuhfhrohhmpeftihgthhgrrhguucfjrghinhgvshcuoehrihgthhgrrhgupggtpghhrghinhgvshessghtihhnthgvrhhnvghtrdgtohhmqeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeekiedrudefgedrvddttddrkeelnecurfgrrhgrmhephhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepkeeirddufeegrddvtddtrdekledpmhgrihhlfhhrohhmpeeorhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomheqnecuvehluhhsthgvrhfuihiivgeptd X-RazorGate-Vade-Classification: clean X-RazorGate-Vade-Verdict: clean 0 X-VadeSecure-score: verdict=clean score=0/300, class=clean X-SNCR-VADESECURE: CLEAN X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedtgedrhedtgddutdeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkuffhvfffjghftgfoggfgsehtjeertdertdejnecuhfhrohhmpeftihgthhgrrhguucfjrghinhgvshcuoehrihgthhgrrhgupggtpghhrghinhgvshessghtihhnthgvrhhnvghtrdgtohhmqeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeekiedrudefgedrvddttddrkeelnecurfgrrhgrmhephhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepkeeirddufeegrddvtddtrdekledpmhgrihhlfhhrohhmpeeorhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomheqnecuvehluhhsthgvrhfuihiivgepie X-RazorGate-Vade-Classification: clean X-RazorGate-Vade-Verdict: clean 0 X-VadeSecure-score: verdict=clean score=0/300, class=clean X-SNCR-VADESECURE: CLEAN X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedtgedrhedtgddutdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkuffhvfffjghftgfoggfgsehtjeertdertdejnecuhfhrohhmpeftihgthhgrrhguucfjrghinhgvshcuoehrihgthhgrrhgupggtpghhrghinhgvshessghtihhnthgvrhhnvghtrdgtohhmqeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeekiedrudefgedrvddttddrkeelnecurfgrrhgrmhephhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepkeeirddufeegrddvtddtrdekledpmhgrihhlfhhrohhmpeeorhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomheqnecuvehluhhsthgvrhfuihiivgeptd X-RazorGate-Vade-Classification: clean X-RazorGate-Vade-Verdict: clean 0 X-VadeSecure-score: verdict=clean score=0/300, class=clean X-SNCR-VADESECURE: CLEAN X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedtgedrhedtgddutdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkuffhvfffjghftgfoggfgsehtjeertdertdejnecuhfhrohhmpeftihgthhgrrhguucfjrghinhgvshcuoehrihgthhgrrhgupggtpghhrghinhgvshessghtihhnthgvrhhnvghtrdgtohhmqeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeekiedrudefgedrvddttddrkeelnecurfgrrhgrmhephhgvlhhopehlohgtrghlhhhoshhtrdhlohgtrghlughomhgrihhnpdhinhgvthepkeeirddufeegrddvtddtrdekledpmhgrihhlfhhrohhmpeeorhhitghhrghruggptggphhgrihhnvghssegsthhinhhtvghrnhgvthdrtghomheqnecuvehluhhsthgvrhfuihiivgepvd Received: from localhost.localdomain (86.134.200.89) by rgout08.bt.lon5.cpcloud.co.uk (9.0.019.26-1) (authenticated as richard_c_haines@btinternet.com) id 5ABD0B0E00BAA29C; Sat, 7 Apr 2018 17:54:16 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com; s=btcpcloud; t=1523120440; bh=TZvzcGMPuQ1I4hxtBt/ViVtxZpAD8LvlE1sl9iBA3AE=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References:X-Mailer:Mime-Version; b=gZPaPJfAfhB0eEhdPkT79ZqKlGcTErT6/4UVpUKB8x3bVpPU26estc5pbDUw444yAzJdbt/J+zF6bsxlinLymAleY9QhC4NcsWOI3l90sZm/m/LHXMLzmYzt/tFtj68LgkCKR7q0tNg0Oq9FVwPEtJEd6uPWl6r99ojJlNqL1YA= Message-ID: <1523120055.31267.13.camel@btinternet.com> Subject: Re: [GIT PULL] SELinux patches for v4.17 From: Richard Haines To: Linus Torvalds , Paul Moore , Xin Long Cc: selinux@tycho.nsa.gov, LSM List , Linux Kernel Mailing List Date: Sat, 07 Apr 2018 17:54:15 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.5 (3.26.5-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-04-06 at 16:07 -0700, Linus Torvalds wrote: > On Tue, Apr 3, 2018 at 6:37 PM, Paul Moore > wrote: > > > > Everything passes the selinux-testsuite, but there are a few known > > merge conflicts. The first is with the netdev tree and is in > > net/sctp/socket.c. Unfortunately it is a bit ugly, thankfully > > Stephen > > Rothwell has already done the heavy lifting in resolving the merge > > for > > you, and the SCTP folks have given his merge patch a thumbs-up. > > I ended up re-doing the merge, and it looks like some more sctp > changes happened after Stephen's merge anyway, so mine didn't end up > quite like his. > > Adding Xin Long to see if he can verify it again, but it all *looks* > sane. > > While looking at it, it struck me that the new security hooks don't > seem to hook into __sctp_connect(), which also does that > > scope = sctp_scope(&to); > asoc = sctp_association_new(ep, sk, scope, > GFP_KERNEL); > > thing. Is that intentional? The sendmsg case does that > security_sctp_bind_connect, the actual __sctp_connect() does not. > > This is not because I screwed up the merge - it's that way in the > SELinux tree too. And I obviously _left_ it that way, but while doing > the merge and trying to understand what was going on, this struck me. > > I'm probably missing something really obvious why the connect case > doesn't want to do it thgere. > > NOTE! I do see it being done in __sctp_setsockopt_connectx(). But > __sctp_connect() has another caller (in sctp_connect()) which doesn't > have that security_sctp_bind_connect() call. > > So please check my resolution, but also somebody should tell me > "Linus, you're a cretin, sctp_connect() doesn't want that > security_sctp_bind_connect() at all because it was already done by > XYZ" > > Linus Thought I would answer the questions as I wrote the SELinux/SCTP patches. sctp_connect() or __sctp_connect() do not need to call security_sctp_bind_connect(). This is because the connect(2) call will handle the checks required via security_socket_connect(): connect(2) | SYSCALL_DEFINE3(connect, ....) | security_socket_connect() | sctp_connect() SCTP uses security_sctp_bind_connect() as this can handle one or more addresses for either sctp_connectx(3) or sctp_bindx(3). It is also used for handling the sendmsg(2) and sctp_sendmsg(3) calls in SCTP for a new association (that is effectively a "connect"). Hope this helps Richard > -- > To unsubscribe from this list: send the line "unsubscribe linux- > security-module" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html