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=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS autolearn=ham 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 7F066C43387 for ; Fri, 11 Jan 2019 01:30:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E48920879 for ; Fri, 11 Jan 2019 01:30:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="R+R1Su+O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728834AbfAKBav (ORCPT ); Thu, 10 Jan 2019 20:30:51 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:40918 "EHLO mail-qt1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727846AbfAKBav (ORCPT ); Thu, 10 Jan 2019 20:30:51 -0500 Received: by mail-qt1-f175.google.com with SMTP id k12so16443104qtf.7 for ; Thu, 10 Jan 2019 17:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Q/JSTHkYWax+XaJieLAx+u6I9xezS08lYSYzhxPPxCU=; b=R+R1Su+OmnQ4uP6PoNMDXNkEgVNmGtkZgBELCIcMSf7lBDUbvcMQDJAtASBd4e6kWS G4CgUNLU4rVBcdC1h7i3Ac5jhp2r7a0tKAQLkzw6GVYJy4d+K54xVlFIldPVTwA8lAco toKOz+9vHhARj8l91sNQ5alC6TPYyr5vsdiIQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Q/JSTHkYWax+XaJieLAx+u6I9xezS08lYSYzhxPPxCU=; b=pSZHg9l1CWJ/6EUz/W20x51a5S5uN8yMvPY80inAkmzWBEulw4Z5Du3YJfW2A4eOcd tND17c7U48AvLUw/mAnH/EBjkvEZYER7c7vFLtk/k54AqsUBL6TbImk/ExidF0kHXBKC 4RuKNIKtx4YLMteZkWjw6sg72LNLARLIleX/f76KV75lOOTKOIOS4XTzaE2gezEaFmUE qB6TFZabML0CY5b2BvM08PyOgfVcF+DbyDqnrztaqBw/1LnBczTjPYDp/98u6K3u1Ufz 1ywSr9rnFczHrTdG6Ebeoawb/fjtPy/bOQlk41VI6bswGgmKmSt05nHZ//ksdzIddzqZ 5L3Q== X-Gm-Message-State: AJcUukeqIoeWRKt+3VxjDF6ZPT7vD5WHtl4JIIz4glhkkpsJGkJYwEzW 67gPRdlBaQ88tBx8xeaZL9ZGH0MpvPY= X-Google-Smtp-Source: ALg8bN4hETyCGlNJ4nuJfiBmMDfpeRhC1nSoyqoiHa/JDx1ejJmF7dZyCwAR32QNZNN/KiDn8xL/6A== X-Received: by 2002:a0c:e789:: with SMTP id x9mr11186367qvn.245.1547170250080; Thu, 10 Jan 2019 17:30:50 -0800 (PST) Received: from [192.168.1.190] (pool-108-15-23-247.bltmmd.fios.verizon.net. [108.15.23.247]) by smtp.gmail.com with ESMTPSA id q5sm65246410qtq.20.2019.01.10.17.30.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 17:30:49 -0800 (PST) Subject: Re: connected_stream_socket_perms To: Russell Coker , selinux-refpolicy@vger.kernel.org References: <1657648.nfkMHCI95s@liv> From: Chris PeBenito Message-ID: Date: Thu, 10 Jan 2019 20:23:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1657648.nfkMHCI95s@liv> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 1/10/19 5:51 AM, Russell Coker wrote: > define(`rw_socket_perms', `{ ioctl read getattr write setattr append bind > connect getopt setopt shutdown }') > > define(`connected_socket_perms', `{ create ioctl read getattr write setattr > append bind getopt setopt shutdown }') > > The difference between these 2 is that connected_socket_perms includes create > while rw_socket_perms has connect. Why doesn't rw_socket_perms have create? > Or if we are saying "rw_socket_perms only means reading and writing" then why > does it have connect? > > Does this all make sense? > > I expect that a lot of policy has been written based on using whichever of > those macros seems to match an audit2allow rule and vaguely match the concept > of what someone imagines the program in question is doing. > > Would it make sense to have another macro defined to { ioctl read getattr write > setattr append bind getopt setopt shutdown } so that there can be a more > obvious progression of which macro is a superset of which other macro? Those lines are ancient (2005). I'm open to reveisions. I'm definitely eager for better clarity and consistency. -- Chris PeBenito