Skip to content

Commit 2eb7f03

Browse files
committed
Merge tag 'vfs-6.16-rc5.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull vfs fixes from Christian Brauner: - Fix a regression caused by the anonymous inode rework. Making them regular files causes various places in the kernel to tip over starting with io_uring. Revert to the former status quo and port our assertion to be based on checking the inode so we don't lose the valuable VFS_*_ON_*() assertions that have already helped discover weird behavior our outright bugs. - Fix the the upper bound calculation in fuse_fill_write_pages() - Fix priority inversion issues in the eventpoll code - Make secretmen use anon_inode_make_secure_inode() to avoid bypassing the LSM layer - Fix a netfs hang due to missing case in final DIO read result collection - Fix a double put of the netfs_io_request struct - Provide some helpers to abstract out NETFS_RREQ_IN_PROGRESS flag wrangling - Fix infinite looping in netfs_wait_for_pause/request() - Fix a netfs ref leak on an extra subrequest inserted into a request's list of subreqs - Fix various cifs RPC callbacks to set NETFS_SREQ_NEED_RETRY if a subrequest fails retriably - Fix a cifs warning in the workqueue code when reconnecting a channel - Fix the updating of i_size in netfs to avoid a race between testing if we should have extended the file with a DIO write and changing i_size - Merge the places in netfs that update i_size on write - Fix coredump socket selftests * tag 'vfs-6.16-rc5.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: anon_inode: rework assertions netfs: Update tracepoints in a number of ways netfs: Renumber the NETFS_RREQ_* flags to make traces easier to read netfs: Merge i_size update functions netfs: Fix i_size updating smb: client: set missing retry flag in cifs_writev_callback() smb: client: set missing retry flag in cifs_readv_callback() smb: client: set missing retry flag in smb2_writev_callback() netfs: Fix ref leak on inserted extra subreq in write retry netfs: Fix looping in wait functions netfs: Provide helpers to perform NETFS_RREQ_IN_PROGRESS flag wangling netfs: Fix double put of request netfs: Fix hang due to missing case in final DIO read result collection eventpoll: Fix priority inversion problem fuse: fix fuse_fill_write_pages() upper bound calculation fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass selftests/coredump: Fix "socket_detect_userspace_client" test failure
2 parents 4c06e63 + 1e7ab6f commit 2eb7f03

File tree

21 files changed

+351
-438
lines changed

21 files changed

+351
-438
lines changed

fs/anon_inodes.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,25 @@ static struct file_system_type anon_inode_fs_type = {
9898
.kill_sb = kill_anon_super,
9999
};
100100

101-
static struct inode *anon_inode_make_secure_inode(
102-
const char *name,
103-
const struct inode *context_inode)
101+
/**
102+
* anon_inode_make_secure_inode - allocate an anonymous inode with security context
103+
* @sb: [in] Superblock to allocate from
104+
* @name: [in] Name of the class of the newfile (e.g., "secretmem")
105+
* @context_inode:
106+
* [in] Optional parent inode for security inheritance
107+
*
108+
* The function ensures proper security initialization through the LSM hook
109+
* security_inode_init_security_anon().
110+
*
111+
* Return: Pointer to new inode on success, ERR_PTR on failure.
112+
*/
113+
struct inode *anon_inode_make_secure_inode(struct super_block *sb, const char *name,
114+
const struct inode *context_inode)
104115
{
105116
struct inode *inode;
106117
int error;
107118

108-
inode = alloc_anon_inode(anon_inode_mnt->mnt_sb);
119+
inode = alloc_anon_inode(sb);
109120
if (IS_ERR(inode))
110121
return inode;
111122
inode->i_flags &= ~S_PRIVATE;
@@ -118,6 +129,7 @@ static struct inode *anon_inode_make_secure_inode(
118129
}
119130
return inode;
120131
}
132+
EXPORT_SYMBOL_GPL_FOR_MODULES(anon_inode_make_secure_inode, "kvm");
121133

122134
static struct file *__anon_inode_getfile(const char *name,
123135
const struct file_operations *fops,
@@ -132,7 +144,8 @@ static struct file *__anon_inode_getfile(const char *name,
132144
return ERR_PTR(-ENOENT);
133145

134146
if (make_inode) {
135-
inode = anon_inode_make_secure_inode(name, context_inode);
147+
inode = anon_inode_make_secure_inode(anon_inode_mnt->mnt_sb,
148+
name, context_inode);
136149
if (IS_ERR(inode)) {
137150
file = ERR_CAST(inode);
138151
goto err;

0 commit comments

Comments
 (0)