Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2300217ybi; Sat, 13 Jul 2019 11:12:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/34OhNcDJ6OhDf2f9rZ9qSRWNLGSHa8uai2t8cHbfC4V0DQgPPOL/u0Hi5uI6x9F3R3/Y X-Received: by 2002:a63:c008:: with SMTP id h8mr14151680pgg.427.1563041545140; Sat, 13 Jul 2019 11:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563041545; cv=none; d=google.com; s=arc-20160816; b=0lzvKLEcsYfn6JddjugPDx5byvbBF7OwkluzWKj21UKi1e8utS5scqSsBDKhm2fNtT G7+0Sw9XcAaRMHJ7LEofSLSL5/alfr2fxneG84vZShnK+1e7Y2H/I+MJMt3vVoOt2IxY t04LSAqrftxFhUt2H7MgZcHZMOu+zKxmljnqACSYFhdMis3g9rTI7L2esEAGxTSaH96d NQz49TNemE24x04Evso8H5AkdlYc1R/F1BqoKnZ3EhtWgyGjQEwBnobaOxka1QRc0yhm 8WQX3Vsdn44MltUGKr3XCe/lCw59JN4Up5D95cs1Mq8TSOaZERVpSpmMa5672Wd3cmuM M4oQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=DbAY4dhhaY05lUpeTT21pBEtXIchiLyH9fhTwOwXF6c=; b=I74MaPrYnoy+Y2gYejUTHO7Qy2fyFs6j5OApoISArR98XWUa/MIpRs6wGUvwntgvwO 6AojpH2ThLZdZO9IOf+glP5EVW84QgGWiOLXD6LhG3uw30gj4GsDyMlKjI3cpTO1fIlK iRPuD0Y1320F0g9DSAFKahFoIL864bQ24SOoxfVIjRqBDCIGCuJMybdagQxsnkUXoMaN CQKjI2JvorkWGCrrAdKF3gzpPDGqLDwYNmF0Hpgy1B+hKt7GqP6J9WAcT9AqtkBHDmn1 fzGKSDx01bVxnx/ejJX8q00t1JOoPZ5vOcU39c7gG8cjYfylFYhAdYkIcg91Rlwihoqj hmmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=UfOt9vLe; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id r9si11322203pjq.35.2019.07.13.11.12.20; Sat, 13 Jul 2019 11:12:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of selinux-refpolicy-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=@ieee.org header.s=google header.b=UfOt9vLe; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 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 S1727874AbfGMSMT (ORCPT + 11 others); Sat, 13 Jul 2019 14:12:19 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:44143 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727834AbfGMSMT (ORCPT ); Sat, 13 Jul 2019 14:12:19 -0400 Received: by mail-qt1-f194.google.com with SMTP id 44so11574595qtg.11 for ; Sat, 13 Jul 2019 11:12:19 -0700 (PDT) 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=DbAY4dhhaY05lUpeTT21pBEtXIchiLyH9fhTwOwXF6c=; b=UfOt9vLe8GDSBbrYyG68hcABQ0guliaqaSGyvxFIWePVoEwM/qmhnwD+PpTjJFcOGf i1+SGbInG+xlgA1poEvgtlLjZ7sExFLuGbE1QuzS1vhRj7KB/ynkCYQh66QSzk2cLHhT l/ieOwVOEX2asPw3EskuPubUJFzKkduTKEVLk= 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=DbAY4dhhaY05lUpeTT21pBEtXIchiLyH9fhTwOwXF6c=; b=Mb4+mNWeMkObq60a961+mK2KEhRHToFNqr3A/NjkfqZVpiM/I78G6eNFBxqHM8Eco6 dafZ/TPKUlo5nZzzew3Su6onelX4RPdVQs5fZRShe7l8eW/m0Y30T2QaWZYeOSc4kayb 7jQA9BoR//CPnQ6cqqb6mxLCZZYC8dpUEKXLzW6w8rqG/4HGoamsJxdhUGjLvQw4aSPN IR0xOFkWxCegkPfwU9gt3YP63k1Gh+X3vMUrKRxwriXXhTShNSojb49LrJ8FO20CJM4A +P96T/5XzkAO75Eimu/tx7memI9QWhHnPkDqJ3lWewQW2LGxuZ6PF1SSaQ1ZAVBm6uqm 1kjQ== X-Gm-Message-State: APjAAAWSGv971a09G4rPmzefkPYr0eqb8Fn74QNyyddqp14yIzOXx9kn lxtcHdS79j3Ws8U4TqJxnw/72kKRmqE= X-Received: by 2002:aed:3595:: with SMTP id c21mr11851152qte.48.1563041538439; Sat, 13 Jul 2019 11:12:18 -0700 (PDT) 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 r40sm6675394qtr.57.2019.07.13.11.12.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jul 2019 11:12:18 -0700 (PDT) Subject: Re: [PATCH 1/1 v2] grant rpm_t permission to map security_t To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20190709151527.13582-1-dsugar@tresys.com> From: Chris PeBenito Message-ID: Date: Sat, 13 Jul 2019 14:08:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190709151527.13582-1-dsugar@tresys.com> 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 7/9/19 11:15 AM, Sugar, David wrote: > type=AVC msg=audit(1560944462.698:217): avc: denied { map } for pid=1265 comm="rpm" path="/sys/fs/selinux/status" dev="selinuxfs" ino=19 scontext=system_u:system_r:rpm_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=file permissive=1 > > v2 - Create new interface to allow mapping security_t and use this interface by rpm_t > > Signed-off-by: Dave Sugar > --- > policy/modules/admin/rpm.te | 1 + > policy/modules/kernel/selinux.if | 20 ++++++++++++++++++++ > 2 files changed, 21 insertions(+) > > diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te > index 3c5968f9..082052fa 100644 > --- a/policy/modules/admin/rpm.te > +++ b/policy/modules/admin/rpm.te > @@ -185,6 +185,7 @@ selinux_compute_access_vector(rpm_t) > selinux_compute_create_context(rpm_t) > selinux_compute_relabel_context(rpm_t) > selinux_compute_user_contexts(rpm_t) > +selinux_map_security_files(rpm_t) > > storage_raw_write_fixed_disk(rpm_t) > storage_raw_read_fixed_disk(rpm_t) > diff --git a/policy/modules/kernel/selinux.if b/policy/modules/kernel/selinux.if > index 6790e5d0..81d8f918 100644 > --- a/policy/modules/kernel/selinux.if > +++ b/policy/modules/kernel/selinux.if > @@ -635,6 +635,26 @@ interface(`selinux_compute_user_contexts',` > allow $1 security_t:security compute_user; > ') > > +######################################## > +## > +## Allows caller to map secuirty_t files. > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > + > +interface(`selinux_map_security_files',` > + gen_require(` > + type security_t; > + ') > + > + dev_search_sysfs($1) > + allow $1 security_t:file map; > +') > + > ######################################## > ## > ## Unconfined access to the SELinux kernel security server. Merged. -- Chris PeBenito