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

Unverified Commit bd5b366a authored by Nathan Chancellor's avatar Nathan Chancellor
Browse files

Revert "ANDROID: net: xfrm: check dir value of xfrm_userpolicy_id"



This is fixed in a much cleaner way in 7bab0963 ("xfrm: policy:
check policy direction value"). There is no point to having all of
these extra checks when the one will do.

This reverts commit 33f17703.

Bug: 64257838
Change-Id: I9c5862cdf1da9934144d1f785de6d2c3e69d0dd7
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
parent 1c44ecfe
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -1753,10 +1753,6 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb,
	struct sk_buff *skb;
	int err;

	err = verify_policy_dir(dir);
	if (err)
		return ERR_PTR(err);

	skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
	if (!skb)
		return ERR_PTR(-ENOMEM);
@@ -2278,10 +2274,6 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
	struct net *net = sock_net(skb->sk);
	struct xfrm_encap_tmpl  *encap = NULL;

	err = verify_policy_dir(pi->dir);
	if (err)
		return err;

	if (attrs[XFRMA_MIGRATE] == NULL)
		return -EINVAL;

@@ -2415,11 +2407,6 @@ static int xfrm_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
{
	struct net *net = &init_net;
	struct sk_buff *skb;
	int err;

	err = verify_policy_dir(dir);
	if (err)
		return err;

	skb = nlmsg_new(xfrm_migrate_msgsize(num_migrate, !!k, !!encap),
			GFP_ATOMIC);
@@ -3089,11 +3076,6 @@ static int xfrm_notify_policy_flush(const struct km_event *c)

static int xfrm_send_policy_notify(struct xfrm_policy *xp, int dir, const struct km_event *c)
{
	int err;

	err = verify_policy_dir(dir);
	if (err)
		return err;

	switch (c->event) {
	case XFRM_MSG_NEWPOLICY: