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=-9.1 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 A97DCC43387 for ; Sat, 12 Jan 2019 08:03:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 78080205F4 for ; Sat, 12 Jan 2019 08:03:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=perfinion-com.20150623.gappssmtp.com header.i=@perfinion-com.20150623.gappssmtp.com header.b="aN/4w6TT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725831AbfALIDw (ORCPT ); Sat, 12 Jan 2019 03:03:52 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44220 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbfALIDw (ORCPT ); Sat, 12 Jan 2019 03:03:52 -0500 Received: by mail-pl1-f193.google.com with SMTP id e11so7823926plt.11 for ; Sat, 12 Jan 2019 00:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perfinion-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yzuJoiLfcYkYbwwWDNQoQ02i4ggS3rgeYOlu6ogsN0A=; b=aN/4w6TTbUjltKxGJKy9FP74zBE5xc6dUswhffd9C2OAwG6FA723bhTkcymNzOULS0 ll9yyKI24UCNZepZRJ1o4Q8UhY4v5ff9fJ/33AwPL2g72aGkxMxaAa3KtY25W4pzn7SF JM7oNCyOroANcqGhQ33qu2jfB61eQOSfCtyD+JCE9An8hxWscejXEk3Wip9CWJb2sVyq M/pzVrJmGjhixQNatD06idG0zO/8S5WEKUUagM8dByuQ+nC2Mqp6Jl2yn+9n3Fj/2rLU odO7f2FvdXfPyEOyKNDoKbIyPucHJsMFtTasXG6jLqckTXYkSN4BloFUt89fNWxQc/US YTOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yzuJoiLfcYkYbwwWDNQoQ02i4ggS3rgeYOlu6ogsN0A=; b=AmtmoVPDFkj83OCcWovF13qIe/YR59YWCIBhIIv9CPKsdx/yKoF8CRq5lISvtGXwFq 9KjHfIGTazLlmVCOAfOhpTUlDT04gd5mPzYJeEKJJ1NJCVtm15MJFkvGi5//tzMTchgi R88gRX/kEZusZ1i7yw6iipoMMFaC1vV+jIctvfzUTqpdVIQZnd439p/UKyiZzjR92K+i 5KHsZBEVs9Tb86gqxkuUuqYZ96pLcW6IlHyACY6mt6Qaj+HavoxKwQLSGA8ISB/ABbpN dxTUqRma1PFQoHpnHkzoa62S3gK20wT3D9uk1PPTFyI8LO8j2EQJVJGcO1hrjtUAgv20 9NdA== X-Gm-Message-State: AJcUukdk10ako42GOL8VwTKjcHJTfiJaxr7ShLjQ1I5ujMzx6NAbXSSl kckrilVWxHqa3DYYkZhWK3icbsztw5I= X-Google-Smtp-Source: ALg8bN6kON9yFHT0ZbVSi0XSJpqit33InJtJ4+QQ9NBA70Hbup4O6nCtpyyYaoaLGuq+vWfABflWGQ== X-Received: by 2002:a17:902:6909:: with SMTP id j9mr17251073plk.196.1547280230815; Sat, 12 Jan 2019 00:03:50 -0800 (PST) Received: from localhost ([2406:3003:2002:40c2:7952:f8f0:5b6c:6fa3]) by smtp.gmail.com with ESMTPSA id g190sm98319624pgc.28.2019.01.12.00.03.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jan 2019 00:03:49 -0800 (PST) From: Jason Zaman To: selinux-refpolicy@vger.kernel.org Cc: Jason Zaman Subject: [PATCH 1/5] devices: introduce dev_dontaudit_read_sysfs Date: Sat, 12 Jan 2019 16:03:40 +0800 Message-Id: <20190112080344.10031-1-jason@perfinion.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org Signed-off-by: Jason Zaman --- policy/modules/kernel/devices.if | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/policy/modules/kernel/devices.if b/policy/modules/kernel/devices.if index 65bfcb63..78a95ce8 100644 --- a/policy/modules/kernel/devices.if +++ b/policy/modules/kernel/devices.if @@ -4043,6 +4043,26 @@ interface(`dev_dontaudit_getattr_sysfs',` dontaudit $1 sysfs_t:filesystem getattr; ') +######################################## +## +## Dont audit attempts to read hardware state information +## +## +## +## Domain for which the attempts do not need to be audited +## +## +# +interface(`dev_dontaudit_read_sysfs',` + gen_require(` + type sysfs_t; + ') + + dontaudit $1 sysfs_t:file read_file_perms; + dontaudit $1 sysfs_t:dir list_dir_perms; + dontaudit $1 sysfs_t:lnk_file read_lnk_file_perms; +') + ######################################## ## ## mounton sysfs directories. -- 2.19.2