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

Pull /proc/sys dcache lookup fix from Al Viro:
"Fix for the breakage spotted by Neil in the interplay between
/proc/sys ->d_compare() weirdness and parallel lookups"

* tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fix proc_sys_compare() handling of in-lookup dentries

+12 -8
+1 -1
fs/proc/inode.c
··· 42 42 43 43 head = ei->sysctl; 44 44 if (head) { 45 - RCU_INIT_POINTER(ei->sysctl, NULL); 45 + WRITE_ONCE(ei->sysctl, NULL); 46 46 proc_sys_evict_inode(inode, head); 47 47 } 48 48 }
+11 -7
fs/proc/proc_sysctl.c
··· 918 918 struct ctl_table_header *head; 919 919 struct inode *inode; 920 920 921 - /* Although proc doesn't have negative dentries, rcu-walk means 922 - * that inode here can be NULL */ 923 - /* AV: can it, indeed? */ 924 - inode = d_inode_rcu(dentry); 925 - if (!inode) 926 - return 1; 927 921 if (name->len != len) 928 922 return 1; 929 923 if (memcmp(name->name, str, len)) 930 924 return 1; 931 - head = rcu_dereference(PROC_I(inode)->sysctl); 925 + 926 + // false positive is fine here - we'll recheck anyway 927 + if (d_in_lookup(dentry)) 928 + return 0; 929 + 930 + inode = d_inode_rcu(dentry); 931 + // we just might have run into dentry in the middle of __dentry_kill() 932 + if (!inode) 933 + return 1; 934 + 935 + head = READ_ONCE(PROC_I(inode)->sysctl); 932 936 return !head || !sysctl_is_seen(head); 933 937 } 934 938