From patchwork Sat Aug 20 18:11:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949741 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 198F1C3F6B0 for ; Sat, 20 Aug 2022 18:11:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbiHTSL1 (ORCPT ); Sat, 20 Aug 2022 14:11:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiHTSL0 (ORCPT ); Sat, 20 Aug 2022 14:11:26 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A56723FA11; Sat, 20 Aug 2022 11:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=iFejAed+UMnGncLV0egPSQoz7oFNyDnBGzFlyTFey3U=; b=EsGZJ6fFqH43WC0HIidZeFWCD7 P1KD0a6wkuLtjzFQINdbVhgoaAOYEWlxiKBWUVgHw7mdQTiPT3z0hotx0gnt6PJfREjvSIpdxIgdt 64gWSZR1VkcHmRLLwY0JHhprs84OV7i3aoG4SXvgU3WSPYzwcIM5ztdwv+ZlBSreqYeIBvoEsLr4n FDUDWUXxlsR0N76MgHOtyAoV7xVymhfWe4pEKdQFZ13BV4hIRd8LmNdM1Q/HJ7TzuCiAfVNWeVICQ XVuUm2RR5KEpksTPT8Els0OyX+47sUE/kg5ZT3xBNc/43tlm3JoRZyFkDIK1CO9kCZBgPETIVrwzH gGymeYpg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSwN-006RTZ-22; Sat, 20 Aug 2022 18:11:23 +0000 Date: Sat, 20 Aug 2022 19:11:23 +0100 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: linux-security-module@vger.kernel.org Subject: Subject: [PATCH 01/11] ->getprocattr(): attribute name is const char *, TYVM... Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org cast of ->d_name.name to char * is completely wrong - nothing is allowed to modify its contents. Signed-off-by: Al Viro Acked-by: Paul Moore Acked-by: Casey Schaufler --- fs/proc/base.c | 2 +- include/linux/lsm_hook_defs.h | 2 +- include/linux/security.h | 4 ++-- security/apparmor/lsm.c | 2 +- security/security.c | 4 ++-- security/selinux/hooks.c | 2 +- security/smack/smack_lsm.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 93f7e3d971e4..e347b8ce140c 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2728,7 +2728,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, return -ESRCH; length = security_getprocattr(task, PROC_I(inode)->op.lsm, - (char*)file->f_path.dentry->d_name.name, + file->f_path.dentry->d_name.name, &p); put_task_struct(task); if (length > 0) diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h index 806448173033..03360d27bedf 100644 --- a/include/linux/lsm_hook_defs.h +++ b/include/linux/lsm_hook_defs.h @@ -253,7 +253,7 @@ LSM_HOOK(int, 0, sem_semop, struct kern_ipc_perm *perm, struct sembuf *sops, LSM_HOOK(int, 0, netlink_send, struct sock *sk, struct sk_buff *skb) LSM_HOOK(void, LSM_RET_VOID, d_instantiate, struct dentry *dentry, struct inode *inode) -LSM_HOOK(int, -EINVAL, getprocattr, struct task_struct *p, char *name, +LSM_HOOK(int, -EINVAL, getprocattr, struct task_struct *p, const char *name, char **value) LSM_HOOK(int, -EINVAL, setprocattr, const char *name, void *value, size_t size) LSM_HOOK(int, 0, ismaclabel, const char *name) diff --git a/include/linux/security.h b/include/linux/security.h index 1bc362cb413f..93488c01d9bd 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -461,7 +461,7 @@ int security_sem_semctl(struct kern_ipc_perm *sma, int cmd); int security_sem_semop(struct kern_ipc_perm *sma, struct sembuf *sops, unsigned nsops, int alter); void security_d_instantiate(struct dentry *dentry, struct inode *inode); -int security_getprocattr(struct task_struct *p, const char *lsm, char *name, +int security_getprocattr(struct task_struct *p, const char *lsm, const char *name, char **value); int security_setprocattr(const char *lsm, const char *name, void *value, size_t size); @@ -1301,7 +1301,7 @@ static inline void security_d_instantiate(struct dentry *dentry, { } static inline int security_getprocattr(struct task_struct *p, const char *lsm, - char *name, char **value) + const char *name, char **value) { return -EINVAL; } diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index e29cade7b662..f56070270c69 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -614,7 +614,7 @@ static int apparmor_sb_pivotroot(const struct path *old_path, return error; } -static int apparmor_getprocattr(struct task_struct *task, char *name, +static int apparmor_getprocattr(struct task_struct *task, const char *name, char **value) { int error = -ENOENT; diff --git a/security/security.c b/security/security.c index 14d30fec8a00..d8227531e2fd 100644 --- a/security/security.c +++ b/security/security.c @@ -2057,8 +2057,8 @@ void security_d_instantiate(struct dentry *dentry, struct inode *inode) } EXPORT_SYMBOL(security_d_instantiate); -int security_getprocattr(struct task_struct *p, const char *lsm, char *name, - char **value) +int security_getprocattr(struct task_struct *p, const char *lsm, + const char *name, char **value) { struct security_hook_list *hp; diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 79573504783b..c8168d19fb96 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -6327,7 +6327,7 @@ static void selinux_d_instantiate(struct dentry *dentry, struct inode *inode) } static int selinux_getprocattr(struct task_struct *p, - char *name, char **value) + const char *name, char **value) { const struct task_security_struct *__tsec; u32 sid; diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 001831458fa2..434b348d8fcd 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -3479,7 +3479,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode) * * Returns the length of the smack label or an error code */ -static int smack_getprocattr(struct task_struct *p, char *name, char **value) +static int smack_getprocattr(struct task_struct *p, const char *name, char **value) { struct smack_known *skp = smk_of_task_struct_obj(p); char *cp; From patchwork Sat Aug 20 18:12:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949744 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C4E3C25B08 for ; Sat, 20 Aug 2022 18:13:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbiHTSNB (ORCPT ); Sat, 20 Aug 2022 14:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbiHTSM6 (ORCPT ); Sat, 20 Aug 2022 14:12:58 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C19E73FA3C for ; Sat, 20 Aug 2022 11:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=qUxCNhcqCYTHTQj3KCybTvh8q4QjTCrfzT8zBH27rNA=; b=SwMldMlWiZ+ZpylSYUn6zcbSnh vAgZ7uVeHOrT59SZzjT+sSyFb3qoHLo17K1JCAeJN3NWCl3kOGbF98cMhzH3WnmKKaUxZImqevYHZ IVzPCOLtg1M7hQ2wEZS11mf18HrstDHcIrHrTQi1duYopL/xatwJLFeUD+S862TvHdNX0OJAuOqlP CWow9QLWr8NwqgerZESU4H6YI0+RULUvUwu/qoG4VdPkw4VKVMGC4HQiF/BKkCKdlnTf9WvDenzsm bZlLWCENIKyXnEX+zOXtf8Wm12qD6uThcQIkY2RWTAunrFi8dMIOYO9gPu5afi1dZ1ph6eX629Xr8 xiXVxtSg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxs-006RVh-6P for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:56 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 02/11] do_sys_name_to_handle(): constify path Date: Sat, 20 Aug 2022 19:12:47 +0100 Message-Id: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/fhandle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fhandle.c b/fs/fhandle.c index 6630c69c23a2..f2bc27d1975e 100644 --- a/fs/fhandle.c +++ b/fs/fhandle.c @@ -14,7 +14,7 @@ #include "internal.h" #include "mount.h" -static long do_sys_name_to_handle(struct path *path, +static long do_sys_name_to_handle(const struct path *path, struct file_handle __user *ufh, int __user *mnt_id) { From patchwork Sat Aug 20 18:12:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C150C25B08 for ; Sat, 20 Aug 2022 18:13:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbiHTSNA (ORCPT ); Sat, 20 Aug 2022 14:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbiHTSM6 (ORCPT ); Sat, 20 Aug 2022 14:12:58 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7D80402E4 for ; Sat, 20 Aug 2022 11:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=y9VDct1kNhpLVe0Vl2FQH64NuOQG8H10L8gy1eVYz0E=; b=Ic9xg4+gy8ptcvrCDMEtlTXY9G z6A9VEqQT9aZP8MyZG+goJQle6nXQV/FCDmQhITkGU0RK0tU+uX1XvL6QFfQvtBkSnIdYpMEy/lJc RogJWXKN5FdDDo8uk1v15FaM3xvXBSmVWE1KM2xGxzCUeYKIN25vFXp27bL2cfgtGvmBrA+ysZMD4 uZYaQs3kIEXeNHpJP6+lOyvxMRBfb9PD/yCLAtrwpsDFsxfL6svlgj3ySMNWbX7IEXIeQSlb810l+ w9GeR/ktCCevAF1zLRDCRIM+bW/qeeLodWU9DmU5STskCn2JUqEQNcNXIsQmHmI5y394O7q16lJq4 BBo8355w==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxs-006RVj-H3 for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:56 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 03/11] may_linkat(): constify path Date: Sat, 20 Aug 2022 19:12:48 +0100 Message-Id: <20220820181256.1535714-2-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/internal.h | 2 +- fs/namei.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/internal.h b/fs/internal.h index 87e96b9024ce..c209b4838d68 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -62,7 +62,7 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *, const char *, unsigned int, struct path *); int do_rmdir(int dfd, struct filename *name); int do_unlinkat(int dfd, struct filename *name); -int may_linkat(struct user_namespace *mnt_userns, struct path *link); +int may_linkat(struct user_namespace *mnt_userns, const struct path *link); int do_renameat2(int olddfd, struct filename *oldname, int newdfd, struct filename *newname, unsigned int flags); int do_mkdirat(int dfd, struct filename *name, umode_t mode); diff --git a/fs/namei.c b/fs/namei.c index 53b4bc094db2..6a5ab1a6f01b 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1178,7 +1178,7 @@ static bool safe_hardlink_source(struct user_namespace *mnt_userns, * * Returns 0 if successful, -ve on error. */ -int may_linkat(struct user_namespace *mnt_userns, struct path *link) +int may_linkat(struct user_namespace *mnt_userns, const struct path *link) { struct inode *inode = link->dentry->d_inode; From patchwork Sat Aug 20 18:12:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 980F3C32789 for ; Sat, 20 Aug 2022 18:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230245AbiHTSNE (ORCPT ); Sat, 20 Aug 2022 14:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbiHTSM6 (ORCPT ); Sat, 20 Aug 2022 14:12:58 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18594402FA for ; Sat, 20 Aug 2022 11:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=GPd/cKguDcNuKK+1y8cQ7h05NIMO0Bv9h0ujIzXv8pg=; b=XmzFWEEP2ZUshG+QLr8fRg2CAB 7KbEVkqdFtYYBdxUcWuWdWqhcIwrdQvxkZOydDETDVErARBQB2ZgfCLnQ9xuRqz8KLSrkrtg1tunE PIYTdGVwl+VMwWcw2iAcsu2mSubbYtjYgql0mOIg14TOhfGnbEwc/rrC6T3ruNbc7MFbVNvkmVzUe gqVLo/8J7XZhl6wLPT3bT1NMS87xUA/8MYhWPMpzDW549zgmBEE58ZAmwFREUw+1sur/3Q9myDTUo 39IP4bKWu6znxW2D7WtjgadqT9dNCLkU/KiJ5JojUQmJsMQ4avEJ59uO1u+jH3FDalskBmWqrJqGI c9jRwNlA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxs-006RVm-KS for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:56 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 04/11] fs/notify: constify path Date: Sat, 20 Aug 2022 19:12:49 +0100 Message-Id: <20220820181256.1535714-3-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro Reviewed-by: Matthew Bobrowski --- fs/notify/fanotify/fanotify.c | 2 +- fs/notify/fanotify/fanotify.h | 2 +- fs/notify/fanotify/fanotify_user.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index cd7d09a569ff..a2a15bc4df28 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -18,7 +18,7 @@ #include "fanotify.h" -static bool fanotify_path_equal(struct path *p1, struct path *p2) +static bool fanotify_path_equal(const struct path *p1, const struct path *p2) { return p1->mnt == p2->mnt && p1->dentry == p2->dentry; } diff --git a/fs/notify/fanotify/fanotify.h b/fs/notify/fanotify/fanotify.h index 1d9f11255c64..bf6d4d38afa0 100644 --- a/fs/notify/fanotify/fanotify.h +++ b/fs/notify/fanotify/fanotify.h @@ -458,7 +458,7 @@ static inline bool fanotify_event_has_path(struct fanotify_event *event) event->type == FANOTIFY_EVENT_TYPE_PATH_PERM; } -static inline struct path *fanotify_event_path(struct fanotify_event *event) +static inline const struct path *fanotify_event_path(struct fanotify_event *event) { if (event->type == FANOTIFY_EVENT_TYPE_PATH) return &FANOTIFY_PE(event)->path; diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index f0e49a406ffa..4546da4a54f9 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -249,7 +249,7 @@ static struct fanotify_event *get_one_event(struct fsnotify_group *group, return event; } -static int create_fd(struct fsnotify_group *group, struct path *path, +static int create_fd(struct fsnotify_group *group, const struct path *path, struct file **file) { int client_fd; @@ -619,7 +619,7 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, char __user *buf, size_t count) { struct fanotify_event_metadata metadata; - struct path *path = fanotify_event_path(event); + const struct path *path = fanotify_event_path(event); struct fanotify_info *info = fanotify_event_info(event); unsigned int info_mode = FAN_GROUP_FLAG(group, FANOTIFY_INFO_MODES); unsigned int pidfd_mode = info_mode & FAN_REPORT_PIDFD; @@ -1553,7 +1553,7 @@ static int fanotify_test_fid(struct dentry *dentry) } static int fanotify_events_supported(struct fsnotify_group *group, - struct path *path, __u64 mask, + const struct path *path, __u64 mask, unsigned int flags) { unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS; From patchwork Sat Aug 20 18:12:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949749 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 649E2C32789 for ; Sat, 20 Aug 2022 18:13:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbiHTSNH (ORCPT ); Sat, 20 Aug 2022 14:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbiHTSNA (ORCPT ); Sat, 20 Aug 2022 14:13:00 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 471FF40546 for ; Sat, 20 Aug 2022 11:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=kcq1X5PcXt7i5mdc+JZmB4onQUe+FLIoAbeac6GOjx8=; b=Yah49HTXl1BoxVQOFajYlQgKWb /46MYMB0ENKeUspbitt8gmIvb6O52kbtHck/+8dsIknSSCotpiI9OPgDERsg8fyjbIOz+xCjLCstb 1adANWQQKVfugeo8WLgeDAvH65C9xOuWrJIBpefeexoOKdJER4+KouCAmjPW1pvffN2rBuVvgELu9 jQQXDOAex+hdk/tA3pUK0hOYkFa1SEz+ksa4qdSVFiNytMCr7H4odYV6V+D88OwuAro1nDlmIYEOH i9n+AlH0N2FMxqFoVZDqrKlvdT9r6ClFoP9UtZpJzdA4XP2j8jYatJyo5351ZwyGcuLhLT4ICEy2+ ikgX8O4w==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxs-006RVq-Qx for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:56 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 05/11] overlayfs: constify path Date: Sat, 20 Aug 2022 19:12:50 +0100 Message-Id: <20220820181256.1535714-4-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/overlayfs/copy_up.c | 12 ++++++------ fs/overlayfs/file.c | 2 +- fs/overlayfs/inode.c | 6 +++--- fs/overlayfs/namei.c | 4 ++-- fs/overlayfs/overlayfs.h | 22 +++++++++++----------- fs/overlayfs/readdir.c | 16 ++++++++-------- fs/overlayfs/super.c | 8 ++++---- fs/overlayfs/util.c | 10 +++++----- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index fdde6c56cc3d..3ffea291c410 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -44,7 +44,7 @@ static bool ovl_must_copy_xattr(const char *name) !strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN); } -int ovl_copy_xattr(struct super_block *sb, struct path *oldpath, struct dentry *new) +int ovl_copy_xattr(struct super_block *sb, const struct path *oldpath, struct dentry *new) { struct dentry *old = oldpath->dentry; ssize_t list_size, size, value_size = 0; @@ -132,8 +132,8 @@ int ovl_copy_xattr(struct super_block *sb, struct path *oldpath, struct dentry * return error; } -static int ovl_copy_fileattr(struct inode *inode, struct path *old, - struct path *new) +static int ovl_copy_fileattr(struct inode *inode, const struct path *old, + const struct path *new) { struct fileattr oldfa = { .flags_valid = true }; struct fileattr newfa = { .flags_valid = true }; @@ -193,8 +193,8 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old, return ovl_real_fileattr_set(new, &newfa); } -static int ovl_copy_up_data(struct ovl_fs *ofs, struct path *old, - struct path *new, loff_t len) +static int ovl_copy_up_data(struct ovl_fs *ofs, const struct path *old, + const struct path *new, loff_t len) { struct file *old_file; struct file *new_file; @@ -872,7 +872,7 @@ static bool ovl_need_meta_copy_up(struct dentry *dentry, umode_t mode, return true; } -static ssize_t ovl_getxattr_value(struct path *path, char *name, char **value) +static ssize_t ovl_getxattr_value(const struct path *path, char *name, char **value) { ssize_t res; char *buf; diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index daff601b5c41..a1a22f58ba18 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -38,7 +38,7 @@ static char ovl_whatisit(struct inode *inode, struct inode *realinode) #define OVL_OPEN_FLAGS (O_NOATIME | FMODE_NONOTIFY) static struct file *ovl_open_realfile(const struct file *file, - struct path *realpath) + const struct path *realpath) { struct inode *realinode = d_inode(realpath->dentry); struct inode *inode = file_inode(file); diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index b45fea69fff3..19bd9af8b8a8 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -585,7 +585,7 @@ static int ovl_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, * Introducing security_inode_fileattr_get/set() hooks would solve this issue * properly. */ -static int ovl_security_fileattr(struct path *realpath, struct fileattr *fa, +static int ovl_security_fileattr(const struct path *realpath, struct fileattr *fa, bool set) { struct file *file; @@ -607,7 +607,7 @@ static int ovl_security_fileattr(struct path *realpath, struct fileattr *fa, return err; } -int ovl_real_fileattr_set(struct path *realpath, struct fileattr *fa) +int ovl_real_fileattr_set(const struct path *realpath, struct fileattr *fa) { int err; @@ -682,7 +682,7 @@ static void ovl_fileattr_prot_flags(struct inode *inode, struct fileattr *fa) } } -int ovl_real_fileattr_get(struct path *realpath, struct fileattr *fa) +int ovl_real_fileattr_get(const struct path *realpath, struct fileattr *fa) { int err; diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index 69dc577974f8..0fd1d5fdfc72 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -26,7 +26,7 @@ struct ovl_lookup_data { bool metacopy; }; -static int ovl_check_redirect(struct path *path, struct ovl_lookup_data *d, +static int ovl_check_redirect(const struct path *path, struct ovl_lookup_data *d, size_t prelen, const char *post) { int res; @@ -194,7 +194,7 @@ struct dentry *ovl_decode_real_fh(struct ovl_fs *ofs, struct ovl_fh *fh, return real; } -static bool ovl_is_opaquedir(struct ovl_fs *ofs, struct path *path) +static bool ovl_is_opaquedir(struct ovl_fs *ofs, const struct path *path) { return ovl_path_check_dir_xattr(ofs, path, OVL_XATTR_OPAQUE); } diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index 87759165d32b..1ac96eaeda54 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@ -208,7 +208,7 @@ static inline int ovl_do_symlink(struct ovl_fs *ofs, return err; } -static inline ssize_t ovl_do_getxattr(struct path *path, const char *name, +static inline ssize_t ovl_do_getxattr(const struct path *path, const char *name, void *value, size_t size) { int err, len; @@ -238,7 +238,7 @@ static inline ssize_t ovl_getxattr_upper(struct ovl_fs *ofs, } static inline ssize_t ovl_path_getxattr(struct ovl_fs *ofs, - struct path *path, + const struct path *path, enum ovl_xattr ox, void *value, size_t size) { @@ -401,13 +401,13 @@ void ovl_inode_update(struct inode *inode, struct dentry *upperdentry); void ovl_dir_modified(struct dentry *dentry, bool impurity); u64 ovl_dentry_version_get(struct dentry *dentry); bool ovl_is_whiteout(struct dentry *dentry); -struct file *ovl_path_open(struct path *path, int flags); +struct file *ovl_path_open(const struct path *path, int flags); int ovl_copy_up_start(struct dentry *dentry, int flags); void ovl_copy_up_end(struct dentry *dentry); bool ovl_already_copied_up(struct dentry *dentry, int flags); -bool ovl_path_check_dir_xattr(struct ovl_fs *ofs, struct path *path, +bool ovl_path_check_dir_xattr(struct ovl_fs *ofs, const struct path *path, enum ovl_xattr ox); -bool ovl_path_check_origin_xattr(struct ovl_fs *ofs, struct path *path); +bool ovl_path_check_origin_xattr(struct ovl_fs *ofs, const struct path *path); static inline bool ovl_check_origin_xattr(struct ovl_fs *ofs, struct dentry *upperdentry) @@ -430,9 +430,9 @@ bool ovl_need_index(struct dentry *dentry); int ovl_nlink_start(struct dentry *dentry); void ovl_nlink_end(struct dentry *dentry); int ovl_lock_rename_workdir(struct dentry *workdir, struct dentry *upperdir); -int ovl_check_metacopy_xattr(struct ovl_fs *ofs, struct path *path); +int ovl_check_metacopy_xattr(struct ovl_fs *ofs, const struct path *path); bool ovl_is_metacopy_dentry(struct dentry *dentry); -char *ovl_get_redirect_xattr(struct ovl_fs *ofs, struct path *path, int padding); +char *ovl_get_redirect_xattr(struct ovl_fs *ofs, const struct path *path, int padding); int ovl_sync_status(struct ovl_fs *ofs); static inline void ovl_set_flag(unsigned long flag, struct inode *inode) @@ -556,7 +556,7 @@ void ovl_cleanup_whiteouts(struct ovl_fs *ofs, struct dentry *upper, struct list_head *list); void ovl_cache_free(struct list_head *list); void ovl_dir_cache_free(struct inode *inode); -int ovl_check_d_type_supported(struct path *realpath); +int ovl_check_d_type_supported(const struct path *realpath); int ovl_workdir_cleanup(struct ovl_fs *ofs, struct inode *dir, struct vfsmount *mnt, struct dentry *dentry, int level); int ovl_indexdir_cleanup(struct ovl_fs *ofs); @@ -673,8 +673,8 @@ struct dentry *ovl_create_temp(struct ovl_fs *ofs, struct dentry *workdir, extern const struct file_operations ovl_file_operations; int __init ovl_aio_request_cache_init(void); void ovl_aio_request_cache_destroy(void); -int ovl_real_fileattr_get(struct path *realpath, struct fileattr *fa); -int ovl_real_fileattr_set(struct path *realpath, struct fileattr *fa); +int ovl_real_fileattr_get(const struct path *realpath, struct fileattr *fa); +int ovl_real_fileattr_set(const struct path *realpath, struct fileattr *fa); int ovl_fileattr_get(struct dentry *dentry, struct fileattr *fa); int ovl_fileattr_set(struct user_namespace *mnt_userns, struct dentry *dentry, struct fileattr *fa); @@ -683,7 +683,7 @@ int ovl_fileattr_set(struct user_namespace *mnt_userns, int ovl_copy_up(struct dentry *dentry); int ovl_copy_up_with_data(struct dentry *dentry); int ovl_maybe_copy_up(struct dentry *dentry, int flags); -int ovl_copy_xattr(struct super_block *sb, struct path *path, struct dentry *new); +int ovl_copy_xattr(struct super_block *sb, const struct path *path, struct dentry *new); int ovl_set_attr(struct ovl_fs *ofs, struct dentry *upper, struct kstat *stat); struct ovl_fh *ovl_encode_real_fh(struct ovl_fs *ofs, struct dentry *real, bool is_upper); diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c index 78f62cc1797b..268ed415577a 100644 --- a/fs/overlayfs/readdir.c +++ b/fs/overlayfs/readdir.c @@ -264,7 +264,7 @@ static int ovl_fill_merge(struct dir_context *ctx, const char *name, return ovl_fill_lowest(rdd, name, namelen, offset, ino, d_type); } -static int ovl_check_whiteouts(struct path *path, struct ovl_readdir_data *rdd) +static int ovl_check_whiteouts(const struct path *path, struct ovl_readdir_data *rdd) { int err; struct ovl_cache_entry *p; @@ -291,7 +291,7 @@ static int ovl_check_whiteouts(struct path *path, struct ovl_readdir_data *rdd) return err; } -static inline int ovl_dir_read(struct path *realpath, +static inline int ovl_dir_read(const struct path *realpath, struct ovl_readdir_data *rdd) { struct file *realfile; @@ -455,7 +455,7 @@ static u64 ovl_remap_lower_ino(u64 ino, int xinobits, int fsid, * copy up origin, call vfs_getattr() on the overlay entry to make * sure that d_ino will be consistent with st_ino from stat(2). */ -static int ovl_cache_update_ino(struct path *path, struct ovl_cache_entry *p) +static int ovl_cache_update_ino(const struct path *path, struct ovl_cache_entry *p) { struct dentry *dir = path->dentry; @@ -547,7 +547,7 @@ static int ovl_fill_plain(struct dir_context *ctx, const char *name, return 0; } -static int ovl_dir_read_impure(struct path *path, struct list_head *list, +static int ovl_dir_read_impure(const struct path *path, struct list_head *list, struct rb_root *root) { int err; @@ -592,7 +592,7 @@ static int ovl_dir_read_impure(struct path *path, struct list_head *list, return 0; } -static struct ovl_dir_cache *ovl_cache_get_impure(struct path *path) +static struct ovl_dir_cache *ovl_cache_get_impure(const struct path *path) { int res; struct dentry *dentry = path->dentry; @@ -834,7 +834,7 @@ static loff_t ovl_dir_llseek(struct file *file, loff_t offset, int origin) } static struct file *ovl_dir_open_realfile(const struct file *file, - struct path *realpath) + const struct path *realpath) { struct file *res; const struct cred *old_cred; @@ -1048,7 +1048,7 @@ static int ovl_check_d_type(struct dir_context *ctx, const char *name, * Returns 1 if d_type is supported, 0 not supported/unknown. Negative values * if error is encountered. */ -int ovl_check_d_type_supported(struct path *realpath) +int ovl_check_d_type_supported(const struct path *realpath) { int err; struct ovl_readdir_data rdd = { @@ -1065,7 +1065,7 @@ int ovl_check_d_type_supported(struct path *realpath) #define OVL_INCOMPATDIR_NAME "incompat" -static int ovl_workdir_cleanup_recurse(struct ovl_fs *ofs, struct path *path, +static int ovl_workdir_cleanup_recurse(struct ovl_fs *ofs, const struct path *path, int level) { int err; diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index ec746d447f1b..d51a02d555e0 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -908,7 +908,7 @@ static int ovl_mount_dir(const char *name, struct path *path) return err; } -static int ovl_check_namelen(struct path *path, struct ovl_fs *ofs, +static int ovl_check_namelen(const struct path *path, struct ovl_fs *ofs, const char *name) { struct kstatfs statfs; @@ -1353,7 +1353,7 @@ static int ovl_create_volatile_dirty(struct ovl_fs *ofs) } static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs, - struct path *workpath) + const struct path *workpath) { struct vfsmount *mnt = ovl_upper_mnt(ofs); struct dentry *temp, *workdir; @@ -1482,7 +1482,7 @@ static int ovl_make_workdir(struct super_block *sb, struct ovl_fs *ofs, } static int ovl_get_workdir(struct super_block *sb, struct ovl_fs *ofs, - struct path *upperpath) + const struct path *upperpath) { int err; struct path workpath = { }; @@ -1525,7 +1525,7 @@ static int ovl_get_workdir(struct super_block *sb, struct ovl_fs *ofs, } static int ovl_get_indexdir(struct super_block *sb, struct ovl_fs *ofs, - struct ovl_entry *oe, struct path *upperpath) + struct ovl_entry *oe, const struct path *upperpath) { struct vfsmount *mnt = ovl_upper_mnt(ofs); struct dentry *indexdir; diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 87f811c089e4..81a57a8d80d9 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -490,7 +490,7 @@ bool ovl_is_whiteout(struct dentry *dentry) return inode && IS_WHITEOUT(inode); } -struct file *ovl_path_open(struct path *path, int flags) +struct file *ovl_path_open(const struct path *path, int flags) { struct inode *inode = d_inode(path->dentry); struct user_namespace *real_mnt_userns = mnt_user_ns(path->mnt); @@ -578,7 +578,7 @@ void ovl_copy_up_end(struct dentry *dentry) ovl_inode_unlock(d_inode(dentry)); } -bool ovl_path_check_origin_xattr(struct ovl_fs *ofs, struct path *path) +bool ovl_path_check_origin_xattr(struct ovl_fs *ofs, const struct path *path) { int res; @@ -591,7 +591,7 @@ bool ovl_path_check_origin_xattr(struct ovl_fs *ofs, struct path *path) return false; } -bool ovl_path_check_dir_xattr(struct ovl_fs *ofs, struct path *path, +bool ovl_path_check_dir_xattr(struct ovl_fs *ofs, const struct path *path, enum ovl_xattr ox) { int res; @@ -971,7 +971,7 @@ int ovl_lock_rename_workdir(struct dentry *workdir, struct dentry *upperdir) } /* err < 0, 0 if no metacopy xattr, 1 if metacopy xattr found */ -int ovl_check_metacopy_xattr(struct ovl_fs *ofs, struct path *path) +int ovl_check_metacopy_xattr(struct ovl_fs *ofs, const struct path *path) { int res; @@ -1015,7 +1015,7 @@ bool ovl_is_metacopy_dentry(struct dentry *dentry) return (oe->numlower > 1); } -char *ovl_get_redirect_xattr(struct ovl_fs *ofs, struct path *path, int padding) +char *ovl_get_redirect_xattr(struct ovl_fs *ofs, const struct path *path, int padding) { int res; char *s, *next, *buf = NULL; From patchwork Sat Aug 20 18:12:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949746 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94E97C3F6B0 for ; Sat, 20 Aug 2022 18:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230251AbiHTSNF (ORCPT ); Sat, 20 Aug 2022 14:13:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbiHTSM7 (ORCPT ); Sat, 20 Aug 2022 14:12:59 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA8440549 for ; Sat, 20 Aug 2022 11:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=lkrbM13kRxpZk8nawpVeouuB8/HH6PPprSDwKoQ/rnc=; b=GmZgVytf7I1LE4mpSSJobLmac0 dzMarap+5EkxCXEleFRPH+nHdz/JLAWCidCdHYi9KNylvmwKI2pMSh5hnPvCeFZZcELL4WZQB/vLw 0fV0OSaok4T8BHOdKwMeUVlUaod/VDYGMx5KP9kletr2X1M4UI8O9hAUTauMQE5dwBs0wh4vzQflt KTOIWKa9kZEkKbfazskJic3v4JXxCDN/HhIJErjJg+9+sAD6QX05ZpVPTZq9EsJLM9oIuol+PNde4 uq8ioc1xfAKKHxBtiIfPeCFhdJ/t79jinBRT8T+3/SHNi/xCVAcn8oTjd6Wxtkv1vRwYMo2/2ElLm HtUuyQRg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxt-006RVt-1s for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:57 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 06/11] do_proc_readlink(): constify path Date: Sat, 20 Aug 2022 19:12:51 +0100 Message-Id: <20220820181256.1535714-5-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/proc/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index e347b8ce140c..2d9429bf51fa 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1761,7 +1761,7 @@ static const char *proc_pid_get_link(struct dentry *dentry, return ERR_PTR(error); } -static int do_proc_readlink(struct path *path, char __user *buffer, int buflen) +static int do_proc_readlink(const struct path *path, char __user *buffer, int buflen) { char *tmp = kmalloc(PATH_MAX, GFP_KERNEL); char *pathname; From patchwork Sat Aug 20 18:12:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 977AFC25B08 for ; Sat, 20 Aug 2022 18:13:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230314AbiHTSNG (ORCPT ); Sat, 20 Aug 2022 14:13:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229986AbiHTSNA (ORCPT ); Sat, 20 Aug 2022 14:13:00 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3FD840569 for ; Sat, 20 Aug 2022 11:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=+W0KS5ROUeLrBh/HkPoJVfJyzYvD8APwjVebUYBtlSs=; b=bXkUtWUej/PmYeEij9iJRrc6w7 nFi4AKvEnRm3HhICSnelU3k3D71uqvbVlRrddLSjO5c2QLRxJcAgkWjwo4Tn6QN19BG2k8ehEhY0g SW9nSFt99f5Ty9QoUze8uqzTUhPlZP2O7rF0KPJHYCgRozk9xhrTCpy2THkxMdfzWJjTNlcz7VO4u GuiPy5chPlCQQqYLqOVKPlXhwISOs5Pcwh48V6tIOhPA+OVWlD3RoY/awgBFTK0FBFH2N4pv4e+t/ K05JxGG25r3Whu1uXhHDBnKGdOndiPnh3pYbOZ855w/5ouqd78YT6TGqutSJ9BQdHVtx2HupXaJxQ ovHZahdQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxt-006RVw-6p for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:57 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 07/11] __io_setxattr(): constify path Date: Sat, 20 Aug 2022 19:12:52 +0100 Message-Id: <20220820181256.1535714-6-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- io_uring/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/xattr.c b/io_uring/xattr.c index 84180afd090b..99df641594d7 100644 --- a/io_uring/xattr.c +++ b/io_uring/xattr.c @@ -206,7 +206,7 @@ int io_fsetxattr_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) } static int __io_setxattr(struct io_kiocb *req, unsigned int issue_flags, - struct path *path) + const struct path *path) { struct io_xattr *ix = io_kiocb_to_cmd(req, struct io_xattr); int ret; From patchwork Sat Aug 20 18:12:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949748 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 512E3C25B08 for ; Sat, 20 Aug 2022 18:13:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230350AbiHTSNJ (ORCPT ); Sat, 20 Aug 2022 14:13:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230031AbiHTSNA (ORCPT ); Sat, 20 Aug 2022 14:13:00 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8D5840BC0 for ; Sat, 20 Aug 2022 11:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=MAve7KVmRdiKHmJf3UUFc8wn2WVQXszHunTAYCfUdlw=; b=Dz2vrz9WHm/UACWA60udqhiuXr MxzhXF/MuF7EqsKCc1YMDA/du5jkMdK6B238xv1eo5hEzSCsAmiKA6XVMpUHOOyEQYhG33traPgHc rD1sU/UI1iVSxbg78eyrcgIYyAaL6e4VTgOhu2J08wrVkggWuJQA0XgQlDz2l9PetgxcRK2QVXIbU dSe4eyQaQlp26NSissuGOS8lpl8ua5iVwmPdEr1gbLtJ582g1iJPrdcin8OK0kta9HbCB3QPxn+4R W5/qGVssBkUOEzrDe6v9WgBREjhodv6dmjd91/EhGNONWPPuMSdZJzhI6PjFq9tBvx47XH9geVjJb S9mEpkTA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxt-006RW0-CS for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:57 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 08/11] audit_init_parent(): constify path Date: Sat, 20 Aug 2022 19:12:53 +0100 Message-Id: <20220820181256.1535714-7-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- kernel/audit_watch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c index 4b0957aa2cd4..65075f1e4ac8 100644 --- a/kernel/audit_watch.c +++ b/kernel/audit_watch.c @@ -133,7 +133,7 @@ int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev) } /* Initialize a parent watch entry. */ -static struct audit_parent *audit_init_parent(struct path *path) +static struct audit_parent *audit_init_parent(const struct path *path) { struct inode *inode = d_backing_inode(path->dentry); struct audit_parent *parent; From patchwork Sat Aug 20 18:12:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949750 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DF38C25B08 for ; Sat, 20 Aug 2022 18:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbiHTSNK (ORCPT ); Sat, 20 Aug 2022 14:13:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230096AbiHTSNA (ORCPT ); Sat, 20 Aug 2022 14:13:00 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E63EF40BCD for ; Sat, 20 Aug 2022 11:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=57bohfMjI+JVDHrAtuIJnC/06bjrgHYmEcEeHZKAWaQ=; b=l20wjLTyKXuO0vBNV1C7v39ZRY ut7aayAS/1EJUGMecGbSqSVghupwig3yDK8+4oqST3T4Yz291/tTFClouXuiZPVrOjjJDGtESDOdV HhR9Qh4ON/DvQEtyvJt8AJMnQlQ/MAIe30T2jtsGSzxfn9PAsTbnyvMPZjbfs2IF8YULAkZUL5DJu 9ysDQpMmsst6rahf9gCJEJOLsNr/u3pmIFu/VcUlWkBM1ppczMN8TdQrxtuuAQeVsXDzad/OL/qLr QiUODX1/lYqqP0FH24jbdm2lISL1RfcEwD3D0xlV2AiqqaVpuJJicaHPOz2YWbK+9+h5gNH/U3FAb XqkO0pIA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxt-006RW3-Hn for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:57 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 09/11] nd_jump_link(): constify path Date: Sat, 20 Aug 2022 19:12:54 +0100 Message-Id: <20220820181256.1535714-8-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/namei.c | 2 +- include/linux/namei.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 6a5ab1a6f01b..8533087e5dac 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -986,7 +986,7 @@ static int nd_jump_root(struct nameidata *nd) * Helper to directly jump to a known parsed path from ->get_link, * caller must have taken a reference to path beforehand. */ -int nd_jump_link(struct path *path) +int nd_jump_link(const struct path *path) { int error = -ELOOP; struct nameidata *nd = current->nameidata; diff --git a/include/linux/namei.h b/include/linux/namei.h index caeb08a98536..00fee52df842 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -83,7 +83,7 @@ extern int follow_up(struct path *); extern struct dentry *lock_rename(struct dentry *, struct dentry *); extern void unlock_rename(struct dentry *, struct dentry *); -extern int __must_check nd_jump_link(struct path *path); +extern int __must_check nd_jump_link(const struct path *path); static inline void nd_terminate_link(void *name, size_t len, size_t maxlen) { From patchwork Sat Aug 20 18:12:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A974BC25B08 for ; Sat, 20 Aug 2022 18:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230471AbiHTSNM (ORCPT ); Sat, 20 Aug 2022 14:13:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbiHTSNA (ORCPT ); Sat, 20 Aug 2022 14:13:00 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1234D3FA3C for ; Sat, 20 Aug 2022 11:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=NLg9UVGBznmF4980Y7eEsVF/DmEu0JD82psvq/EDnC0=; b=rP0CVh6h7nhQzkV/AErUIhWar/ LzlHbNgoxYB5WaGFgbyLIV1jeYIvEdywL0BQP46xqhA5g74fJw0uQ2M8Ri2fIk3zwMcdte3Ps6zBS tYjla41VOk40LUsBAvcvhIpBYXlVKN+M9KVmTgaJxwSZ5/WPkXKmsr8z0bvJzVsNHDyrd84fFh1N7 02wB/2mCREYeTFMdZSlpn2r06X/jHkUfYEEe4P+smtvTtSyyfceTlveL7Im27C3Ka7fQrEDa52cHQ mkb6/VIw9QfOpsTQPwP24DvDvVjklOJVJw0Mk1XbBMXeSs20o5kAl7C5yT1Y3GYU2vG94MPNeX83E ZDANRReA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxt-006RW6-Lz for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:57 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 10/11] spufs: constify path Date: Sat, 20 Aug 2022 19:12:55 +0100 Message-Id: <20220820181256.1535714-9-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- arch/powerpc/platforms/cell/spufs/inode.c | 6 +++--- arch/powerpc/platforms/cell/spufs/spufs.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 320008528edd..dbcfe361831a 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -275,7 +275,7 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, return ret; } -static int spufs_context_open(struct path *path) +static int spufs_context_open(const struct path *path) { int ret; struct file *filp; @@ -491,7 +491,7 @@ spufs_mkgang(struct inode *dir, struct dentry *dentry, umode_t mode) return ret; } -static int spufs_gang_open(struct path *path) +static int spufs_gang_open(const struct path *path) { int ret; struct file *filp; @@ -536,7 +536,7 @@ static int spufs_create_gang(struct inode *inode, static struct file_system_type spufs_type; -long spufs_create(struct path *path, struct dentry *dentry, +long spufs_create(const struct path *path, struct dentry *dentry, unsigned int flags, umode_t mode, struct file *filp) { struct inode *dir = d_inode(path->dentry); diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index 23c6799cfa5a..af048b6dd30a 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h @@ -232,7 +232,7 @@ extern const struct spufs_tree_descr spufs_dir_debug_contents[]; extern struct spufs_calls spufs_calls; struct coredump_params; long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); -long spufs_create(struct path *nd, struct dentry *dentry, unsigned int flags, +long spufs_create(const struct path *nd, struct dentry *dentry, unsigned int flags, umode_t mode, struct file *filp); /* ELF coredump callbacks for writing SPU ELF notes */ extern int spufs_coredump_extra_notes_size(void); From patchwork Sat Aug 20 18:12:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 12949752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A00C1C32772 for ; Sat, 20 Aug 2022 18:13:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230228AbiHTSNN (ORCPT ); Sat, 20 Aug 2022 14:13:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbiHTSNA (ORCPT ); Sat, 20 Aug 2022 14:13:00 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45C63402E4 for ; Sat, 20 Aug 2022 11:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description; bh=NVFIlRHS1mQXkCTXMpYD4h/KcIIjPqHuwQ+73guKeUA=; b=E+cX3XJoWNAkwRjdEURgTAqxnk guvxgHAIwSFH41nvPnKCpu3POrUOvXGmMheK73h/6UQS22VjcSfr2+1DGfG5y5VRiIvNLKKMpmD3u w+SaEhTLM/ZFTPsV9UW4i4uyMlJ8p8c86t1npS/y2gQHvKE0JIuzeqxihsdOr0zZLA02oo62vNXc7 EjCIpSQzYQ9WNKA5Rar4Hb4Y+Wu3T2yg3t6yMUDwGrI3Hc+pB7kusVAkUSBONz12YoheoYF8m99kx UtIl/yFlMRZlnPPj5o5e8L/caYo2ftxqehZScNtlVXoYzVc/rqJNmdtTrIQE43eKQgKCjbkQQHT2W AKzVum8A==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oPSxt-006RW9-QT for linux-fsdevel@vger.kernel.org; Sat, 20 Aug 2022 18:12:57 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Subject: [PATCH 11/11] ecryptfs: constify path Date: Sat, 20 Aug 2022 19:12:56 +0100 Message-Id: <20220820181256.1535714-10-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> References: <20220820181256.1535714-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Signed-off-by: Al Viro --- fs/ecryptfs/ecryptfs_kernel.h | 2 +- fs/ecryptfs/file.c | 2 +- fs/ecryptfs/inode.c | 2 +- fs/ecryptfs/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index 5f2b49e13731..f2ed0c0266cb 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h @@ -506,7 +506,7 @@ ecryptfs_dentry_to_lower(struct dentry *dentry) return ((struct ecryptfs_dentry_info *)dentry->d_fsdata)->lower_path.dentry; } -static inline struct path * +static inline const struct path * ecryptfs_dentry_to_lower_path(struct dentry *dentry) { return &((struct ecryptfs_dentry_info *)dentry->d_fsdata)->lower_path; diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 18d5b91cb573..195f7c2a16e8 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c @@ -33,7 +33,7 @@ static ssize_t ecryptfs_read_update_atime(struct kiocb *iocb, struct iov_iter *to) { ssize_t rc; - struct path *path; + const struct path *path; struct file *file = iocb->ki_filp; rc = generic_file_read_iter(iocb, to); diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 16d50dface59..c214fe0981bd 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -317,7 +317,7 @@ static int ecryptfs_i_size_read(struct dentry *dentry, struct inode *inode) static struct dentry *ecryptfs_lookup_interpose(struct dentry *dentry, struct dentry *lower_dentry) { - struct path *path = ecryptfs_dentry_to_lower_path(dentry->d_parent); + const struct path *path = ecryptfs_dentry_to_lower_path(dentry->d_parent); struct inode *inode, *lower_inode; struct ecryptfs_dentry_info *dentry_info; int rc = 0; diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 2dd23a82e0de..2dc927ba067f 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c @@ -105,7 +105,7 @@ static int ecryptfs_init_lower_file(struct dentry *dentry, struct file **lower_file) { const struct cred *cred = current_cred(); - struct path *path = ecryptfs_dentry_to_lower_path(dentry); + const struct path *path = ecryptfs_dentry_to_lower_path(dentry); int rc; rc = ecryptfs_privileged_open(lower_file, path->dentry, path->mnt,