From patchwork Tue Dec 18 00:08:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evan Green X-Patchwork-Id: 10734555 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 0D6066C2 for ; Tue, 18 Dec 2018 00:09:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F174929BE7 for ; Tue, 18 Dec 2018 00:09:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E591B29BF1; Tue, 18 Dec 2018 00:09:12 +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 9877229BE7 for ; Tue, 18 Dec 2018 00:09:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbeLRAJJ (ORCPT ); Mon, 17 Dec 2018 19:09:09 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:44378 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbeLRAJI (ORCPT ); Mon, 17 Dec 2018 19:09:08 -0500 Received: by mail-pl1-f196.google.com with SMTP id e11so6252278plt.11 for ; Mon, 17 Dec 2018 16:09:08 -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=CS3SSpVEoM1vQfMSMjWaDpR3zqnEl7pcEwBAFTqfrTg=; b=GPIOEmkULv0u3soaT0ebmmE/N7cgdEYFBVgtrTs2MG+IAkvWzh4Pbxqjkn01Nxzk97 WwgX1ZbLTF/b3sy2sS6g2asTdJKx3Ca2lCQCrMc+yH/rkbkTs48pUu8Eo3TzrYO7W8r9 0gGxvbOK10iCDQm90HKPNwtVndkIlxEf8/WW0= 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=CS3SSpVEoM1vQfMSMjWaDpR3zqnEl7pcEwBAFTqfrTg=; b=AHcSJGl180SQ1Jp33FywHTn5F3aVRqKnYdXQHbnICUirCqJCcJgCCWwvtA5ytxM3H/ Fsqd+ga4mIVnwNv9wbeCJwpY6ErBABU1d63hp+NLclXIZ87tla9lHQGwzvDhLpO121vm jA/dNXJwVUxxWC5HgyFzhSJdKS/eyeeIQwAvc5Ffps+Ck3vhaXdb1tutL/VZ4FIxnwze ul6O1/0PQ+iXdbbDNcqJzXQKTo2iLYf9ZT7TLYp/t9X6adudNB9ISP8FKGNQhTqRC6DT 0vKE/QYf0forGSIdWCF+undhIyDoC1s96yk/dvxUxsvFfbYV2umtrkYRbuIlVnUwPrRw TCaw== X-Gm-Message-State: AA+aEWYwp2s2flveip2EJlfiuW3CPCv42ze7haCzGsvjPMmULcz/elFg jjzDbyI8tHSK55l8+Xt6TBRjNg== X-Google-Smtp-Source: AFSGD/XIQyKORhz9aSBPljWI4z0N+86LPw71SOkmnmGzbWsi8qz5OMu0cGlmcpFpJyO9PCQGv/BEcQ== X-Received: by 2002:a17:902:1126:: with SMTP id d35mr13514187pla.1.1545091747813; Mon, 17 Dec 2018 16:09:07 -0800 (PST) Received: from evgreen2.mtv.corp.google.com ([2620:15c:202:201:ffda:7716:9afc:1301]) by smtp.gmail.com with ESMTPSA id m65sm21734424pfg.180.2018.12.17.16.09.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Dec 2018 16:09:07 -0800 (PST) From: Evan Green To: Andy Gross , Bjorn Andersson Cc: Brian Norris , Ben Chan , Evan Green , linux-arm-msm@vger.kernel.org, David Brown , linux-kernel@vger.kernel.org Subject: [PATCH v1 2/2] soc: qcom: rmtfs-mem: Make sysfs attributes world-readable Date: Mon, 17 Dec 2018 16:08:34 -0800 Message-Id: <20181218000834.201748-3-evgreen@chromium.org> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20181218000834.201748-1-evgreen@chromium.org> References: <20181218000834.201748-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 --- 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 0bf800ee2a978..4eeb9f02e7889 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,