* Re: [Patch] Fixing order of trinary operator when assigning the ifindex in XFRM Decode Session
[not found] <BY1PR0701MB12228231F8BCD74FC473284A9A790@BY1PR0701MB1222.namprd07.prod.outlook.com>
@ 2017-01-12 20:28 ` David Ahern
0 siblings, 0 replies; only message in thread
From: David Ahern @ 2017-01-12 20:28 UTC (permalink / raw)
To: Chacon, Carlos A, netdev@vger.kernel.org; +Cc: steffen.klassert@secunet.com
Hi Carlos:
patches sent to netdev should be plain text only. Using git send-email would be best.
Also, the Subject line should start with the area affected (e.g., net: xfrm:) and really should be a bit shorter. e.g., something like this:
[PATCH] net: xfrm: fix flow oif in decode_session
On 1/12/17 1:01 PM, Chacon, Carlos A wrote:
>
> Author: Carlos Chacon <carlos.chacon@gatech.edu>
> Date: Thu Jan 12 11:42:32 2017 -0800
>
> Fixing order of trinary operator when assigning the ifindex in XFRM Decode Session
>
> For xfrm4_policy.c:_decode_session4 and xfrm6_policy.c:_decode_session6 the line
> fl4->flowi4_oif = reverse ? skb->skb_iif : oif;
> fl6->flowi6_oif = reverse ? skb->skb_iif : oif;
> is assigning the incorrect oif to the flow_oif. It should read:
> reverse ? oif : skb->skb_iif;
> The "reverse" variable is defined in net/xfrm/xfrm_policy.c:__xfrm_policy_check
> when it checks if the dir is above the XFRM_POLICY_MASK if this returns false
> it reverses the ifindex, but it should only reverse if it returns true.
The above explanation suggests the reverse flag in __xfrm_policy_check should be fixed. Can you check that and maybe __xfrm_policy_check2 as well?
^ permalink raw reply [flat|nested] only message in thread