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

Pull misc VFS updates from Al Viro:
"VFS-related cleanups in various places (mostly of the "that really
can't happen" or "there's a better way to do it" variety)"

* tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
gpib: use file_inode()
binder_ioctl_write_read(): simplify control flow a bit
secretmem: move setting O_LARGEFILE and bumping users' count to the place where we create the file
apparmor: file never has NULL f_path.mnt
landlock: opened file never has a negative dentry

+11 -21
+6 -14
drivers/android/binder.c
··· 5384 5384 void __user *ubuf = (void __user *)arg; 5385 5385 struct binder_write_read bwr; 5386 5386 5387 - if (copy_from_user(&bwr, ubuf, sizeof(bwr))) { 5388 - ret = -EFAULT; 5389 - goto out; 5390 - } 5387 + if (copy_from_user(&bwr, ubuf, sizeof(bwr))) 5388 + return -EFAULT; 5389 + 5391 5390 binder_debug(BINDER_DEBUG_READ_WRITE, 5392 5391 "%d:%d write %lld at %016llx, read %lld at %016llx\n", 5393 5392 proc->pid, thread->pid, ··· 5401 5402 trace_binder_write_done(ret); 5402 5403 if (ret < 0) { 5403 5404 bwr.read_consumed = 0; 5404 - if (copy_to_user(ubuf, &bwr, sizeof(bwr))) 5405 - ret = -EFAULT; 5406 5405 goto out; 5407 5406 } 5408 5407 } ··· 5414 5417 if (!binder_worklist_empty_ilocked(&proc->todo)) 5415 5418 binder_wakeup_proc_ilocked(proc); 5416 5419 binder_inner_proc_unlock(proc); 5417 - if (ret < 0) { 5418 - if (copy_to_user(ubuf, &bwr, sizeof(bwr))) 5419 - ret = -EFAULT; 5420 + if (ret < 0) 5420 5421 goto out; 5421 - } 5422 5422 } 5423 5423 binder_debug(BINDER_DEBUG_READ_WRITE, 5424 5424 "%d:%d wrote %lld of %lld, read return %lld of %lld\n", 5425 5425 proc->pid, thread->pid, 5426 5426 (u64)bwr.write_consumed, (u64)bwr.write_size, 5427 5427 (u64)bwr.read_consumed, (u64)bwr.read_size); 5428 - if (copy_to_user(ubuf, &bwr, sizeof(bwr))) { 5429 - ret = -EFAULT; 5430 - goto out; 5431 - } 5432 5428 out: 5429 + if (copy_to_user(ubuf, &bwr, sizeof(bwr))) 5430 + ret = -EFAULT; 5433 5431 return ret; 5434 5432 } 5435 5433
+1 -1
drivers/staging/gpib/common/gpib_os.c
··· 610 610 611 611 long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) 612 612 { 613 - unsigned int minor = iminor(filep->f_path.dentry->d_inode); 613 + unsigned int minor = iminor(file_inode(filep)); 614 614 struct gpib_board *board; 615 615 struct gpib_file_private *file_priv = filep->private_data; 616 616 long retval = -ENOTTY;
+3 -4
mm/secretmem.c
··· 201 201 return ERR_CAST(inode); 202 202 203 203 file = alloc_file_pseudo(inode, secretmem_mnt, "secretmem", 204 - O_RDWR, &secretmem_fops); 204 + O_RDWR | O_LARGEFILE, &secretmem_fops); 205 205 if (IS_ERR(file)) 206 206 goto err_free_inode; 207 207 ··· 214 214 /* pretend we are a normal file with zero size */ 215 215 inode->i_mode |= S_IFREG; 216 216 inode->i_size = 0; 217 + 218 + atomic_inc(&secretmem_users); 217 219 218 220 return file; 219 221 ··· 250 248 goto err_put_fd; 251 249 } 252 250 253 - file->f_flags |= O_LARGEFILE; 254 - 255 - atomic_inc(&secretmem_users); 256 251 fd_install(fd, file); 257 252 return fd; 258 253
+1 -1
security/apparmor/file.c
··· 604 604 rcu_read_unlock(); 605 605 /* TODO: label cross check */ 606 606 607 - if (file->f_path.mnt && path_mediated_fs(file->f_path.dentry)) 607 + if (path_mediated_fs(file->f_path.dentry)) 608 608 error = __file_path_perm(op, subj_cred, label, flabel, file, 609 609 request, denied, in_atomic); 610 610
-1
security/landlock/syscalls.c
··· 303 303 if ((fd_file(f)->f_op == &ruleset_fops) || 304 304 (fd_file(f)->f_path.mnt->mnt_flags & MNT_INTERNAL) || 305 305 (fd_file(f)->f_path.dentry->d_sb->s_flags & SB_NOUSER) || 306 - d_is_negative(fd_file(f)->f_path.dentry) || 307 306 IS_PRIVATE(d_backing_inode(fd_file(f)->f_path.dentry))) 308 307 return -EBADFD; 309 308