提交 373b8eeb 编写于 作者: A Alexey Dobriyan 提交者: Steffen Klassert

xfrm: make aead_len() return unsigned int

Key lengths can't be negative.

Comparison with nla_len() is left signed just in case negative value
can sneak in there.
Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 39e50d96
......@@ -1764,7 +1764,7 @@ static inline int xfrm_acquire_is_on(struct net *net)
}
#endif
static inline int aead_len(struct xfrm_algo_aead *alg)
static inline unsigned int aead_len(struct xfrm_algo_aead *alg)
{
return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
}
......
......@@ -84,7 +84,7 @@ static int verify_aead(struct nlattr **attrs)
return 0;
algp = nla_data(rt);
if (nla_len(rt) < aead_len(algp))
if (nla_len(rt) < (int)aead_len(algp))
return -EINVAL;
algp->alg_name[sizeof(algp->alg_name) - 1] = '\0';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册