netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Benedict Wong <benedictwong@google.com>
Cc: <netdev@vger.kernel.org>, <nharold@google.com>, <lorenzo@google.com>
Subject: Re: [RFC ipsec-next] xfrm: Remove xfrmi interface ID from flowi
Date: Thu, 19 Jul 2018 09:45:20 +0200	[thread overview]
Message-ID: <20180719074520.i4wnyas7nipyteyc@gauss3.secunet.de> (raw)
In-Reply-To: <20180717214004.102501-1-benedictwong@google.com>

On Tue, Jul 17, 2018 at 02:40:04PM -0700, Benedict Wong wrote:

> @@ -2301,6 +2322,13 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
>  	int reverse;
>  	struct flowi fl;
>  	int xerr_idx = -1;
> +	const struct xfrm_if_cb *ifcb;
> +	struct xfrm_if *xi;
> +	u32 if_id = 0;
> +
> +	rcu_read_lock();
> +	ifcb = xfrm_if_get_cb();
> +	rcu_read_unlock();
>  
>  	reverse = dir & ~XFRM_POLICY_MASK;
>  	dir &= XFRM_POLICY_MASK;
> @@ -2325,10 +2353,16 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
>  		}
>  	}
>  
> +	if (ifcb) {
> +		xi = ifcb->decode_session(skb);
> +		if (xi)
> +			if_id = xi->p.if_id;
> +	}

The usage of the ifcb pointer should go into the
rcu_read_lock section above.

Looks good otherwise, nice improvement.

Please respin and do an official submission of this
patch, I'd like to merge it before I send the pull
request for the ipsec-next tree.

      reply	other threads:[~2018-07-19  8:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 21:40 [RFC ipsec-next] xfrm: Remove xfrmi interface ID from flowi Benedict Wong
2018-07-19  7:45 ` Steffen Klassert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180719074520.i4wnyas7nipyteyc@gauss3.secunet.de \
    --to=steffen.klassert@secunet.com \
    --cc=benedictwong@google.com \
    --cc=lorenzo@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=nharold@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).