[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20141022.153546.1208352838031672211.davem@davemloft.net>
Date: Wed, 22 Oct 2014 15:35:46 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: roy.qing.li@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 1/2 v2] xfrm: fix a potential use after free in
xfrm4_policy.c
From: roy.qing.li@...il.com
Date: Wed, 22 Oct 2014 17:09:52 +0800
> From: Li RongQing <roy.qing.li@...il.com>
>
> pskb_may_pull() maybe change skb->data and make xprth pointer oboslete,
> so recompute the xprth
>
> Signed-off-by: Li RongQing <roy.qing.li@...il.com>
> ---
> Diff with v1: NEXT_HEAD add a length parameter, which hide on v1
>
> net/ipv4/xfrm4_policy.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
> index 6156f68..d7b33c5 100644
> --- a/net/ipv4/xfrm4_policy.c
> +++ b/net/ipv4/xfrm4_policy.c
> @@ -98,11 +98,14 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
> return 0;
> }
>
> +#define NEXT_HEAD(skb, length) (skb_network_header(skb) + length)
> +
If you're going to properly have arguments, use an inline function
rather a macro so you get type checking.
THanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists