From patchwork Mon Jul 3 10:37:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Freudenberger X-Patchwork-Id: 9822473 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DD7C660237 for ; Mon, 3 Jul 2017 10:38:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE7FE28174 for ; Mon, 3 Jul 2017 10:38:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1AF328503; Mon, 3 Jul 2017 10:38:24 +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=-6.9 required=2.0 tests=BAYES_00,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 4547C28174 for ; Mon, 3 Jul 2017 10:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753438AbdGCKiX (ORCPT ); Mon, 3 Jul 2017 06:38:23 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50279 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753413AbdGCKiW (ORCPT ); Mon, 3 Jul 2017 06:38:22 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v63AYBf5120358 for ; Mon, 3 Jul 2017 06:38:22 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bfhghy1v8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 03 Jul 2017 06:38:21 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Jul 2017 11:38:19 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 3 Jul 2017 11:38:17 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v63AcHvX11731228; Mon, 3 Jul 2017 10:38:17 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9345852049; Mon, 3 Jul 2017 10:34:44 +0100 (BST) Received: from mymint.boeblingen.de.ibm.com (unknown [9.152.224.51]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 45FBB5204C; Mon, 3 Jul 2017 10:34:44 +0100 (BST) From: Harald Freudenberger To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, arnd@arndb.de, gregkh@linuxfoundation.org, schwidefsky@de.ibm.com, Christian.Rund@de.ibm.com, Harald Freudenberger Subject: [PATCH] crypto: change hwrng device default permissions to 0444 Date: Mon, 3 Jul 2017 12:37:59 +0200 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 17070310-0012-0000-0000-0000055CE5AF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17070310-0013-0000-0000-000018CF44CD Message-Id: <1499078279-19135-1-git-send-email-freude@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-03_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707030177 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently /dev/hwrng uses default device node permissions which is 0600. So by default the device node is not accessible by an ordinary user. Some distros do rewrite the device node permissions via udev rule, others don't. This patch provides 0444 as the new mode value and so makes the device node accessible for all users without the need to have udev rules rewriting the access rights. Signed-off-by: Harald Freudenberger --- drivers/char/hw_random/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 503a41d..4093db5 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char/hw_random/core.c @@ -285,6 +285,7 @@ static struct miscdevice rng_miscdev = { .minor = HWRNG_MINOR, .name = RNG_MODULE_NAME, .nodename = "hwrng", + .mode = 0444, .fops = &rng_chrdev_ops, .groups = rng_dev_groups, };