Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ec6c2ae authored by Li Zhong's avatar Li Zhong Committed by Al Viro
Browse files

fix unpaired rcu lock in prepend_path()

parent 4fdb793f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2924,6 +2924,7 @@ static int prepend_path(const struct path *path,
restart_mnt:
	read_seqbegin_or_lock(&mount_lock, &m_seq);
	seq = 0;
	rcu_read_lock();
restart:
	bptr = *buffer;
	blen = *buflen;
@@ -2971,6 +2972,9 @@ static int prepend_path(const struct path *path,
		goto restart;
	}
	done_seqretry(&rename_lock, seq);

	if (!(m_seq & 1))
		rcu_read_unlock();
	if (need_seqretry(&mount_lock, m_seq)) {
		m_seq = 1;
		goto restart_mnt;