From patchwork Wed Oct 7 16:35:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 54611 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 387C222FF8 for ; Wed, 7 Oct 2015 16:35:26 +0000 (UTC) Received: by wisv5 with SMTP id v5sf11783338wis.0 for ; Wed, 07 Oct 2015 09:35:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=qrJn5veefxcxThIzmpFHsjxxcMCrg4wuCFOQqY8yy7U=; b=Ng5JMnlHpTB4Wg85JmmpHz0XTymxv9hXT4stF9v0MJuiU0YV2OSBSVPBGnrQ6ADFXG OShsQ5IhpYh8kXxkmoOHGcFgsYFxkT37OVt3wWCoC6cGWdLb/M8Qca5qwib68Ph2ptS3 u04/hxevpUCmNhejv677qHyyoY1eRJvHP45vCYjJ5aXTD01x/h5vgxnMFs7gLjXhfPfU IO9pgcARD8n1E4iFnoSQ/czPg0/9ZKM5HbrzzL380EZzWEdEs6IDLM5b/jEMlRNAa/3v +dRxua6Q691f0jLdNnSfmjQ0fIYUVW51UdRd46u5U64HA06eWOXDwSaPCXDnkrNMzIA1 1ulA== X-Gm-Message-State: ALoCoQljXJpELGFXRutIRqN4wqppqlfOEFomxSgUg5RfJlR0kDE3OAa/LgCFPUIqbk+/astJM5fg X-Received: by 10.112.169.34 with SMTP id ab2mr429436lbc.23.1444235725300; Wed, 07 Oct 2015 09:35:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.38.206 with SMTP id m197ls92049lfm.55.gmail; Wed, 07 Oct 2015 09:35:25 -0700 (PDT) X-Received: by 10.112.147.10 with SMTP id tg10mr1173641lbb.58.1444235725101; Wed, 07 Oct 2015 09:35:25 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id so9si25853496lbb.137.2015.10.07.09.35.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Oct 2015 09:35:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbwt4 with SMTP id wt4so18013517lbb.1 for ; Wed, 07 Oct 2015 09:35:25 -0700 (PDT) X-Received: by 10.112.168.228 with SMTP id zz4mr1120461lbb.73.1444235724933; Wed, 07 Oct 2015 09:35:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp84069lbq; Wed, 7 Oct 2015 09:35:24 -0700 (PDT) X-Received: by 10.66.97.102 with SMTP id dz6mr2108264pab.29.1444235723884; Wed, 07 Oct 2015 09:35:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ew2si58938283pbb.249.2015.10.07.09.35.23; Wed, 07 Oct 2015 09:35:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755184AbbJGQfV (ORCPT + 30 others); Wed, 7 Oct 2015 12:35:21 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:33631 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753557AbbJGQfT (ORCPT ); Wed, 7 Oct 2015 12:35:19 -0400 Received: by wiclk2 with SMTP id lk2so222053826wic.0 for ; Wed, 07 Oct 2015 09:35:18 -0700 (PDT) X-Received: by 10.194.175.232 with SMTP id cd8mr2424944wjc.45.1444235718012; Wed, 07 Oct 2015 09:35:18 -0700 (PDT) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id c2sm3294422wiy.11.2015.10.07.09.35.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Oct 2015 09:35:17 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org, andrew@lunn.ch, wxt@rock-chips.com, stefan.wahren@i2se.com, pantelis.antoniou@konsulko.com, maitysanchayan@gmail.com, p.zabel@pengutronix.de, s.hauer@pengutronix.de, srinivas.kandagatla@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] nvmem: core: make default user binary file root-access only Date: Wed, 7 Oct 2015 17:35:14 +0100 Message-Id: <1444235714-24365-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , As required by many providers like at24/at25/mxs-ocotp/qfprom, which would want to allow root-only to read/write the nvmem content. So making the defaults to be root-only access which can prevent normal users from reading the nvmem data. Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 6fd4e5a..4d2e476 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -112,7 +112,7 @@ static ssize_t bin_attr_nvmem_write(struct file *filp, struct kobject *kobj, static struct bin_attribute bin_attr_rw_nvmem = { .attr = { .name = "nvmem", - .mode = S_IWUSR | S_IRUGO, + .mode = S_IWUSR | S_IRUSR, }, .read = bin_attr_nvmem_read, .write = bin_attr_nvmem_write, @@ -136,7 +136,7 @@ static const struct attribute_group *nvmem_rw_dev_groups[] = { static struct bin_attribute bin_attr_ro_nvmem = { .attr = { .name = "nvmem", - .mode = S_IRUGO, + .mode = S_IRUSR, }, .read = bin_attr_nvmem_read, };