mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
xfrm: export verify_userspi_info for pkfey and netlink interface
In order to check against valid IPcomp spi range, export verify_userspi_info for both pfkey and netlink interface. Signed-off-by: Fan Du <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
This commit is contained in:
parent
ea9884b3ac
commit
776e9dd90c
4 changed files with 32 additions and 24 deletions
|
|
@ -1340,6 +1340,12 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, const struct sadb_
|
|||
max_spi = range->sadb_spirange_max;
|
||||
}
|
||||
|
||||
err = verify_spi_info(x->id.proto, min_spi, max_spi);
|
||||
if (err) {
|
||||
xfrm_state_put(x);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = xfrm_alloc_spi(x, min_spi, max_spi);
|
||||
resp_skb = err ? ERR_PTR(err) : pfkey_xfrm_state2msg(x);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue