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.

Merge tag 'exfat-for-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat

Pull exfat updates from Namjae Jeon:

- Fix deadlock issue reported by syzbot

- Handle idmapped mounts

* tag 'exfat-for-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
exfat: fix potential deadlock on __exfat_get_dentry_set
exfat: handle idmapped mounts

+15 -11
+1 -1
fs/exfat/dir.c
··· 813 813 814 814 num_bh = EXFAT_B_TO_BLK_ROUND_UP(off + num_entries * DENTRY_SIZE, sb); 815 815 if (num_bh > ARRAY_SIZE(es->__bh)) { 816 - es->bh = kmalloc_array(num_bh, sizeof(*es->bh), GFP_KERNEL); 816 + es->bh = kmalloc_array(num_bh, sizeof(*es->bh), GFP_NOFS); 817 817 if (!es->bh) { 818 818 brelse(bh); 819 819 return -ENOMEM;
+13 -9
fs/exfat/file.c
··· 89 89 return -EIO; 90 90 } 91 91 92 - static bool exfat_allow_set_time(struct exfat_sb_info *sbi, struct inode *inode) 92 + static bool exfat_allow_set_time(struct mnt_idmap *idmap, 93 + struct exfat_sb_info *sbi, struct inode *inode) 93 94 { 94 95 mode_t allow_utime = sbi->options.allow_utime; 95 96 96 - if (!uid_eq(current_fsuid(), inode->i_uid)) { 97 - if (in_group_p(inode->i_gid)) 97 + if (!vfsuid_eq_kuid(i_uid_into_vfsuid(idmap, inode), 98 + current_fsuid())) { 99 + if (vfsgid_in_group_p(i_gid_into_vfsgid(idmap, inode))) 98 100 allow_utime >>= 3; 99 101 if (allow_utime & MAY_WRITE) 100 102 return true; ··· 285 283 struct inode *inode = d_backing_inode(path->dentry); 286 284 struct exfat_inode_info *ei = EXFAT_I(inode); 287 285 288 - generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); 286 + generic_fillattr(idmap, request_mask, inode, stat); 289 287 exfat_truncate_atime(&stat->atime); 290 288 stat->result_mask |= STATX_BTIME; 291 289 stat->btime.tv_sec = ei->i_crtime.tv_sec; ··· 313 311 /* Check for setting the inode time. */ 314 312 ia_valid = attr->ia_valid; 315 313 if ((ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)) && 316 - exfat_allow_set_time(sbi, inode)) { 314 + exfat_allow_set_time(idmap, sbi, inode)) { 317 315 attr->ia_valid &= ~(ATTR_MTIME_SET | ATTR_ATIME_SET | 318 316 ATTR_TIMES_SET); 319 317 } 320 318 321 - error = setattr_prepare(&nop_mnt_idmap, dentry, attr); 319 + error = setattr_prepare(idmap, dentry, attr); 322 320 attr->ia_valid = ia_valid; 323 321 if (error) 324 322 goto out; 325 323 326 324 if (((attr->ia_valid & ATTR_UID) && 327 - !uid_eq(attr->ia_uid, sbi->options.fs_uid)) || 325 + (!uid_eq(from_vfsuid(idmap, i_user_ns(inode), attr->ia_vfsuid), 326 + sbi->options.fs_uid))) || 328 327 ((attr->ia_valid & ATTR_GID) && 329 - !gid_eq(attr->ia_gid, sbi->options.fs_gid)) || 328 + (!gid_eq(from_vfsgid(idmap, i_user_ns(inode), attr->ia_vfsgid), 329 + sbi->options.fs_gid))) || 330 330 ((attr->ia_valid & ATTR_MODE) && 331 331 (attr->ia_mode & ~(S_IFREG | S_IFLNK | S_IFDIR | 0777)))) { 332 332 error = -EPERM; ··· 347 343 if (attr->ia_valid & ATTR_SIZE) 348 344 inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); 349 345 350 - setattr_copy(&nop_mnt_idmap, inode, attr); 346 + setattr_copy(idmap, inode, attr); 351 347 exfat_truncate_inode_atime(inode); 352 348 353 349 if (attr->ia_valid & ATTR_SIZE) {
+1 -1
fs/exfat/super.c
··· 788 788 .init_fs_context = exfat_init_fs_context, 789 789 .parameters = exfat_parameters, 790 790 .kill_sb = exfat_kill_sb, 791 - .fs_flags = FS_REQUIRES_DEV, 791 + .fs_flags = FS_REQUIRES_DEV | FS_ALLOW_IDMAP, 792 792 }; 793 793 794 794 static void exfat_inode_init_once(void *foo)