Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fuse: zero initialize inode private data

This is slightly tricky, since the VFS uses non-zeroing allocation to
preserve some fields that are left in a consistent state.

Reported-by: Chunsheng Luo <luochunsheng@ustc.edu>
Closes: https://lore.kernel.org/all/20250818083224.229-1-luochunsheng@ustc.edu/
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>

+4 -7
+4 -7
fs/fuse/inode.c
··· 101 101 if (!fi) 102 102 return NULL; 103 103 104 - fi->i_time = 0; 104 + /* Initialize private data (i.e. everything except fi->inode) */ 105 + BUILD_BUG_ON(offsetof(struct fuse_inode, inode) != 0); 106 + memset((void *) fi + sizeof(fi->inode), 0, sizeof(*fi) - sizeof(fi->inode)); 107 + 105 108 fi->inval_mask = ~0; 106 - fi->nodeid = 0; 107 - fi->nlookup = 0; 108 - fi->attr_version = 0; 109 - fi->orig_ino = 0; 110 - fi->state = 0; 111 - fi->submount_lookup = NULL; 112 109 mutex_init(&fi->mutex); 113 110 spin_lock_init(&fi->lock); 114 111 fi->forget = fuse_alloc_forget();