lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87li23y05q.fsf@tw-ebiederman.twitter.com>
Date:	Tue, 08 Oct 2013 13:31:45 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	"Serge E. Hallyn" <serge@...lyn.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Linux-Fsdevel <linux-fsdevel@...r.kernel.org>,
	Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andy Lutomirski <luto@...capital.net>,
	Rob Landley <rob@...dley.net>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC][PATCH 1/3] vfs: Keep a list of mounts on a mount point

Miklos Szeredi <miklos@...redi.hu> writes:

>> @@ -691,6 +693,7 @@ static void detach_mnt(struct mount *mnt, struct path *old_path)
>>  	list_del_init(&mnt->mnt_hash);
>>  	put_mountpoint(mnt->mnt_mp);
>>  	mnt->mnt_mp = NULL;
>> +	list_del_init(&mnt->mnt_mp_list);
>
> Should be done *before* put_mountpoint(), for obvious reasons.
>
> And a BUG_ON(!list_empty(&mp->m_list)) in put_mountpoint() for good measure (and
> no, WARN_ON() is not better here, since use-after-free is definitely worse than
> a BUG).

Good point.  I will take a look at making this change shortly and repost
the patches.


>>  }
>>  
>>  /*
>> @@ -705,6 +708,7 @@ void mnt_set_mountpoint(struct mount *mnt,
>>  	child_mnt->mnt_mountpoint = dget(mp->m_dentry);
>>  	child_mnt->mnt_parent = mnt;
>>  	child_mnt->mnt_mp = mp;
>> +	list_add_tail(&child_mnt->mnt_mp_list, &mp->m_list);
>>  }
>>  
>>  /*
>> @@ -1193,6 +1197,7 @@ void umount_tree(struct mount *mnt, int propagate)
>>  			p->mnt_parent->mnt_ghosts++;
>>  			put_mountpoint(p->mnt_mp);
>>  			p->mnt_mp = NULL;
>> +			list_del_init(&mnt->mnt_mp_list);
>
> Ditto.
>
>>  		}
>>  		change_mnt_propagation(p, MS_PRIVATE);
>>  	}
>> -- 
>> 1.7.5.4
>> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