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 'vfs-7.1-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs

Pull misc vfs updates from Christian Brauner:
"Features:
- coredump: add tracepoint for coredump events
- fs: hide file and bfile caches behind runtime const machinery

Fixes:
- fix architecture-specific compat_ftruncate64 implementations
- dcache: Limit the minimal number of bucket to two
- fs/omfs: reject s_sys_blocksize smaller than OMFS_DIR_START
- fs/mbcache: cancel shrink work before destroying the cache
- dcache: permit dynamic_dname()s up to NAME_MAX

Cleanups:
- remove or unexport unused fs_context infrastructure
- trivial ->setattr cleanups
- selftests/filesystems: Assume that TIOCGPTPEER is defined
- writeback: fix kernel-doc function name mismatch for wb_put_many()
- autofs: replace manual symlink buffer allocation in autofs_dir_symlink
- init/initramfs.c: trivial fix: FSM -> Finite-state machine
- fs: remove stale and duplicate forward declarations
- readdir: Introduce dirent_size()
- fs: Replace user_access_{begin/end} by scoped user access
- kernel: acct: fix duplicate word in comment
- fs: write a better comment in step_into() concerning .mnt assignment
- fs: attr: fix comment formatting and spelling issues"

* tag 'vfs-7.1-rc1.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (28 commits)
dcache: permit dynamic_dname()s up to NAME_MAX
fs: attr: fix comment formatting and spelling issues
fs: hide file and bfile caches behind runtime const machinery
fs: write a better comment in step_into() concerning .mnt assignment
proc: rename proc_notify_change to proc_setattr
proc: rename proc_setattr to proc_nochmod_setattr
affs: rename affs_notify_change to affs_setattr
adfs: rename adfs_notify_change to adfs_setattr
hfs: update comments on hfs_inode_setattr
kernel: acct: fix duplicate word in comment
fs: Replace user_access_{begin/end} by scoped user access
readdir: Introduce dirent_size()
coredump: add tracepoint for coredump events
fs: remove do_sys_truncate
fs: pass on FTRUNCATE_* flags to do_truncate
fs: fix archiecture-specific compat_ftruncate64
fs: remove stale and duplicate forward declarations
init/initramfs.c: trivial fix: FSM -> Finite-state machine
autofs: replace manual symlink buffer allocation in autofs_dir_symlink
fs/mbcache: cancel shrink work before destroying the cache
...

