Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751189AbdIOE65 (ORCPT ); Fri, 15 Sep 2017 00:58:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58880 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751152AbdIOE64 (ORCPT ); Fri, 15 Sep 2017 00:58:56 -0400 From: Mimi Zohar To: linux-security-module@vger.kernel.org Cc: Mimi Zohar , linux-ima-devel@lists.sourceforge.net, Christoph Hellwig , Linus Torvalds , James Morris , Linux Kernel Mailing List Subject: [PATCH 1/3] vfs: constify path argument to kernel_read_file_from_path Date: Fri, 15 Sep 2017 00:58:12 -0400 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505451494-30228-1-git-send-email-zohar@linux.vnet.ibm.com> References: <1505451494-30228-1-git-send-email-zohar@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17091504-0016-0000-0000-0000026507F8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091504-0017-0000-0000-000006EA0E8E Message-Id: <1505451494-30228-2-git-send-email-zohar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-09-15_02:,, 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-1707230000 definitions=main-1709150073 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1948 Lines: 50 This patch constifies the path argument to kernel_read_file_from_path. Signed-off-by: Mimi Zohar --- fs/exec.c | 2 +- include/linux/fs.h | 2 +- sound/oss/sound_firmware.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/exec.c b/fs/exec.c index 62175cbcc801..54a4847649cc 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -974,7 +974,7 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size, } EXPORT_SYMBOL_GPL(kernel_read_file); -int kernel_read_file_from_path(char *path, void **buf, loff_t *size, +int kernel_read_file_from_path(const char *path, void **buf, loff_t *size, loff_t max_size, enum kernel_read_file_id id) { struct file *file; diff --git a/include/linux/fs.h b/include/linux/fs.h index fdec9b763b54..d783cc8340de 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2775,7 +2775,7 @@ static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id) extern int kernel_read(struct file *, loff_t, char *, unsigned long); extern int kernel_read_file(struct file *, void **, loff_t *, loff_t, enum kernel_read_file_id); -extern int kernel_read_file_from_path(char *, void **, loff_t *, loff_t, +extern int kernel_read_file_from_path(const char *, void **, loff_t *, loff_t, enum kernel_read_file_id); extern int kernel_read_file_from_fd(int, void **, loff_t *, loff_t, enum kernel_read_file_id); diff --git a/sound/oss/sound_firmware.h b/sound/oss/sound_firmware.h index da4c67e005ed..2be465277ba0 100644 --- a/sound/oss/sound_firmware.h +++ b/sound/oss/sound_firmware.h @@ -21,7 +21,7 @@ static inline int mod_firmware_load(const char *fn, char **fp) loff_t size; int err; - err = kernel_read_file_from_path((char *)fn, (void **)fp, &size, + err = kernel_read_file_from_path(fn, (void **)fp, &size, 131072, READING_FIRMWARE); if (err < 0) return 0; -- 2.7.4