[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131209095133.GK31491@secunet.com>
Date: Mon, 9 Dec 2013 10:51:33 +0100
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Fan Du <fan.du@...driver.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/3] xfrm: clamp down spi range for IPComp when
allocating spi
On Mon, Dec 09, 2013 at 05:13:52PM +0800, Fan Du wrote:
>
>
> On 2013年12月09日 16:57, Steffen Klassert wrote:
> >
> >Instead of doing this check here again, we should implement an equivalent
> >to verify_userspi_info() for pfkey. Then we are sure to have a valid range
> >in any case.
> >
>
> How about export an common function in xfrm_state.c to check this corner case?
> This could be shared by both netlink and pfkey interface, and verify_userspi_info
> simplified also?
>
> int check_ipcomp_spirange(u8 proto, u32 high)
> {
> if ((proto == IPPROTO_COMP) && (high > 0xFFFF))
> return -EINVAL;
> else return 0;
> }
> EXPORT_SYMBOL(check_ipcomp_spirange);
I don't think that we should export such a function,
it is not sufficient.
The netlink interface is ok, it does verify_userspi_info(),
and the pfkey interface need all the checks done in
verify_userspi_info() too. In particular the check if
the minimum spi value is not bigger than the maximum.
So we could either make verify_userspi_info() shared,
or implement a own function for pfkey.
--
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