+225 -252
-4
Documentation/filesystems/mount_api.rst
··· 647 647 fs_param_is_u64 64-bit unsigned int result->uint_64 648 648 fs_param_is_enum Enum value name result->uint_32 649 649 fs_param_is_string Arbitrary string param->string 650 - fs_param_is_blob Binary blob param->blob 651 650 fs_param_is_blockdev Blockdev path * Needs lookup 652 - fs_param_is_path Path * Needs lookup 653 651 fs_param_is_fd File descriptor result->int_32 654 652 fs_param_is_uid User ID (u32) result->uid 655 653 fs_param_is_gid Group ID (u32) result->gid ··· 679 681 fsparam_u64() fs_param_is_u64 680 682 fsparam_enum() fs_param_is_enum 681 683 fsparam_string() fs_param_is_string 682 - fsparam_blob() fs_param_is_blob 683 684 fsparam_bdev() fs_param_is_blockdev 684 - fsparam_path() fs_param_is_path 685 685 fsparam_fd() fs_param_is_fd 686 686 fsparam_uid() fs_param_is_uid 687 687 fsparam_gid() fs_param_is_gid
+1 -1
arch/arm64/kernel/sys32.c
··· 89 89 COMPAT_SYSCALL_DEFINE4(aarch32_ftruncate64, unsigned int, fd, u32, __pad, 90 90 arg_u32p(length)) 91 91 { 92 - return ksys_ftruncate(fd, arg_u64(length)); 92 + return ksys_ftruncate(fd, arg_u64(length), FTRUNCATE_LFS); 93 93 } 94 94 95 95 COMPAT_SYSCALL_DEFINE5(aarch32_readahead, int, fd, u32, __pad,
+1 -1
arch/mips/kernel/linux32.c
··· 60 60 SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy, 61 61 unsigned long, a2, unsigned long, a3) 62 62 { 63 - return ksys_ftruncate(fd, merge_64(a2, a3)); 63 + return ksys_ftruncate(fd, merge_64(a2, a3), FTRUNCATE_LFS); 64 64 } 65 65 66 66 SYSCALL_DEFINE5(32_llseek, unsigned int, fd, unsigned int, offset_high,
+2 -2
arch/parisc/kernel/sys_parisc.c
··· 216 216 asmlinkage long parisc_ftruncate64(unsigned int fd, 217 217 unsigned int high, unsigned int low) 218 218 { 219 - return ksys_ftruncate(fd, (long)high << 32 | low); 219 + return ksys_ftruncate(fd, (long)high << 32 | low, FTRUNCATE_LFS); 220 220 } 221 221 222 222 /* stubs for the benefit of the syscall_table since truncate64 and truncate ··· 227 227 } 228 228 asmlinkage long sys_ftruncate64(unsigned int fd, unsigned long length) 229 229 { 230 - return ksys_ftruncate(fd, length); 230 + return ksys_ftruncate(fd, length, FTRUNCATE_LFS); 231 231 } 232 232 asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) 233 233 {
+1 -1
arch/powerpc/kernel/sys_ppc32.c
··· 101 101 unsigned int, fd, u32, reg4, 102 102 unsigned long, len1, unsigned long, len2) 103 103 { 104 - return ksys_ftruncate(fd, merge_64(len1, len2)); 104 + return ksys_ftruncate(fd, merge_64(len1, len2), FTRUNCATE_LFS); 105 105 } 106 106 107 107 PPC32_SYSCALL_DEFINE6(ppc32_fadvise64,
+1 -1
arch/sparc/kernel/sys_sparc32.c
··· 58 58 59 59 COMPAT_SYSCALL_DEFINE3(ftruncate64, unsigned int, fd, u32, high, u32, low) 60 60 { 61 - return ksys_ftruncate(fd, ((u64)high << 32) | low); 61 + return ksys_ftruncate(fd, ((u64)high << 32) | low, FTRUNCATE_LFS); 62 62 } 63 63 64 64 static int cp_compat_stat64(struct kstat *stat,
+2 -1
arch/x86/kernel/sys_ia32.c
··· 61 61 SYSCALL_DEFINE3(ia32_ftruncate64, unsigned int, fd, 62 62 unsigned long, offset_low, unsigned long, offset_high) 63 63 { 64 - return ksys_ftruncate(fd, ((loff_t) offset_high << 32) | offset_low); 64 + return ksys_ftruncate(fd, ((loff_t) offset_high << 32) | offset_low, 65 + FTRUNCATE_LFS); 65 66 } 66 67 67 68 /* warning: next two assume little endian */
+2 -2
fs/adfs/adfs.h
··· 144 144 /* Inode stuff */ 145 145 struct inode *adfs_iget(struct super_block *sb, struct object_info *obj); 146 146 int adfs_write_inode(struct inode *inode, struct writeback_control *wbc); 147 - int adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, 148 - struct iattr *attr); 147 + int adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 148 + struct iattr *attr); 149 149 150 150 /* map.c */ 151 151 int adfs_map_lookup(struct super_block *sb, u32 frag_id, unsigned int offset);
+1 -1
fs/adfs/dir.c
··· 454 454 */ 455 455 const struct inode_operations adfs_dir_inode_operations = { 456 456 .lookup = adfs_lookup, 457 - .setattr = adfs_notify_change, 457 + .setattr = adfs_setattr, 458 458 };
+1 -1
fs/adfs/file.c
··· 32 32 }; 33 33 34 34 const struct inode_operations adfs_file_inode_operations = { 35 - .setattr = adfs_notify_change, 35 + .setattr = adfs_setattr, 36 36 };
+2 -4
fs/adfs/inode.c
··· 299 299 * later. 300 300 */ 301 301 int 302 - adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, 303 - struct iattr *attr) 302 + adfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr) 304 303 { 305 304 struct inode *inode = d_inode(dentry); 306 305 struct super_block *sb = inode->i_sb; ··· 354 355 355 356 /* 356 357 * write an existing inode back to the directory, and therefore the disk. 357 - * The adfs-specific inode data has already been updated by 358 - * adfs_notify_change() 358 + * The adfs-specific inode data has already been updated by * adfs_setattr(). 359 359 */ 360 360 int adfs_write_inode(struct inode *inode, struct writeback_control *wbc) 361 361 {
+1 -1
fs/affs/affs.h
··· 186 186 /* inode.c */ 187 187 188 188 extern struct inode *affs_new_inode(struct inode *dir); 189 - extern int affs_notify_change(struct mnt_idmap *idmap, 189 + extern int affs_setattr(struct mnt_idmap *idmap, 190 190 struct dentry *dentry, struct iattr *attr); 191 191 extern void affs_evict_inode(struct inode *inode); 192 192 extern struct inode *affs_iget(struct super_block *sb,
+1 -1
fs/affs/dir.c
··· 71 71 .mkdir = affs_mkdir, 72 72 .rmdir = affs_rmdir, 73 73 .rename = affs_rename2, 74 - .setattr = affs_notify_change, 74 + .setattr = affs_setattr, 75 75 }; 76 76 77 77 static int
+1 -1
fs/affs/file.c
··· 1016 1016 }; 1017 1017 1018 1018 const struct inode_operations affs_file_inode_operations = { 1019 - .setattr = affs_notify_change, 1019 + .setattr = affs_setattr, 1020 1020 };
+2 -3
fs/affs/inode.c
··· 213 213 } 214 214 215 215 int 216 - affs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, 217 - struct iattr *attr) 216 + affs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr) 218 217 { 219 218 struct inode *inode = d_inode(dentry); 220 219 int error; 221 220 222 - pr_debug("notify_change(%llu,0x%x)\n", inode->i_ino, attr->ia_valid); 221 + pr_debug("setattr(%llu,0x%x)\n", inode->i_ino, attr->ia_valid); 223 222 224 223 error = setattr_prepare(&nop_mnt_idmap, dentry, attr); 225 224 if (error)
+1 -1
fs/affs/symlink.c
··· 71 71 72 72 const struct inode_operations affs_symlink_inode_operations = { 73 73 .get_link = page_get_link, 74 - .setattr = affs_notify_change, 74 + .setattr = affs_setattr, 75 75 };
+3 -3
fs/attr.c
··· 46 46 EXPORT_SYMBOL(setattr_should_drop_sgid); 47 47 48 48 /** 49 - * setattr_should_drop_suidgid - determine whether the set{g,u}id bit needs to 50 - * be dropped 49 + * setattr_should_drop_suidgid - determine whether the set{g,u}id bit 50 + * needs to be dropped 51 51 * @idmap: idmap of the mount @inode was found from 52 52 * @inode: inode to check 53 53 * ··· 165 165 unsigned int ia_valid = attr->ia_valid; 166 166 167 167 /* 168 - * First check size constraints. These can't be overriden using 168 + * First check size constraints. These can't be overridden using 169 169 * ATTR_FORCE. 170 170 */ 171 171 if (ia_valid & ATTR_SIZE) {
+3 -5
fs/autofs/root.c
··· 7 7 8 8 #include <linux/capability.h> 9 9 #include <linux/compat.h> 10 + #include <linux/string.h> 10 11 11 12 #include "autofs_i.h" 12 13 ··· 579 578 struct autofs_info *ino = autofs_dentry_ino(dentry); 580 579 struct autofs_info *p_ino; 581 580 struct inode *inode; 582 - size_t size = strlen(symname); 583 581 char *cp; 584 582 585 583 pr_debug("%s <- %pd\n", symname, dentry); ··· 589 589 590 590 autofs_del_active(dentry); 591 591 592 - cp = kmalloc(size + 1, GFP_KERNEL); 592 + cp = kstrdup(symname, GFP_KERNEL); 593 593 if (!cp) 594 594 return -ENOMEM; 595 - 596 - strcpy(cp, symname); 597 595 598 596 inode = autofs_get_inode(dir->i_sb, S_IFLNK | 0555); 599 597 if (!inode) { ··· 599 601 return -ENOMEM; 600 602 } 601 603 inode->i_private = cp; 602 - inode->i_size = size; 604 + inode->i_size = strlen(cp); 603 605 604 606 d_make_persistent(dentry, inode); 605 607 p_ino = autofs_dentry_ino(dentry->d_parent);
+5
fs/coredump.c
··· 63 63 64 64 #include <trace/events/sched.h> 65 65 66 + #define CREATE_TRACE_POINTS 67 + #include <trace/events/coredump.h> 68 + 66 69 static bool dump_vma_snapshot(struct coredump_params *cprm); 67 70 static void free_vma_snapshot(struct coredump_params *cprm); 68 71 ··· 1093 1090 static void do_coredump(struct core_name *cn, struct coredump_params *cprm, 1094 1091 size_t **argv, int *argc, const struct linux_binfmt *binfmt) 1095 1092 { 1093 + trace_coredump(cprm->siginfo->si_signo); 1094 + 1096 1095 if (!coredump_parse(cn, cprm, argv, argc)) { 1097 1096 coredump_report_failure("format_corename failed, aborting core"); 1098 1097 return;
+6 -5
fs/d_path.c
··· 301 301 char *dynamic_dname(char *buffer, int buflen, const char *fmt, ...) 302 302 { 303 303 va_list args; 304 - char temp[64]; 304 + char *start; 305 305 int sz; 306 306 307 307 va_start(args, fmt); 308 - sz = vsnprintf(temp, sizeof(temp), fmt, args) + 1; 308 + sz = vsnprintf(buffer, buflen, fmt, args) + 1; 309 309 va_end(args); 310 310 311 - if (sz > sizeof(temp) || sz > buflen) 311 + if (sz > NAME_MAX || sz > buflen) 312 312 return ERR_PTR(-ENAMETOOLONG); 313 313 314 - buffer += buflen - sz; 315 - return memcpy(buffer, temp, sz); 314 + /* Move the formatted d_name to the end of the buffer. */ 315 + start = buffer + (buflen - sz); 316 + return memmove(start, buffer, sz); 316 317 } 317 318 318 319 char *simple_dname(struct dentry *dentry, char *buffer, int buflen)
+2 -2
fs/dcache.c
··· 3257 3257 HASH_EARLY | HASH_ZERO, 3258 3258 &d_hash_shift, 3259 3259 NULL, 3260 - 0, 3260 + 2, 3261 3261 0); 3262 3262 d_hash_shift = 32 - d_hash_shift; 3263 3263 ··· 3289 3289 HASH_ZERO, 3290 3290 &d_hash_shift, 3291 3291 NULL, 3292 - 0, 3292 + 2, 3293 3293 0); 3294 3294 d_hash_shift = 32 - d_hash_shift; 3295 3295
+1 -1
fs/file.c
··· 200 200 /* 201 201 * Check if the allocation size would exceed INT_MAX. kvmalloc_array() 202 202 * and kvmalloc() will warn if the allocation size is greater than 203 - * INT_MAX, as filp_cachep objects are not __GFP_NOWARN. 203 + * INT_MAX, as filp_cache objects are not __GFP_NOWARN. 204 204 * 205 205 * This can happen when sysctl_nr_open is set to a very high value and 206 206 * a process tries to use a file descriptor near that limit. For example,
+19 -12
fs/file_table.c
··· 30 30 31 31 #include <linux/atomic.h> 32 32 33 + #include <asm/runtime-const.h> 34 + 33 35 #include "internal.h" 34 36 35 37 /* sysctl tunables... */ ··· 40 38 }; 41 39 42 40 /* SLAB cache for file structures */ 43 - static struct kmem_cache *filp_cachep __ro_after_init; 44 - static struct kmem_cache *bfilp_cachep __ro_after_init; 41 + static struct kmem_cache *__filp_cache __ro_after_init; 42 + #define filp_cache runtime_const_ptr(__filp_cache) 43 + static struct kmem_cache *__bfilp_cache __ro_after_init; 44 + #define bfilp_cache runtime_const_ptr(__bfilp_cache) 45 45 46 46 static struct percpu_counter nr_files __cacheline_aligned_in_smp; 47 47 ··· 78 74 put_cred(f->f_cred); 79 75 if (unlikely(f->f_mode & FMODE_BACKING)) { 80 76 path_put(backing_file_user_path(f)); 81 - kmem_cache_free(bfilp_cachep, backing_file(f)); 77 + kmem_cache_free(bfilp_cache, backing_file(f)); 82 78 } else { 83 - kmem_cache_free(filp_cachep, f); 79 + kmem_cache_free(filp_cache, f); 84 80 } 85 81 } 86 82 ··· 238 234 goto over; 239 235 } 240 236 241 - f = kmem_cache_alloc(filp_cachep, GFP_KERNEL); 237 + f = kmem_cache_alloc(filp_cache, GFP_KERNEL); 242 238 if (unlikely(!f)) 243 239 return ERR_PTR(-ENOMEM); 244 240 245 241 error = init_file(f, flags, cred); 246 242 if (unlikely(error)) { 247 - kmem_cache_free(filp_cachep, f); 243 + kmem_cache_free(filp_cache, f); 248 244 return ERR_PTR(error); 249 245 } 250 246 ··· 272 268 struct file *f; 273 269 int error; 274 270 275 - f = kmem_cache_alloc(filp_cachep, GFP_KERNEL); 271 + f = kmem_cache_alloc(filp_cache, GFP_KERNEL); 276 272 if (unlikely(!f)) 277 273 return ERR_PTR(-ENOMEM); 278 274 279 275 error = init_file(f, flags, cred); 280 276 if (unlikely(error)) { 281 - kmem_cache_free(filp_cachep, f); 277 + kmem_cache_free(filp_cache, f); 282 278 return ERR_PTR(error); 283 279 } 284 280 ··· 299 295 struct backing_file *ff; 300 296 int error; 301 297 302 - ff = kmem_cache_alloc(bfilp_cachep, GFP_KERNEL); 298 + ff = kmem_cache_alloc(bfilp_cache, GFP_KERNEL); 303 299 if (unlikely(!ff)) 304 300 return ERR_PTR(-ENOMEM); 305 301 306 302 error = init_file(&ff->file, flags, cred); 307 303 if (unlikely(error)) { 308 - kmem_cache_free(bfilp_cachep, ff); 304 + kmem_cache_free(bfilp_cache, ff); 309 305 return ERR_PTR(error); 310 306 } 311 307 ··· 597 593 .freeptr_offset = offsetof(struct file, f_freeptr), 598 594 }; 599 595 600 - filp_cachep = kmem_cache_create("filp", sizeof(struct file), &args, 596 + __filp_cache = kmem_cache_create("filp", sizeof(struct file), &args, 601 597 SLAB_HWCACHE_ALIGN | SLAB_PANIC | 602 598 SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU); 599 + runtime_const_init(ptr, __filp_cache); 603 600 604 601 args.freeptr_offset = offsetof(struct backing_file, bf_freeptr); 605 - bfilp_cachep = kmem_cache_create("bfilp", sizeof(struct backing_file), 602 + __bfilp_cache = kmem_cache_create("bfilp", sizeof(struct backing_file), 606 603 &args, SLAB_HWCACHE_ALIGN | SLAB_PANIC | 607 604 SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU); 605 + runtime_const_init(ptr, __bfilp_cache); 606 + 608 607 percpu_counter_init(&nr_files, 0, GFP_KERNEL); 609 608 } 610 609
-1
fs/fs_context.c
··· 318 318 return alloc_fs_context(dentry->d_sb->s_type, dentry, sb_flags, 319 319 sb_flags_mask, FS_CONTEXT_FOR_RECONFIGURE); 320 320 } 321 - EXPORT_SYMBOL(fs_context_for_reconfigure); 322 321 323 322 /** 324 323 * fs_context_for_submount: allocate a new fs_context for a submount
+1 -18
fs/fs_parser.c
··· 13 13 #include <linux/namei.h> 14 14 #include "internal.h" 15 15 16 - const struct constant_table bool_names[] = { 16 + static const struct constant_table bool_names[] = { 17 17 { "0", false }, 18 18 { "1", true }, 19 19 { "false", false }, ··· 22 22 { "yes", true }, 23 23 { }, 24 24 }; 25 - EXPORT_SYMBOL(bool_names); 26 25 27 26 static const struct constant_table * 28 27 __lookup_constant(const struct constant_table *tbl, const char *name) ··· 277 278 } 278 279 EXPORT_SYMBOL(fs_param_is_string); 279 280 280 - int fs_param_is_blob(struct p_log *log, const struct fs_parameter_spec *p, 281 - struct fs_parameter *param, struct fs_parse_result *result) 282 - { 283 - if (param->type != fs_value_is_blob) 284 - return fs_param_bad_value(log, param); 285 - return 0; 286 - } 287 - EXPORT_SYMBOL(fs_param_is_blob); 288 - 289 281 int fs_param_is_fd(struct p_log *log, const struct fs_parameter_spec *p, 290 282 struct fs_parameter *param, struct fs_parse_result *result) 291 283 { ··· 360 370 return 0; 361 371 } 362 372 EXPORT_SYMBOL(fs_param_is_blockdev); 363 - 364 - int fs_param_is_path(struct p_log *log, const struct fs_parameter_spec *p, 365 - struct fs_parameter *param, struct fs_parse_result *result) 366 - { 367 - return 0; 368 - } 369 - EXPORT_SYMBOL(fs_param_is_path); 370 373 371 374 #ifdef CONFIG_VALIDATE_FS_PARSER 372 375 /**
+2 -19
fs/hfs/inode.c
··· 622 622 return 0; 623 623 } 624 624 625 - /* 626 - * hfs_notify_change() 627 - * 628 - * Based very closely on fs/msdos/inode.c by Werner Almesberger 629 - * 630 - * This is the notify_change() field in the super_operations structure 631 - * for HFS file systems. The purpose is to take that changes made to 632 - * an inode and apply then in a filesystem-dependent manner. In this 633 - * case the process has a few of tasks to do: 634 - * 1) prevent changes to the i_uid and i_gid fields. 635 - * 2) map file permissions to the closest allowable permissions 636 - * 3) Since multiple Linux files can share the same on-disk inode under 637 - * HFS (for instance the data and resource forks of a file) a change 638 - * to permissions must be applied to all other in-core inodes which 639 - * correspond to the same HFS file. 640 - */ 641 - 642 625 int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 643 626 struct iattr *attr) 644 627 { ··· 629 646 struct hfs_sb_info *hsb = HFS_SB(inode->i_sb); 630 647 int error; 631 648 632 - error = setattr_prepare(&nop_mnt_idmap, dentry, 633 - attr); /* basic permission checks */ 649 + error = setattr_prepare(&nop_mnt_idmap, dentry, attr); 634 650 if (error) 635 651 return error; 636 652 ··· 645 663 return hsb->s_quiet ? 0 : error; 646 664 } 647 665 666 + /* map file permissions to the closest allowable permissions in HFS */ 648 667 if (attr->ia_valid & ATTR_MODE) { 649 668 /* Only the 'w' bits can ever change and only all together. */ 650 669 if (attr->ia_mode & S_IWUSR)
+1 -2
fs/internal.h
··· 198 198 extern int build_open_flags(const struct open_how *how, struct open_flags *op); 199 199 struct file *file_close_fd_locked(struct files_struct *files, unsigned fd); 200 200 201 - int do_ftruncate(struct file *file, loff_t length, int small); 202 - int do_sys_ftruncate(unsigned int fd, loff_t length, int small); 201 + int do_ftruncate(struct file *file, loff_t length, unsigned int flags); 203 202 int chmod_common(const struct path *path, umode_t mode); 204 203 int do_fchownat(int dfd, const char __user *filename, uid_t user, gid_t group, 205 204 int flag);
+1
fs/mbcache.c
··· 406 406 { 407 407 struct mb_cache_entry *entry, *next; 408 408 409 + cancel_work_sync(&cache->c_shrink_work); 409 410 shrinker_free(cache->c_shrink); 410 411 411 412 /*
+1 -1
fs/namei.c
··· 2140 2140 if (unlikely(!inode)) 2141 2141 return ERR_PTR(-ENOENT); 2142 2142 nd->path.dentry = dentry; 2143 - /* nd->path.mnt is retained on purpose */ 2143 + /* nd->path.mnt remains unchanged as no mount point was crossed */ 2144 2144 nd->inode = inode; 2145 2145 nd->seq = nd->next_seq; 2146 2146 return NULL;
+6
fs/omfs/inode.c
··· 513 513 goto out_brelse_bh; 514 514 } 515 515 516 + if (sbi->s_sys_blocksize < OMFS_DIR_START) { 517 + printk(KERN_ERR "omfs: sysblock size (%d) is too small\n", 518 + sbi->s_sys_blocksize); 519 + goto out_brelse_bh; 520 + } 521 + 516 522 if (sbi->s_blocksize < sbi->s_sys_blocksize || 517 523 sbi->s_blocksize > OMFS_MAX_BLOCK_SIZE) { 518 524 printk(KERN_ERR "omfs: block size (%d) is out of range\n",
+19 -21
fs/open.c
··· 126 126 } 127 127 EXPORT_SYMBOL_GPL(vfs_truncate); 128 128 129 - int do_sys_truncate(const char __user *pathname, loff_t length) 129 + int ksys_truncate(const char __user *pathname, loff_t length) 130 130 { 131 131 unsigned int lookup_flags = LOOKUP_FOLLOW; 132 132 struct path path; ··· 151 151 152 152 SYSCALL_DEFINE2(truncate, const char __user *, path, long, length) 153 153 { 154 - return do_sys_truncate(path, length); 154 + return ksys_truncate(path, length); 155 155 } 156 156 157 157 #ifdef CONFIG_COMPAT 158 158 COMPAT_SYSCALL_DEFINE2(truncate, const char __user *, path, compat_off_t, length) 159 159 { 160 - return do_sys_truncate(path, length); 160 + return ksys_truncate(path, length); 161 161 } 162 162 #endif 163 163 164 - int do_ftruncate(struct file *file, loff_t length, int small) 164 + int do_ftruncate(struct file *file, loff_t length, unsigned int flags) 165 165 { 166 - struct inode *inode; 167 - struct dentry *dentry; 166 + struct dentry *dentry = file->f_path.dentry; 167 + struct inode *inode = dentry->d_inode; 168 168 int error; 169 169 170 - /* explicitly opened as large or we are on 64-bit box */ 171 - if (file->f_flags & O_LARGEFILE) 172 - small = 0; 173 - 174 - dentry = file->f_path.dentry; 175 - inode = dentry->d_inode; 176 170 if (!S_ISREG(inode->i_mode) || !(file->f_mode & FMODE_WRITE)) 177 171 return -EINVAL; 178 172 179 - /* Cannot ftruncate over 2^31 bytes without large file support */ 180 - if (small && length > MAX_NON_LFS) 173 + /* 174 + * Cannot ftruncate over 2^31 bytes without large file support, either 175 + * through opening with O_LARGEFILE or by using ftruncate64(). 176 + */ 177 + if (length > MAX_NON_LFS && 178 + !(file->f_flags & O_LARGEFILE) && !(flags & FTRUNCATE_LFS)) 181 179 return -EINVAL; 182 180 183 181 /* Check IS_APPEND on real upper inode */ ··· 195 197 ATTR_MTIME | ATTR_CTIME, file); 196 198 } 197 199 198 - int do_sys_ftruncate(unsigned int fd, loff_t length, int small) 200 + int ksys_ftruncate(unsigned int fd, loff_t length, unsigned int flags) 199 201 { 200 202 if (length < 0) 201 203 return -EINVAL; ··· 203 205 if (fd_empty(f)) 204 206 return -EBADF; 205 207 206 - return do_ftruncate(fd_file(f), length, small); 208 + return do_ftruncate(fd_file(f), length, flags); 207 209 } 208 210 209 211 SYSCALL_DEFINE2(ftruncate, unsigned int, fd, off_t, length) 210 212 { 211 - return do_sys_ftruncate(fd, length, 1); 213 + return ksys_ftruncate(fd, length, 0); 212 214 } 213 215 214 216 #ifdef CONFIG_COMPAT 215 217 COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_off_t, length) 216 218 { 217 - return do_sys_ftruncate(fd, length, 1); 219 + return ksys_ftruncate(fd, length, 0); 218 220 } 219 221 #endif 220 222 ··· 222 224 #if BITS_PER_LONG == 32 223 225 SYSCALL_DEFINE2(truncate64, const char __user *, path, loff_t, length) 224 226 { 225 - return do_sys_truncate(path, length); 227 + return ksys_truncate(path, length); 226 228 } 227 229 228 230 SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length) 229 231 { 230 - return do_sys_ftruncate(fd, length, 0); 232 + return ksys_ftruncate(fd, length, FTRUNCATE_LFS); 231 233 } 232 234 #endif /* BITS_PER_LONG == 32 */ 233 235 ··· 243 245 COMPAT_SYSCALL_DEFINE3(ftruncate64, unsigned int, fd, 244 246 compat_arg_u64_dual(length)) 245 247 { 246 - return ksys_ftruncate(fd, compat_arg_u64_glue(length)); 248 + return ksys_ftruncate(fd, compat_arg_u64_glue(length), FTRUNCATE_LFS); 247 249 } 248 250 #endif 249 251
+11 -11
fs/proc/base.c
··· 721 721 return allowed; 722 722 } 723 723 724 - int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 724 + int proc_nochmod_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 725 725 struct iattr *attr) 726 726 { 727 727 int error; ··· 794 794 795 795 796 796 static const struct inode_operations proc_def_inode_operations = { 797 - .setattr = proc_setattr, 797 + .setattr = proc_nochmod_setattr, 798 798 }; 799 799 800 800 static int proc_single_show(struct seq_file *m, void *v) ··· 1866 1866 const struct inode_operations proc_pid_link_inode_operations = { 1867 1867 .readlink = proc_pid_readlink, 1868 1868 .get_link = proc_pid_get_link, 1869 - .setattr = proc_setattr, 1869 + .setattr = proc_nochmod_setattr, 1870 1870 }; 1871 1871 1872 1872 ··· 2319 2319 static const struct inode_operations proc_map_files_link_inode_operations = { 2320 2320 .readlink = proc_pid_readlink, 2321 2321 .get_link = proc_map_files_get_link, 2322 - .setattr = proc_setattr, 2322 + .setattr = proc_nochmod_setattr, 2323 2323 }; 2324 2324 2325 2325 static struct dentry * ··· 2398 2398 static const struct inode_operations proc_map_files_inode_operations = { 2399 2399 .lookup = proc_map_files_lookup, 2400 2400 .permission = proc_fd_permission, 2401 - .setattr = proc_setattr, 2401 + .setattr = proc_nochmod_setattr, 2402 2402 }; 2403 2403 2404 2404 static int ··· 2885 2885 static const struct inode_operations proc_##LSM##_attr_dir_inode_ops = { \ 2886 2886 .lookup = proc_##LSM##_attr_dir_lookup, \ 2887 2887 .getattr = pid_getattr, \ 2888 - .setattr = proc_setattr, \ 2888 + .setattr = proc_nochmod_setattr, \ 2889 2889 } 2890 2890 2891 2891 #ifdef CONFIG_SECURITY_SMACK ··· 2944 2944 static const struct inode_operations proc_attr_dir_inode_operations = { 2945 2945 .lookup = proc_attr_dir_lookup, 2946 2946 .getattr = pid_getattr, 2947 - .setattr = proc_setattr, 2947 + .setattr = proc_nochmod_setattr, 2948 2948 }; 2949 2949 2950 2950 #endif ··· 3453 3453 static const struct inode_operations proc_tgid_base_inode_operations = { 3454 3454 .lookup = proc_tgid_base_lookup, 3455 3455 .getattr = pid_getattr, 3456 - .setattr = proc_setattr, 3456 + .setattr = proc_nochmod_setattr, 3457 3457 .permission = proc_pid_permission, 3458 3458 }; 3459 3459 ··· 3650 3650 } 3651 3651 3652 3652 static const struct inode_operations proc_tid_comm_inode_operations = { 3653 - .setattr = proc_setattr, 3653 + .setattr = proc_nochmod_setattr, 3654 3654 .permission = proc_tid_comm_permission, 3655 3655 }; 3656 3656 ··· 3779 3779 static const struct inode_operations proc_tid_base_inode_operations = { 3780 3780 .lookup = proc_tid_base_lookup, 3781 3781 .getattr = pid_getattr, 3782 - .setattr = proc_setattr, 3782 + .setattr = proc_nochmod_setattr, 3783 3783 }; 3784 3784 3785 3785 static struct dentry *proc_task_instantiate(struct dentry *dentry, ··· 3992 3992 static const struct inode_operations proc_task_inode_operations = { 3993 3993 .lookup = proc_task_lookup, 3994 3994 .getattr = proc_task_getattr, 3995 - .setattr = proc_setattr, 3995 + .setattr = proc_nochmod_setattr, 3996 3996 .permission = proc_pid_permission, 3997 3997 }; 3998 3998
+3 -3
fs/proc/fd.c
··· 102 102 103 103 static const struct inode_operations proc_fdinfo_file_inode_operations = { 104 104 .permission = proc_fdinfo_permission, 105 - .setattr = proc_setattr, 105 + .setattr = proc_nochmod_setattr, 106 106 }; 107 107 108 108 static const struct file_operations proc_fdinfo_file_operations = { ··· 361 361 .lookup = proc_lookupfd, 362 362 .permission = proc_fd_permission, 363 363 .getattr = proc_fd_getattr, 364 - .setattr = proc_setattr, 364 + .setattr = proc_nochmod_setattr, 365 365 }; 366 366 367 367 static struct dentry *proc_fdinfo_instantiate(struct dentry *dentry, ··· 402 402 const struct inode_operations proc_fdinfo_inode_operations = { 403 403 .lookup = proc_lookupfdinfo, 404 404 .permission = proc_fdinfo_permission, 405 - .setattr = proc_setattr, 405 + .setattr = proc_nochmod_setattr, 406 406 }; 407 407 408 408 const struct file_operations proc_fdinfo_operations = {
+4 -4
fs/proc/generic.c
··· 115 115 return true; 116 116 } 117 117 118 - static int proc_notify_change(struct mnt_idmap *idmap, 119 - struct dentry *dentry, struct iattr *iattr) 118 + static int proc_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 119 + struct iattr *iattr) 120 120 { 121 121 struct inode *inode = d_inode(dentry); 122 122 struct proc_dir_entry *de = PDE(inode); ··· 151 151 } 152 152 153 153 static const struct inode_operations proc_file_inode_operations = { 154 - .setattr = proc_notify_change, 154 + .setattr = proc_setattr, 155 155 }; 156 156 157 157 /* ··· 364 364 static const struct inode_operations proc_dir_inode_operations = { 365 365 .lookup = proc_lookup, 366 366 .getattr = proc_getattr, 367 - .setattr = proc_notify_change, 367 + .setattr = proc_setattr, 368 368 }; 369 369 370 370 static void pde_set_flags(struct proc_dir_entry *pde)
+2 -2
fs/proc/internal.h
··· 257 257 extern const struct dentry_operations pid_dentry_operations; 258 258 extern int pid_getattr(struct mnt_idmap *, const struct path *, 259 259 struct kstat *, u32, unsigned int); 260 - extern int proc_setattr(struct mnt_idmap *, struct dentry *, 261 - struct iattr *); 260 + int proc_nochmod_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 261 + struct iattr *attr); 262 262 extern void proc_pid_evict_inode(struct proc_inode *); 263 263 extern struct inode *proc_pid_make_inode(struct super_block *, struct task_struct *, umode_t); 264 264 extern void pid_update_inode(struct task_struct *, struct inode *);
+2 -2
fs/proc/namespaces.c
··· 92 92 static const struct inode_operations proc_ns_link_inode_operations = { 93 93 .readlink = proc_ns_readlink, 94 94 .get_link = proc_ns_get_link, 95 - .setattr = proc_setattr, 95 + .setattr = proc_nochmod_setattr, 96 96 }; 97 97 98 98 static struct dentry *proc_ns_instantiate(struct dentry *dentry, ··· 178 178 const struct inode_operations proc_ns_dir_inode_operations = { 179 179 .lookup = proc_ns_dir_lookup, 180 180 .getattr = pid_getattr, 181 - .setattr = proc_setattr, 181 + .setattr = proc_nochmod_setattr, 182 182 };
+1 -1
fs/proc/proc_net.c
··· 322 322 const struct inode_operations proc_net_inode_operations = { 323 323 .lookup = proc_tgid_net_lookup, 324 324 .getattr = proc_tgid_net_getattr, 325 - .setattr = proc_setattr, 325 + .setattr = proc_nochmod_setattr, 326 326 }; 327 327 328 328 static int proc_tgid_net_readdir(struct file *file, struct dir_context *ctx)
+40 -63
fs/readdir.c
··· 22 22 #include <linux/compat.h> 23 23 #include <linux/uaccess.h> 24 24 25 + #define dirent_size(dirent, len) offsetof(typeof(*(dirent)), d_name[len]) 26 + 25 27 /* 26 28 * Some filesystems were never converted to '->iterate_shared()' 27 29 * and their directory iterators want the inode lock held for ··· 200 198 } 201 199 buf->result++; 202 200 dirent = buf->dirent; 203 - if (!user_write_access_begin(dirent, 204 - (unsigned long)(dirent->d_name + namlen + 1) - 205 - (unsigned long)dirent)) 206 - goto efault; 207 - unsafe_put_user(d_ino, &dirent->d_ino, efault_end); 208 - unsafe_put_user(offset, &dirent->d_offset, efault_end); 209 - unsafe_put_user(namlen, &dirent->d_namlen, efault_end); 210 - unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end); 211 - user_write_access_end(); 201 + scoped_user_write_access_size(dirent, dirent_size(dirent, namlen + 1), efault) { 202 + unsafe_put_user(d_ino, &dirent->d_ino, efault); 203 + unsafe_put_user(offset, &dirent->d_offset, efault); 204 + unsafe_put_user(namlen, &dirent->d_namlen, efault); 205 + unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault); 206 + } 212 207 return true; 213 - efault_end: 214 - user_write_access_end(); 215 208 efault: 216 209 buf->result = -EFAULT; 217 210 return false; ··· 260 263 struct getdents_callback *buf = 261 264 container_of(ctx, struct getdents_callback, ctx); 262 265 unsigned long d_ino; 263 - int reclen = ALIGN(offsetof(struct linux_dirent, d_name) + namlen + 2, 264 - sizeof(long)); 266 + int reclen = ALIGN(dirent_size(dirent, namlen + 2), sizeof(long)); 265 267 int prev_reclen; 266 268 unsigned int flags = d_type; 267 269 ··· 283 287 return false; 284 288 dirent = buf->current_dir; 285 289 prev = (void __user *) dirent - prev_reclen; 286 - if (!user_write_access_begin(prev, reclen + prev_reclen)) 287 - goto efault; 288 - 289 - /* This might be 'dirent->d_off', but if so it will get overwritten */ 290 - unsafe_put_user(offset, &prev->d_off, efault_end); 291 - unsafe_put_user(d_ino, &dirent->d_ino, efault_end); 292 - unsafe_put_user(reclen, &dirent->d_reclen, efault_end); 293 - unsafe_put_user(d_type, (char __user *) dirent + reclen - 1, efault_end); 294 - unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end); 295 - user_write_access_end(); 290 + scoped_user_write_access_size(prev, reclen + prev_reclen, efault) { 291 + /* This might be 'dirent->d_off', but if so it will get overwritten */ 292 + unsafe_put_user(offset, &prev->d_off, efault); 293 + unsafe_put_user(d_ino, &dirent->d_ino, efault); 294 + unsafe_put_user(reclen, &dirent->d_reclen, efault); 295 + unsafe_put_user(d_type, (char __user *)dirent + reclen - 1, efault); 296 + unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault); 297 + } 296 298 297 299 buf->current_dir = (void __user *)dirent + reclen; 298 300 buf->prev_reclen = reclen; 299 301 ctx->count -= reclen; 300 302 return true; 301 - efault_end: 302 - user_write_access_end(); 303 303 efault: 304 304 buf->error = -EFAULT; 305 305 return false; ··· 344 352 struct linux_dirent64 __user *dirent, *prev; 345 353 struct getdents_callback64 *buf = 346 354 container_of(ctx, struct getdents_callback64, ctx); 347 - int reclen = ALIGN(offsetof(struct linux_dirent64, d_name) + namlen + 1, 348 - sizeof(u64)); 355 + int reclen = ALIGN(dirent_size(dirent, namlen + 1), sizeof(u64)); 349 356 int prev_reclen; 350 357 unsigned int flags = d_type; 351 358 ··· 362 371 return false; 363 372 dirent = buf->current_dir; 364 373 prev = (void __user *)dirent - prev_reclen; 365 - if (!user_write_access_begin(prev, reclen + prev_reclen)) 366 - goto efault; 367 - 368 - /* This might be 'dirent->d_off', but if so it will get overwritten */ 369 - unsafe_put_user(offset, &prev->d_off, efault_end); 370 - unsafe_put_user(ino, &dirent->d_ino, efault_end); 371 - unsafe_put_user(reclen, &dirent->d_reclen, efault_end); 372 - unsafe_put_user(d_type, &dirent->d_type, efault_end); 373 - unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end); 374 - user_write_access_end(); 374 + scoped_user_write_access_size(prev, reclen + prev_reclen, efault) { 375 + /* This might be 'dirent->d_off', but if so it will get overwritten */ 376 + unsafe_put_user(offset, &prev->d_off, efault); 377 + unsafe_put_user(ino, &dirent->d_ino, efault); 378 + unsafe_put_user(reclen, &dirent->d_reclen, efault); 379 + unsafe_put_user(d_type, &dirent->d_type, efault); 380 + unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault); 381 + } 375 382 376 383 buf->prev_reclen = reclen; 377 384 buf->current_dir = (void __user *)dirent + reclen; 378 385 ctx->count -= reclen; 379 386 return true; 380 387 381 - efault_end: 382 - user_write_access_end(); 383 388 efault: 384 389 buf->error = -EFAULT; 385 390 return false; ··· 447 460 } 448 461 buf->result++; 449 462 dirent = buf->dirent; 450 - if (!user_write_access_begin(dirent, 451 - (unsigned long)(dirent->d_name + namlen + 1) - 452 - (unsigned long)dirent)) 453 - goto efault; 454 - unsafe_put_user(d_ino, &dirent->d_ino, efault_end); 455 - unsafe_put_user(offset, &dirent->d_offset, efault_end); 456 - unsafe_put_user(namlen, &dirent->d_namlen, efault_end); 457 - unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end); 458 - user_write_access_end(); 463 + scoped_user_write_access_size(dirent, dirent_size(dirent, namlen + 1), efault) { 464 + unsafe_put_user(d_ino, &dirent->d_ino, efault); 465 + unsafe_put_user(offset, &dirent->d_offset, efault); 466 + unsafe_put_user(namlen, &dirent->d_namlen, efault); 467 + unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault); 468 + } 459 469 return true; 460 - efault_end: 461 - user_write_access_end(); 462 470 efault: 463 471 buf->result = -EFAULT; 464 472 return false; ··· 501 519 struct compat_getdents_callback *buf = 502 520 container_of(ctx, struct compat_getdents_callback, ctx); 503 521 compat_ulong_t d_ino; 504 - int reclen = ALIGN(offsetof(struct compat_linux_dirent, d_name) + 505 - namlen + 2, sizeof(compat_long_t)); 522 + int reclen = ALIGN(dirent_size(dirent, namlen + 2), sizeof(compat_long_t)); 506 523 int prev_reclen; 507 524 unsigned int flags = d_type; 508 525 ··· 524 543 return false; 525 544 dirent = buf->current_dir; 526 545 prev = (void __user *) dirent - prev_reclen; 527 - if (!user_write_access_begin(prev, reclen + prev_reclen)) 528 - goto efault; 529 - 530 - unsafe_put_user(offset, &prev->d_off, efault_end); 531 - unsafe_put_user(d_ino, &dirent->d_ino, efault_end); 532 - unsafe_put_user(reclen, &dirent->d_reclen, efault_end); 533 - unsafe_put_user(d_type, (char __user *) dirent + reclen - 1, efault_end); 534 - unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault_end); 535 - user_write_access_end(); 546 + scoped_user_write_access_size(prev, reclen + prev_reclen, efault) { 547 + unsafe_put_user(offset, &prev->d_off, efault); 548 + unsafe_put_user(d_ino, &dirent->d_ino, efault); 549 + unsafe_put_user(reclen, &dirent->d_reclen, efault); 550 + unsafe_put_user(d_type, (char __user *)dirent + reclen - 1, efault); 551 + unsafe_copy_dirent_name(dirent->d_name, name, namlen, efault); 552 + } 536 553 537 554 buf->prev_reclen = reclen; 538 555 buf->current_dir = (void __user *)dirent + reclen; 539 556 ctx->count -= reclen; 540 557 return true; 541 - efault_end: 542 - user_write_access_end(); 543 558 efault: 544 559 buf->error = -EFAULT; 545 560 return false;
+14 -21
fs/select.c
··· 1004 1004 fdcount = do_poll(head, &table, end_time); 1005 1005 poll_freewait(&table); 1006 1006 1007 - if (!user_write_access_begin(ufds, nfds * sizeof(*ufds))) 1008 - goto out_fds; 1007 + scoped_user_write_access_size(ufds, nfds * sizeof(*ufds), out_fds) { 1008 + struct pollfd __user *_ufds = ufds; 1009 1009 1010 - for (walk = head; walk; walk = walk->next) { 1011 - struct pollfd *fds = walk->entries; 1012 - unsigned int j; 1010 + for (walk = head; walk; walk = walk->next) { 1011 + struct pollfd *fds = walk->entries; 1012 + unsigned int j; 1013 1013 1014 - for (j = walk->len; j; fds++, ufds++, j--) 1015 - unsafe_put_user(fds->revents, &ufds->revents, Efault); 1016 - } 1017 - user_write_access_end(); 1014 + for (j = walk->len; j; fds++, _ufds++, j--) 1015 + unsafe_put_user(fds->revents, &_ufds->revents, out_fds); 1016 + } 1017 + } 1018 1018 1019 1019 err = fdcount; 1020 1020 out_fds: ··· 1026 1026 } 1027 1027 1028 1028 return err; 1029 - 1030 - Efault: 1031 - user_write_access_end(); 1032 - err = -EFAULT; 1033 - goto out_fds; 1034 1029 } 1035 1030 1036 1031 static long do_restart_poll(struct restart_block *restart_block) ··· 1333 1338 struct compat_sigset_argpack __user *from) 1334 1339 { 1335 1340 if (from) { 1336 - if (!user_read_access_begin(from, sizeof(*from))) 1337 - return -EFAULT; 1338 - unsafe_get_user(to->p, &from->p, Efault); 1339 - unsafe_get_user(to->size, &from->size, Efault); 1340 - user_read_access_end(); 1341 + scoped_user_read_access(from, efault) { 1342 + unsafe_get_user(to->p, &from->p, efault); 1343 + unsafe_get_user(to->size, &from->size, efault); 1344 + } 1341 1345 } 1342 1346 return 0; 1343 - Efault: 1344 - user_read_access_end(); 1347 + efault: 1345 1348 return -EFAULT; 1346 1349 } 1347 1350
+3 -1
include/asm-generic/vmlinux.lds.h
··· 975 975 RUNTIME_CONST(shift, d_hash_shift) \ 976 976 RUNTIME_CONST(ptr, dentry_hashtable) \ 977 977 RUNTIME_CONST(ptr, __dentry_cache) \ 978 - RUNTIME_CONST(ptr, __names_cache) 978 + RUNTIME_CONST(ptr, __names_cache) \ 979 + RUNTIME_CONST(ptr, __filp_cache) \ 980 + RUNTIME_CONST(ptr, __bfilp_cache) 979 981 980 982 /* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */ 981 983 #define KUNIT_TABLE() \
+1 -1
include/linux/backing-dev-defs.h
··· 237 237 } 238 238 239 239 /** 240 - * wb_put - decrement a wb's refcount 240 + * wb_put_many - decrement a wb's refcount 241 241 * @wb: bdi_writeback to put 242 242 * @nr: number of references to put 243 243 */
+1
include/linux/blkdev.h
··· 38 38 struct kiocb; 39 39 struct pr_ops; 40 40 struct rq_qos; 41 + struct hd_geometry; 41 42 struct blk_report_zones_args; 42 43 struct blk_queue_stats; 43 44 struct blk_stat_callback;
-3
include/linux/fs.h
··· 55 55 struct bio; 56 56 struct io_comp_batch; 57 57 struct fiemap_extent_info; 58 - struct hd_geometry; 59 - struct iovec; 60 58 struct kiocb; 61 59 struct kobject; 62 60 struct pipe_inode_info; ··· 1918 1920 */ 1919 1921 #define COPY_FILE_SPLICE (1 << 0) 1920 1922 1921 - struct iov_iter; 1922 1923 struct io_uring_cmd; 1923 1924 struct offset_ctx; 1924 1925
+2 -6
include/linux/fs_parser.h
··· 27 27 * The type of parameter expected. 28 28 */ 29 29 fs_param_type fs_param_is_bool, fs_param_is_u32, fs_param_is_s32, fs_param_is_u64, 30 - fs_param_is_enum, fs_param_is_string, fs_param_is_blob, fs_param_is_blockdev, 31 - fs_param_is_path, fs_param_is_fd, fs_param_is_uid, fs_param_is_gid, 30 + fs_param_is_enum, fs_param_is_string, fs_param_is_blockdev, 31 + fs_param_is_fd, fs_param_is_uid, fs_param_is_gid, 32 32 fs_param_is_file_or_string; 33 33 34 34 /* ··· 84 84 85 85 extern int lookup_constant(const struct constant_table tbl[], const char *name, int not_found); 86 86 87 - extern const struct constant_table bool_names[]; 88 - 89 87 #ifdef CONFIG_VALIDATE_FS_PARSER 90 88 extern bool fs_validate_description(const char *name, 91 89 const struct fs_parameter_spec *desc); ··· 125 127 #define fsparam_enum(NAME, OPT, array) __fsparam(fs_param_is_enum, NAME, OPT, 0, array) 126 128 #define fsparam_string(NAME, OPT) \ 127 129 __fsparam(fs_param_is_string, NAME, OPT, 0, NULL) 128 - #define fsparam_blob(NAME, OPT) __fsparam(fs_param_is_blob, NAME, OPT, 0, NULL) 129 130 #define fsparam_bdev(NAME, OPT) __fsparam(fs_param_is_blockdev, NAME, OPT, 0, NULL) 130 - #define fsparam_path(NAME, OPT) __fsparam(fs_param_is_path, NAME, OPT, 0, NULL) 131 131 #define fsparam_fd(NAME, OPT) __fsparam(fs_param_is_fd, NAME, OPT, 0, NULL) 132 132 #define fsparam_file_or_string(NAME, OPT) \ 133 133 __fsparam(fs_param_is_file_or_string, NAME, OPT, 0, NULL)
+3 -13
include/linux/syscalls.h
··· 1283 1283 AT_SYMLINK_NOFOLLOW); 1284 1284 } 1285 1285 1286 - int do_sys_ftruncate(unsigned int fd, loff_t length, int small); 1287 - 1288 - static inline long ksys_ftruncate(unsigned int fd, loff_t length) 1289 - { 1290 - return do_sys_ftruncate(fd, length, 1); 1291 - } 1292 - 1293 - int do_sys_truncate(const char __user *pathname, loff_t length); 1294 - 1295 - static inline long ksys_truncate(const char __user *pathname, loff_t length) 1296 - { 1297 - return do_sys_truncate(pathname, length); 1298 - } 1286 + #define FTRUNCATE_LFS (1u << 0) /* allow truncating > 32-bit */ 1287 + int ksys_ftruncate(unsigned int fd, loff_t length, unsigned int flags); 1288 + int ksys_truncate(const char __user *pathname, loff_t length); 1299 1289 1300 1290 static inline unsigned int ksys_personality(unsigned int personality) 1301 1291 {
+45
include/trace/events/coredump.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (c) 2026 Meta Platforms, Inc. and affiliates. 4 + * Copyright (c) 2026 Breno Leitao <leitao@debian.org> 5 + */ 6 + #undef TRACE_SYSTEM 7 + #define TRACE_SYSTEM coredump 8 + 9 + #if !defined(_TRACE_COREDUMP_H) || defined(TRACE_HEADER_MULTI_READ) 10 + #define _TRACE_COREDUMP_H 11 + 12 + #include <linux/sched.h> 13 + #include <linux/tracepoint.h> 14 + 15 + /** 16 + * coredump - called when a coredump starts 17 + * @sig: signal number that triggered the coredump 18 + * 19 + * This tracepoint fires at the beginning of a coredump attempt, 20 + * providing a stable interface for monitoring coredump events. 21 + */ 22 + TRACE_EVENT(coredump, 23 + 24 + TP_PROTO(int sig), 25 + 26 + TP_ARGS(sig), 27 + 28 + TP_STRUCT__entry( 29 + __field(int, sig) 30 + __array(char, comm, TASK_COMM_LEN) 31 + ), 32 + 33 + TP_fast_assign( 34 + __entry->sig = sig; 35 + memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 36 + ), 37 + 38 + TP_printk("sig=%d comm=%s", 39 + __entry->sig, __entry->comm) 40 + ); 41 + 42 + #endif /* _TRACE_COREDUMP_H */ 43 + 44 + /* This part must be outside protection */ 45 + #include <trace/define_trace.h>
+1 -1
init/initramfs.c
··· 212 212 hdr_csum = parsed[12]; 213 213 } 214 214 215 - /* FSM */ 215 + /* Finite-state machine */ 216 216 217 217 static __initdata enum state { 218 218 Start,
+1 -1
io_uring/truncate.c
··· 41 41 42 42 WARN_ON_ONCE(issue_flags & IO_URING_F_NONBLOCK); 43 43 44 - ret = do_ftruncate(req->file, ft->len, 1); 44 + ret = do_ftruncate(req->file, ft->len, 0); 45 45 46 46 io_req_set_res(req, ret, 0); 47 47 return IOU_COMPLETE;
+1 -1
kernel/acct.c
··· 244 244 if (!S_ISREG(file_inode(file)->i_mode)) 245 245 return -EACCES; 246 246 247 - /* Exclude kernel kernel internal filesystems. */ 247 + /* Exclude kernel internal filesystems. */ 248 248 if (file_inode(file)->i_sb->s_flags & (SB_NOUSER | SB_KERNMOUNT)) 249 249 return -EINVAL; 250 250
-2
tools/testing/selftests/filesystems/devpts_pts.c
··· 119 119 goto do_cleanup; 120 120 } 121 121 122 - #ifdef TIOCGPTPEER 123 122 slave = ioctl(master, TIOCGPTPEER, O_RDWR | O_NOCTTY | O_CLOEXEC); 124 - #endif 125 123 if (slave < 0) { 126 124 if (errno == EINVAL) { 127 125 fprintf(stderr, "TIOCGPTPEER is not supported. "