Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1862063pxk; Tue, 1 Sep 2020 09:28:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMMO9UOJtrvKAKJcQvTX2RJdhHKNSmKCCk7mdk+dcXFAgi1XanETiqeRMwNZN414oOUn6P X-Received: by 2002:a17:906:5f8f:: with SMTP id a15mr2345300eju.291.1598977694425; Tue, 01 Sep 2020 09:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598977694; cv=none; d=google.com; s=arc-20160816; b=Fqfs7GP6bNsQ4NHRhQ40S7vU+lDFKMNoF3eVPPauC4j5Ek9sjHUeS5FAr2/3wnvnqR 2Um1frWYDY8wKDAmlUvB+JvlSSgSaWBfz48eQZ3ZT3Fkediuv33rOzBCkiiAbKTGu6iD PaDnHmmCrWV7OYFsgs6eluH0id0mOICb7UC9cjjrwg09ixk6Uw23E6vdWNK4LRq43bqh 0nXYArO630RWoZa87BLa7GcFTOIQeemtCUhWnfnN8KoWjxO8W1jzNKngWK9XgPcTZIkS ODI/lcTeJQcircnoezspWOGXGpOxdNaJr0PKq8VsvCoiaLLc7kedvvLReBldwSBJkaWL Mojw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DCVhL1ZYQZ/22NoSfVaU5SfSk2cz/Z2rvr8f2hgBXYE=; b=WB2+KKuMvQatRgFBHEDB2EJlA+ZkDZkzSJA5OR/h0DlBdEhvLYtjWM/M580zJMK3G4 QvidUh577/am6clWZTz7K21QqLA/O96penX9jUYxaczla+zedMn29iVrTiXbQKu9Ocr2 OWqJUrT1YBYJpp9Yjy/KlYFa9ttFw+3D1WcAyjyB45RMPcXUsBMYw5kBigAQC2Mm2lIt Z8c+9+kGnnoAjwy7bONbu4TrylLnunzqzHt8QdCDjTzF3YmLYQBozgIDmnW04OqiR6hJ Ozy+9ycuPBm5RjIBYl2BFmzzIYd2cDFzIjKkSt/K9z57yE77H3aAc9l+2fCa9mLdcjHs 83JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=hSk2aRha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si852375eja.645.2020.09.01.09.27.50; Tue, 01 Sep 2020 09:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=hSk2aRha; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731149AbgIAQZG (ORCPT + 99 others); Tue, 1 Sep 2020 12:25:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730900AbgIAPcH (ORCPT ); Tue, 1 Sep 2020 11:32:07 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91213C061245 for ; Tue, 1 Sep 2020 08:32:06 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id z22so2269548ejl.7 for ; Tue, 01 Sep 2020 08:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DCVhL1ZYQZ/22NoSfVaU5SfSk2cz/Z2rvr8f2hgBXYE=; b=hSk2aRhaoXQzHn2L9qxNLKMKe4q2ytVWr9XD8EZBuMQvnu6eTMXe0V3J5EoiDegMzv nh7Vh47lF6rk5+eLg1mT8/kLFHD4WfIZYPSnveptzFnhbE0VrxtXagjjCnw1KfMtTExd VEz1v3zTyFk7QODgF52sMUfMKdxKbdWECSpMIVSnWAmM6K6boqfz+9Hdogf4uqvR5iPd 2tqUjYPXzv69BmZ+Tkx4GGmJ2JjIR0JPhyDl7KhkWD+rQYnW1Xh+Ki0u63+yGtksuAjs 1MWVIawm0T6qXF2c4YxFPjdRZ9n30E7CoIQ8sSMmku9JHy6WC+/U6Q+fxCVl2a4afBTn cmxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DCVhL1ZYQZ/22NoSfVaU5SfSk2cz/Z2rvr8f2hgBXYE=; b=g/hPz0tbIE5ShecctJGJSsYJvEkW64IebxtE60/LA7bdZqZCveKtByPdgnaCMkWIm8 RRSJgktNudM6vY7GI31EFPRCaawUUZtRH+/FT48+YLJcWZnujwy529sOoy/KEXaATUFC jZO5E9FsxNTReTL1DdMlb9J3gdq/hwOB4iEpkj7Gh9uZCgi01QZlHQqyfRzGyszMHFa7 ovGeMHnsyMzdsAe4Qsj/b0+BnbHcnGQw77DrM33EqC3NrbTi4z4LYUIcvEfvHapaKTze tY0owI5CDbSt2TKWmN0jjl1atQb0SanweBlupE0UWYq0Y0qANQkw433ubdCvdfl4wTDB yLpA== X-Gm-Message-State: AOAM530KMADi6EbV0c4G4dSyUndsvCxoI73rWpA4YUPBZg0JCwZkeahX KNvP1Bx24apsGsCWQ8wiXVqI34vPeK+Jq35GJvf1 X-Received: by 2002:a17:906:5205:: with SMTP id g5mr1887861ejm.488.1598974325033; Tue, 01 Sep 2020 08:32:05 -0700 (PDT) MIME-Version: 1.0 References: <20200824132252.31261-1-peter.enderborg@sony.com> <20200824132252.31261-2-peter.enderborg@sony.com> <6cbe5d27-ebb2-70a6-bad4-31c9f310eff2@sony.com> <59fa190f-37c0-79f3-ea46-8f821d820e1c@sony.com> <000e6a1b-6026-5e99-9a92-6ae9aafc07d4@sony.com> In-Reply-To: <000e6a1b-6026-5e99-9a92-6ae9aafc07d4@sony.com> From: Paul Moore Date: Tue, 1 Sep 2020 11:31:53 -0400 Message-ID: Subject: Re: [RFC PATCH] selinux: Add denied trace with permssion filter To: peter enderborg Cc: linux-kernel@vger.kernel.org, SElinux list , Steven Rostedt , Stephen Smalley Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 31, 2020 at 11:34 AM peter enderborg wrote: > On 8/31/20 4:16 PM, Paul Moore wrote: > > On Thu, Aug 27, 2020 at 10:04 AM peter enderborg wrote: ... > >> Im happly fine with replacing the selinux_audited with selinux_denied. However it is the case where there are more than one denial at the same time. Im not sure how and when it might happen. > > One thing I wondered about was why not build up a single string with > > all of the permissions instead of generating multiple trace events? > > In the previous discussion it was implied that this was due to > > limitations in the tracing subsystem's filtering, and based on the > > discussion thus far I'm guessing there is little desire for this > > information if it can't be filtered on? > > The information is of course as essential as for audit messages. > I dont see much of the problem with having as the first suggestion with > a list. It works fine for trace_pipe. It is not failing due to that we can not > filter with that. I don't really have much personal experience with the kernel tracing tools, so an example would be helpful as I'm not really following what you are saying. Are you talking about something like "permission=foo,bar,baz"? > It is cause in other tools in user-space > that needs a plugin to parse it. It need static > mapping for something that is not really static. Not in runtime, and it will > change over time. I think we've all come to the conclusion that doing the permission bitmap-to-string translation in a plugin is not really desirable. > A other idea based on the first one is to have multiple pairs like > > class=file permission=read permission=write permission=open > > but then you need to filter on numeric values that are not static and > I don't know if library can make anything useful from that. Oh, wait, is the issue that the tracing subsystem can't filter on strings? That doesn't seem right, but I can understand why one might want to avoid that for performance reasons. If the tracing subsystem *can* filter on strings, why did you say that in the "perm=foo perm=bar" format one would need to filter on numeric values? I still think I'm missing something here ... -- paul moore www.paul-moore.com