Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp239517pxa; Fri, 21 Aug 2020 06:11:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2IjBC1uYO7fsp4oGp65gWtQoYKaCjrieFwjnsqrLLv6lRbIUuOtx9NMwA58tECWCCh5pz X-Received: by 2002:a17:906:82ca:: with SMTP id a10mr2744139ejy.169.1598015517712; Fri, 21 Aug 2020 06:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598015517; cv=none; d=google.com; s=arc-20160816; b=MxWB4cK8r1AkV3adL0QCyu7h8KjPWwJL3mLv6+tYv/YyM505Urn4H6vyGW9hFueU+c yt81JnvMdnoQjgeMNg4XGhs738Q3k/2MLLzYEM9O0X8P4xdcMZ9FBrR1sq9KC6bWMrPH 1OvrTGthGcF7MfPVVklD1fPmlhhi/uOMPHsK+GlvPTfwg02tNzEowG1SBfgsUuehsSMw Pw0BAgHRx/IslWC2zKjFEdTw5vptkRL+ficrRX19iivzDMOyiFyCepLdhlJqy0Ed02zF 7PiyYVnr5UerdHogqaSnosdl+oaGa2BvF5k14kz3T2tbvzPCwUsOL1Bl4Rx0b/gaZ+ZM u4lA== 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=0OZLx+a/nSQcE7lQdpLIV/137NKEYeYc+vVq6Ax+/Us=; b=b1cdEhaKkoMK0QXtuBhsR8B2HC9DoZ7+/9gKx4UoH4/5oSKUk0bJMr73pr8MvUiZkG VbUhPg5S2lL1wi76h6M27G/1yCCPjxkWr95MZ8HCCgGewJ23DMCePYZy/i9qSPjQ5KCY MMu8i2YN2ojvcQsqqsP7T+pn5sWXmMERWJ2bfdJZrjPhHz0jjmB+J9GTy2myuz7uZqKS eWzi2k5atl1Qo1738eqVMZe6SBaSGddUlDoPU3sLTl4PTH9AksHjGOWVCNp4vTc+dgVH YNw6jKKNBDQQxA/1VlIB5YurKmW+b9hNqlNSfPLLZcfj3lmFzYRlNW8mKUYBtcwf/uC+ 7vtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=ZaYfub8f; 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 q8si1125581ejm.507.2020.08.21.06.11.33; Fri, 21 Aug 2020 06:11:57 -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=ZaYfub8f; 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 S1728633AbgHUNLA (ORCPT + 99 others); Fri, 21 Aug 2020 09:11:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727942AbgHUNK7 (ORCPT ); Fri, 21 Aug 2020 09:10:59 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D83C061386 for ; Fri, 21 Aug 2020 06:10:58 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id md23so1429904ejb.6 for ; Fri, 21 Aug 2020 06:10:58 -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=0OZLx+a/nSQcE7lQdpLIV/137NKEYeYc+vVq6Ax+/Us=; b=ZaYfub8fe77pPgsvZfW8Zc4FcYt8oZN0UCtpyAacgVXaWup8KKTmQKUad7W88SvSxH xpE9Tq+lW84yYf+VUBfXZBxR/AeVok4P0MxBhl9fNbruLFI8K7lTt+w8Yjsd1DT34IJk Wz2wZedQHFfr8jIftz/ZcPBofnKK52Rxd/S8im3bg/wKNYkGpDf388CinN3RERYFWeRF ndY3/nMIM5t0ZIsJxHbl+oX4LOYkKwbcsKXtL6UloDv2VctqK2cmD/zGklZip3mmcWHB PWAmdAS4ZRtRNy9jp49obXFGotMBF5ogailGh0clq9PaAFfcRkgZb3noyt6AM0TDci3X YPnQ== 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=0OZLx+a/nSQcE7lQdpLIV/137NKEYeYc+vVq6Ax+/Us=; b=tR3c660hmi3KjCfHYBoul/e90deY5uWsCGZ6Nj5KghEv9jpU92wmSlQGrGlMghJq1U EazKS190jgaUT6yExaVjhIst/w/rAiL8ehJf1p2RGZlb1bD9dBPnAKzI8A2y+LkF8Xop q3QeuqbC0ZUD0UCMv2S9y0EGfq0SLD3JETQJftwwetacnjwvhD77tNnxg5RcQYzwmGEA Q1xL7F2LS1iPGT2/HEwp6zvu0uVOv8uEKhBU1pFDMZn41KG7BAMyszxmlCvRqwgaWgnM BWDXZSm80E13EDVYFEPffe8BKz/sqPmjkYuy48rmqAuSlpw6t+CwiBP+TerkgxB2W4dv sWtg== X-Gm-Message-State: AOAM532saaag4juOsYkdNBXAz6JL1MoOhYrNaJB573CxfKrwWuqjE+Ws MpIt7zbekQWXEk/CfkK0os4L+SZhdw7ALRcA/VKV X-Received: by 2002:a17:906:43c9:: with SMTP id j9mr2755928ejn.542.1598015457398; Fri, 21 Aug 2020 06:10:57 -0700 (PDT) MIME-Version: 1.0 References: <20200817170729.2605279-1-tweek@google.com> <20200817170729.2605279-4-tweek@google.com> <6730ec4a-d11b-5c05-b64f-380104a86dab@sony.com> In-Reply-To: From: Paul Moore Date: Fri, 21 Aug 2020 09:10:45 -0400 Message-ID: Subject: Re: [PATCH v3 3/3] selinux: add permission names to trace event To: Stephen Smalley Cc: peter enderborg , =?UTF-8?Q?Thi=C3=A9baud_Weksteen?= , Nick Kralevich , Steven Rostedt , Eric Paris , Ingo Molnar , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , linux-kernel , SElinux list 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 Fri, Aug 21, 2020 at 8:15 AM Stephen Smalley wrote: > > On Thu, Aug 20, 2020 at 10:22 PM Paul Moore wrote: > > > > On Tue, Aug 18, 2020 at 8:14 AM Stephen Smalley > > wrote: > > > On Tue, Aug 18, 2020 at 4:11 AM peter enderborg wrote: > > > > ... > > > > > > Is there any other things we need to fix? A part 1&2 now OK? > > > > > > They looked ok to me, but Paul should review them. > > > > Patches 1 and 2 look fine to me with the small nits that Stephen > > pointed out corrected. I'm glad to see the information in string form > > now, I think that will be a big help for people making use of this. > > > > Unfortunately, I'm a little concerned about patch 3 for the reason > > Stephen already mentioned. While changes to the class mapping are > > infrequent, they do happen, and I'm not very excited about adding it > > to the userspace kAPI via a header. Considering that the tracing > > tools are going to be running on the same system that is being > > inspected, perhaps the tracing tools could inspect > > /sys/fs/selinux/class at runtime to query the permission mappings? > > Stephen, is there a libselinux API which does this already? > > There is a libselinux API but both it and the /sys/fs/selinux/class > tree is exposing the policy values for classes/permissions, not the > kernel-private indices. The dynamic class/perm mapping support > introduced a layer of indirection between them. The tracepoint is in > the avc and therefore dealing with the kernel-private values, not the > policy values. The mapping occurs on entry/exit of the security > server functions. So there is no way for userspace to read the kernel > class/perm values. We'd just need to keep them in sync manually. And > one is allowed to insert new classes or permissions before existing > ones, thereby changing the values of existing ones, or even to remove > them. Ah, okay, thanks. Can you tell I've never really had to look very closely at that code ;) -- paul moore www.paul-moore.com