Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4920978pxu; Thu, 10 Dec 2020 08:32:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxjf64bpSVwNMbZ6vTRN1EZENpClNFIDw1N1T7za5Qrd3N0G7Vc4AW5vOseY4IxEyyjSqHF X-Received: by 2002:a17:906:c248:: with SMTP id bl8mr7103471ejb.343.1607617951979; Thu, 10 Dec 2020 08:32:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607617951; cv=none; d=google.com; s=arc-20160816; b=u9b20WA4rBVzYQDQw0u+lrqS1mXaD+uAYz06fSrY+Rq44ujYbsDLV9Hp/l61kVptjf +h0YElE8GYbslERLHbqn3d2BcmYxDqaPrjpss5pXsZdi0EZ8C1qYkRgfebQ3P/mOZ6Qs BIOcG6n9MZz7qbxLluwDmFVAKB6G19+QNH1EHbSN4OIQq0BIcuSbkXOnap9S7EtC8qvf kFuPTz3jLEz8owRh/pJKT1ggT+jQO6LXJnIp1QnnAu5gKIAWH3w0XO+1P19uxtuQ9vwz v/k1s3vXxb+zPVA1P7ijYMLi+2tRRMu0numOiPmk2aVhzE0CN+oBKzwo/niXPoGFLgA2 Yv8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=9cbVxn9zzPV5xd3nBsx4saRu4ho3WLGzN9SiiPjWnDI=; b=eUV7zDqBtBX9aX0K6qaA+lYhI5frqWbvDAYFZ5DazPqwkrQxepAbaOEUvsVEzMxMaX R5k33bu+nmHEoK7Gfc3RjLFr0nU/+/ax3kALzTN9tW3COTlg8D5oNX54ge5Dsn6A4VNL JF2OU0tF74acwmdyxAhpSQ4hk9CoiCdZ1FJpMoMs+wQu2V5Q1zvjAdZVa71c5GGkQidg WhB5rOAvQBlnIIZYs+pyibgP1izFEjK9rUXwQ8wsZUA+D0SiqcjUKzVkEOa6lgtvWnZ+ SmmhF1hrAbwwBq1MVV12Bt8TZ29ccXXZtD7yH4Prdo1ZJdXjVx5AP4m3lFKaNZTzzfom X7DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=VG1XsqQs; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si2735638ejt.651.2020.12.10.08.32.25; Thu, 10 Dec 2020 08:32:31 -0800 (PST) Received-SPF: pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=VG1XsqQs; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391334AbgLJQaC (ORCPT + 16 others); 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-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