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=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 A38EEC433FE for ; Thu, 10 Dec 2020 16:30:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 523E523D39 for ; Thu, 10 Dec 2020 16:30:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391334AbgLJQaC (ORCPT ); Thu, 10 Dec 2020 11:30:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391399AbgLJQ3w (ORCPT ); Thu, 10 Dec 2020 11:29:52 -0500 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D15C061793 for ; Thu, 10 Dec 2020 08:29:12 -0800 (PST) Received: by mail-qt1-x82a.google.com with SMTP id u21so4051139qtw.11 for ; Thu, 10 Dec 2020 08:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9cbVxn9zzPV5xd3nBsx4saRu4ho3WLGzN9SiiPjWnDI=; b=VG1XsqQs1IBW5gIJXlK4kmEz/mMqO+TTn1lyYUAvqYbSbZQYnjtVg0f4ufRbYwQdx2 G2Zv1NwC9cS6diNea21imECP3APd+ETqHgbpQYuTbXdFHPTO5QsrsSug8nF2l1xfJKd6 dgmv70Hp4R96gyBDNkaDNrc7Y7kxf2hInKzOc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9cbVxn9zzPV5xd3nBsx4saRu4ho3WLGzN9SiiPjWnDI=; b=pttK+G211Nl5BwmsU0Mt1JL2BFMplcvvsQbeo5zKVzB2VPkoK/Ci0rLIaeeBj7lNdZ 5tXJDMZN/Rzbasa4j3XlbjOCMPir/K0ISZ7o/uT9Rhe8FuX2aG+e9xpswBnmgtWMn5HD l0GZkvZU8j0T7n1Q4ONqS9My+m701CCWcJx5Q90nfkWDDvYZ/W4OwD6Ks5c/sAQTZ53h tWCpIvST4olqzIAVpGIVapZStewQk5C6H+xDYQdSvjjGPzZr5HnufpGLuIjupNu4SW9L 2MhG1wokfii8xFlzfpjBK2IAmjmk4mQLTy8FO4gg1OJFNMMz1hmEdf3DZ2b4tU+gBStD FeHA== X-Gm-Message-State: AOAM532HM320km7lbfTz5529EwOpsWxsxe0foUmctU/mqDK7Ah4suem8 WewW8xV8/DHb/yGtPcNKmH2t6dFMylVm3Q== X-Google-Smtp-Source: ABdhPJxYBuXB7jleT+NPZa/lvdwZJvnSp2zAHDn6goWNyk9KA5CthWfnh0VbeZrB7UwKSqaoebY6sQ== X-Received: by 2002:ac8:7141:: with SMTP id h1mr9786387qtp.211.1607617751361; Thu, 10 Dec 2020 08:29:11 -0800 (PST) Received: from fedora.pebenito.net (pool-96-234-173-17.bltmmd.fios.verizon.net. [96.234.173.17]) by smtp.gmail.com with ESMTPSA id u20sm3776995qtb.9.2020.12.10.08.29.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Dec 2020 08:29:10 -0800 (PST) Subject: Re: udevadm etc To: Russell Coker Cc: selinux-refpolicy@vger.kernel.org References: <3161997.pUvnUksOUX@liv> <5107170.hMIqiVgsFT@liv> From: Chris PeBenito Message-ID: <42da4ce0-e353-7378-bd20-d15ceff8ce28@ieee.org> Date: Thu, 10 Dec 2020 11:29:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <5107170.hMIqiVgsFT@liv> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 12/9/20 7:02 PM, Russell Coker wrote: > On Thursday, 10 December 2020 9:00:38 AM AEDT Chris PeBenito wrote: >> On 12/9/20 7:38 AM, Russell Coker wrote: >>> In systemd verision 247.1 (which is in Debian/Unstable now) systemd-udevd >>> is a symlink to udevadm. In systemd version 241 (in Debian/Buster) it's >>> not a symlink. The systemd changelog doesn't mention this change so I >>> don't know exactly when it happened. >>> >>> type_transition init_t udevadm_exec_t:process udevadm_t; >>> type_transition initrc_t udevadm_exec_t:process udevadm_t; >>> type_transition sysadm_t udevadm_exec_t:process udevadm_t; >>> type_transition consolekit_t udev_exec_t:process udev_t; >>> type_transition devicekit_disk_t udev_exec_t:process udev_t; >>> type_transition hald_t udev_exec_t:process udev_t; >>> type_transition hotplug_t udev_exec_t:process udev_t; >>> type_transition init_t udev_exec_t:process udev_t; >>> type_transition initrc_t udev_exec_t:process udev_t; >>> type_transition kernel_t udev_exec_t:process udev_t; >>> type_transition virtd_t udev_exec_t:process udev_t; >>> >>> Above is a list of the relevant type_transition rules from refpolicy taken >>> from git 3 days ago (there don't appear to be any udev changes since >>> then). >>> >>> I think that the only thing to do is to have init_t and initrc_t run >>> udevadm in the udev_t domain. >>> >>> Is it worth having a udevadm_t domain just for running it from sysadm_t or >>> should we have that run as udev_t too? >> >> The udevadm_t domain is much smaller than udev_t, and critically doesn't >> have all the device access udev_t has. Systemd merging the binaries into >> one doesn't necessarily mean the policy has to merge too. > > Currently only 3 domains can transition to udevadm_t. 2 of those 3 also > transition to udev_t so they can't use udevadm_t without code changes. The > only remaining domain is sysadm_t. > > The question is not "do we have to merge the policy because systemd merges > binaries" but "should we have a separate domain only used for sysadm_t"? Ah, I misunderstood. The alternate question is, should any of these domains that transition to udev_t actually transition to udevadm_t instead? For a long time udevadm was labeled udev_exec_t. I did some cursory searching in devicekit and I see udisks execs udevadm. I couldn't find any instance of it executing udev, so there is a possibility of udevadm_t being more useful. If it ends up with sysadm_t being the only one that only execs udevadm, then I agree that udevadm_t doesn't provide the hoped benefits. -- Chris PeBenito