From patchwork Thu Jan 3 00:02:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Green X-Patchwork-Id: 10746715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 107B591E for ; Thu, 3 Jan 2019 00:02:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F299E27E71 for ; Thu, 3 Jan 2019 00:02:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E59A428396; Thu, 3 Jan 2019 00:02:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94A8B27E71 for ; Thu, 3 Jan 2019 00:02:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727291AbfACACi (ORCPT ); Wed, 2 Jan 2019 19:02:38 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43749 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfACACi (ORCPT ); Wed, 2 Jan 2019 19:02:38 -0500 Received: by mail-pl1-f196.google.com with SMTP id gn14so15143078plb.10 for ; Wed, 02 Jan 2019 16:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qvGpSFvsCqzZseERB3T3u2tb8jVF4wW/MgWIXQNMIVk=; b=UvuWE7JYujcbQg8Q6cQ1/RLkl5EezdI3Of1cQv21SLRpaQxyOLVMjlVYQOFYGhPIAr DVejTCjSEoZ7vIWMJQMxjP6Avft1ZPFnqQo1gADfBoQ71vIfXZ62BiNvPx5XNhuAnP45 HlNbC4ZC9Du1Pisi5RKUN8wo2pS489xBgvpJU= 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:in-reply-to :references; bh=qvGpSFvsCqzZseERB3T3u2tb8jVF4wW/MgWIXQNMIVk=; b=nf9hYwCAsJ9U7cAeOAKYzi4fL7l/hWkS8RWTrbnN7BOpnY8UxB2uF18dkof8gYSCyj 3I4/T67TMPzbtbg9uKJJcDjfWooWgB0G2kUXGcfYiuImKEqICVQYfcM6l+QicDgWiqff g0agO7gdMJ39Y7qOh/BaRH2UqGBKZMjGHCgdYtS86unYyGHufGdGBrZ9r35IvgV7N6/r q3aQEpVTBZCpqTDTP17Obc/kb7cNsHP6Li7pCRpIe02LWVcsE9xkmeDPizH0xGcQza8a xzZT5oA6MCtr0dMZroyVgiVkzKvrvzCt5B7KXq03RV1w/WzEFtfD8xoqkSvG+C+QtIsZ or6g== X-Gm-Message-State: AJcUukdTaGoqOjRuNr21cKjxVtboJACcTZ5VPcAu0OdoCOhJTZHAUkGX 2+8D+exisWM0qKrUoJbHp94AVQ== X-Google-Smtp-Source: ALg8bN7mdBxCjdkX0G2u8OuINYxJcWasDEVQsvDwhnr3+YYhZLN9P2Tlv7je2kX3McLmLxdoarwoTA== X-Received: by 2002:a17:902:f20b:: with SMTP id gn11mr43437149plb.274.1546473757673; Wed, 02 Jan 2019 16:02:37 -0800 (PST) Received: from evgreen2.mtv.corp.google.com ([2620:15c:202:201:ffda:7716:9afc:1301]) by smtp.gmail.com with ESMTPSA id u6sm60291199pgr.79.2019.01.02.16.02.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Jan 2019 16:02:37 -0800 (PST) From: Evan Green To: Andy Gross Cc: Bjorn Andersson , Brian Norris , Ben Chan , Evan Green , linux-arm-msm@vger.kernel.org, David Brown , linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] soc: qcom: rmtfs-mem: Make sysfs attributes world-readable Date: Wed, 2 Jan 2019 16:02:13 -0800 Message-Id: <20190103000213.230652-3-evgreen@chromium.org> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20190103000213.230652-1-evgreen@chromium.org> References: <20190103000213.230652-1-evgreen@chromium.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to run an rmtfs daemon as an unprivileged user, that user would need access to the phys_addr and size sysfs attributes. Sharing these attributes with unprivileged users doesn't really leak anything sensitive, since if you have access to physical memory, the jig is up anyway. Make those attributes readable by all. Signed-off-by: Evan Green Reviewed-by: Brian Norris Reviewed-by: Bjorn Andersson --- Changes in v3: None Changes in v2: None drivers/soc/qcom/rmtfs_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/rmtfs_mem.c b/drivers/soc/qcom/rmtfs_mem.c index b2fa8fc8016c0..7200d762a9510 100644 --- a/drivers/soc/qcom/rmtfs_mem.c +++ b/drivers/soc/qcom/rmtfs_mem.c @@ -45,9 +45,9 @@ static ssize_t qcom_rmtfs_mem_show(struct device *dev, struct device_attribute *attr, char *buf); -static DEVICE_ATTR(phys_addr, 0400, qcom_rmtfs_mem_show, NULL); -static DEVICE_ATTR(size, 0400, qcom_rmtfs_mem_show, NULL); -static DEVICE_ATTR(client_id, 0400, qcom_rmtfs_mem_show, NULL); +static DEVICE_ATTR(phys_addr, 0444, qcom_rmtfs_mem_show, NULL); +static DEVICE_ATTR(size, 0444, qcom_rmtfs_mem_show, NULL); +static DEVICE_ATTR(client_id, 0444, qcom_rmtfs_mem_show, NULL); static ssize_t qcom_rmtfs_mem_show(struct device *dev, struct device_attribute *attr,