From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70892C4363A for ; Mon, 26 Oct 2020 20:37:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 39ABE2080A for ; Mon, 26 Oct 2020 20:37:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388586AbgJZUht (ORCPT ); Mon, 26 Oct 2020 16:37:49 -0400 Received: from namei.org ([65.99.196.166]:37980 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388577AbgJZUht (ORCPT ); Mon, 26 Oct 2020 16:37:49 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id 09QKbbkE009912; Mon, 26 Oct 2020 20:37:38 GMT Date: Tue, 27 Oct 2020 07:37:37 +1100 (AEDT) From: James Morris To: Jeff Vander Stoep cc: "David S. Miller" , Jakub Kicinski , linux-security-module@vger.kernel.org, Roman Kiryanov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vsock: use ns_capable_noaudit() on socket create In-Reply-To: <20201023143757.377574-1-jeffv@google.com> Message-ID: References: <20201023143757.377574-1-jeffv@google.com> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: On Fri, 23 Oct 2020, Jeff Vander Stoep wrote: > During __vsock_create() CAP_NET_ADMIN is used to determine if the > vsock_sock->trusted should be set to true. This value is used later > for determing if a remote connection should be allowed to connect > to a restricted VM. Unfortunately, if the caller doesn't have > CAP_NET_ADMIN, an audit message such as an selinux denial is > generated even if the caller does not want a trusted socket. > > Logging errors on success is confusing. To avoid this, switch the > capable(CAP_NET_ADMIN) check to the noaudit version. > > Reported-by: Roman Kiryanov > https://android-review.googlesource.com/c/device/generic/goldfish/+/1468545/ > Signed-off-by: Jeff Vander Stoep Reviewed-by: James Morris -- James Morris