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

Commit 7a4314d9 authored by JP Abgrall's avatar JP Abgrall Committed by Amit Pundir
Browse files

netfilter: xt_qtaguid: fix error exit that would keep a spinlock.



qtudev_open() could return with a uid_tag_data_tree_lock held
when an kzalloc(..., GFP_ATOMIC) would fail.
Very unlikely to get triggered AND survive the mayhem of running out of mem.

Signed-off-by: default avatarJP Abgrall <jpa@google.com>
parent 1005fdeb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2752,7 +2752,7 @@ static int qtudev_open(struct inode *inode, struct file *file)
	utd_entry = get_uid_data(current_fsuid(), &utd_entry_found);
	if (IS_ERR_OR_NULL(utd_entry)) {
		res = PTR_ERR(utd_entry);
		goto err;
		goto err_unlock;
	}

	/* Look for existing PID based proc_data */
@@ -2794,8 +2794,8 @@ static int qtudev_open(struct inode *inode, struct file *file)
		rb_erase(&utd_entry->node, &uid_tag_data_tree);
		kfree(utd_entry);
	}
err_unlock:
	spin_unlock_bh(&uid_tag_data_tree_lock);
err:
	return res;
}