Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3155255pxk; Mon, 21 Sep 2020 06:41:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYmC+77O0XPuKX6IBF8eH6tjeNCWfhkxTRqWcIjY+n7FvASz0glVlKhsA77BLmLaKKCKFD X-Received: by 2002:aa7:c7c2:: with SMTP id o2mr54212165eds.366.1600695662133; Mon, 21 Sep 2020 06:41:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600695662; cv=none; d=google.com; s=arc-20160816; b=Ek0jAMfB0RjnZ/iS6rpspiyZMvD2jqUvXnMj5Y7LQLq2rjxUu77g8wqlNytnb4UG37 Qam5srNCslb1lt+4OAzsDhMYybHdqI28ituQs6GEYxmaxaYzrA2SNk9JqFrrn0cA2MGE Okv0wqXaqYNxFBSX4HZ4jYhQvsmJwAZ1IFolPxFX+0JrM4njvWHpQprHmbKPDcxEO9V9 06WWyQSW+chKTiygtPt1K+U6d3rMgLTUDwqKKOaoHPHN5STQLRC3hLl+AZ3VUWK5GpbQ fBdb74xLopMAUM3ssFMuXTdH1NhFWW7IVfTc3KhPe3COgJEa7Wn4pbQSTM49CowPr46T xLCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ylyiVkvR8OuH1206l+Q6sBqGX7CwiOknrjYvkcbWau8=; b=mIRXUSqlQyxt9HIxqGLDuytMzrAJlQPJ+F9rgJs/GEAxlC4Kc+YwKW/rTp4EUwitCS FNnK/1P+LvrGVlwDcueBiLQeLsmv9a0U1xVkgM5zG6ORlhJqKcdf1iDWghdqvZaQgwCa 6EWtRGHqULhMV5dtsgUTNc7zmxOO1ytrhkPDduen7dO3MYCnlcBTXEIFjSzxCsniDWoH NU2Kv0jhmci6HJIIg60gsx8zWyihQ66MFYdSR7n91P6d7y2tfeNpA1z2aS7lNQoMkLsy 5mgEl2wnK2ROfXoUymRNUcoaM3HiGEicT9lKvL7D0XmI7aa+U78EhGvGpq9qsP6ZB1AJ zxXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rwdfHu+5; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si8446044ejf.457.2020.09.21.06.40.36; Mon, 21 Sep 2020 06:41:02 -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=@gmail.com header.s=20161025 header.b=rwdfHu+5; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727124AbgIUNhL (ORCPT + 99 others); Mon, 21 Sep 2020 09:37:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbgIUNhJ (ORCPT ); Mon, 21 Sep 2020 09:37:09 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70AE7C061755; Mon, 21 Sep 2020 06:37:09 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id l16so255552ilt.13; Mon, 21 Sep 2020 06:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ylyiVkvR8OuH1206l+Q6sBqGX7CwiOknrjYvkcbWau8=; b=rwdfHu+5p8aQ5tEWJINr4zesW7VuXtdI27MeocOZAN53oHo+syQAprO1siIDDLe/Ot H6V7uOuLqTUBuwW6fMajtIWnKiczllFdIfVahO0Kh+Wkw/a6wrjq4cjchNxUpfEqmx4r RP2O2zFVXOCMrVgidJIXobvCtuyk9l6JbV4Qtak7NXkWs/8cusGQvKeCLXPibminO80w GrtseWweWwTuGtpx4GCOg3HusGx+waZZym4rUkSuRt6xYpJM8KAXtNXnJFGqcNR3Oevd SD3y7ytiTP8Dl5SGb9txdy9Fo53WzSgo5u5I/XmUErLMxVW8OWfd0OFyHW6WgeD1WqPV ijuA== 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=ylyiVkvR8OuH1206l+Q6sBqGX7CwiOknrjYvkcbWau8=; b=LIdRLGcCXsQWY2S/jkbkbOosAxlBy8zKdb44vXoAxjYxZdTdnidkNPoCLrRralPPkZ NuyzOYbqyT5RQ+K5OENHSIv7U/zCbUB71sibOKrSuWPasMpNkvAU+zVHfzzU72jmodz3 QJ8+eaaYflZ/s7ztwWnf9oNpNdHJV66D/KtFftWwZZCx5UVkwd9xanz8VFrnHVxiW3NP rMPcwHrhjbMODvQqSYu6lMDbsxAhGXecO1D+5XYYeyQ2BoyKxc7emXEPNx+13W034CEE t64yA4RAB3GapftyCIRa11wRuR5eDcXg8dCDUscfw1Tfr483Owr9DxpXd0qqg9cNuGw3 iB7g== X-Gm-Message-State: AOAM530a8S3oFVUL9cAC0D3KWPV3x3JLTnl2WqkWvKu2rF3MlUgqsU7N IgV5r8jluevSypE4+NIeGMcM6ACwHvdgNcCUOBAT5SzMAZw= X-Received: by 2002:a92:1591:: with SMTP id 17mr6117312ilv.237.1600695428521; Mon, 21 Sep 2020 06:37:08 -0700 (PDT) MIME-Version: 1.0 References: <20200911194549.12780-1-david.e.box@linux.intel.com> <20200911194549.12780-4-david.e.box@linux.intel.com> <0ec64bdc-66fd-4be1-03cf-561a7c42de68@linux.intel.com> In-Reply-To: <0ec64bdc-66fd-4be1-03cf-561a7c42de68@linux.intel.com> From: Alexander Duyck Date: Mon, 21 Sep 2020 06:36:57 -0700 Message-ID: Subject: Re: [PATCH 3/3] platform/x86: Intel PMT Crashlog capability driver To: Alexey Budankov Cc: "David E. Box" , Lee Jones , dvhart@infradead.org, andy@infradead.org, Alexander Duyck , LKML , platform-driver-x86@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 19, 2020 at 1:01 AM Alexey Budankov wrote: > > Hi, > > Thanks for the patches. > > On 11.09.2020 22:45, David E. Box wrote: > > From: Alexander Duyck > > > > Add support for the Intel Platform Monitoring Technology crashlog > > interface. This interface provides a few sysfs values to allow for > > controlling the crashlog telemetry interface as well as a character driver > > to allow for mapping the crashlog memory region so that it can be accessed > > after a crashlog has been recorded. > > > > This driver is meant to only support the server version of the crashlog > > which is identified as crash_type 1 with a version of zero. Currently no > > other types are supported. > > > > Signed-off-by: Alexander Duyck > > Signed-off-by: David E. Box > > --- > > .../ABI/testing/sysfs-class-pmt_crashlog | 66 ++ > > drivers/platform/x86/Kconfig | 10 + > > drivers/platform/x86/Makefile | 1 + > > drivers/platform/x86/intel_pmt_crashlog.c | 588 ++++++++++++++++++ > > 4 files changed, 665 insertions(+) > > create mode 100644 Documentation/ABI/testing/sysfs-class-pmt_crashlog > > create mode 100644 drivers/platform/x86/intel_pmt_crashlog.c > > > > > + > > +/* > > + * devfs > > + */ > > +static int pmt_crashlog_open(struct inode *inode, struct file *filp) > > +{ > > + struct crashlog_entry *entry; > > + struct pci_driver *pci_drv; > > + struct pmt_crashlog_priv *priv; > > + > > + if (!capable(CAP_SYS_ADMIN)) > > + return -EPERM; > > Will not this above still block access to /dev/crashlogX for admin_group users > in case root configured access e.g. similar to this: > > ls -alh /dev/ > crw-rw----. 1 root admin_group 1, 9 Sep 15 18:28 crashlogX > > If yes then that capable() check is probably superfluous and > should be avoided in order not to block access to PMT data. > > Could you please clarify or comment? > > Thanks, > Alexei Actually this should probably be updated to "if (!perfmon_capable())" instead. The telemetry driver code originally had the CAP_SYS_ADMIN check and it probably makes more sense to limit this user-wise to the same users who have access to performon. Thanks. - Alex