Re: [PATCH RFC] VFS: lock source directory for link to avoid rename race.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 16, 2022 at 08:28:06AM +0200, Miklos Szeredi wrote:

> This will break AT_SYMLINK_FOLLOW.

Right you are.

> And yes, we can add all the lookup logic to do_linkat() at which point
> it will about 10x more complex than it was.

Especially since you can't reject an apparent cross-fs link until you'v
looked the fucker up, since it just might be a symlink to be followed.
Which means it would have to be something like
	find parents
again:
	if on different mounts
		if !follow
			fuck off
		lock old parent
		look the last component up
		if not an existing symlink
			fuck off
		unlock the parent and try to follow that symlink
		goto again
	lock parents
	look the last components up
	if symlink to be followed
		unlock parents
		try to follow symlink
		goto again
	proceed

Not exactly fatal, but...



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux