mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-09 15:24:32 +08:00
tipc: check return value of pskb_trim()
[ Upstream commite46e06ffc6
] goto free_skb if an unexpected result is returned by pskb_tirm() in tipc_crypto_rcv_complete(). Fixes:fc1b6d6de2
("tipc: introduce TIPC encryption & authentication") Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> Reviewed-by: Tung Nguyen <tung.q.nguyen@dektech.com.au> Link: https://lore.kernel.org/r/20230725064810.5820-1-ruc_gongyuanjun@163.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
42afa7ef66
commit
df019bc124
@ -1971,7 +1971,8 @@ rcv:
|
||||
|
||||
skb_reset_network_header(*skb);
|
||||
skb_pull(*skb, tipc_ehdr_size(ehdr));
|
||||
pskb_trim(*skb, (*skb)->len - aead->authsize);
|
||||
if (pskb_trim(*skb, (*skb)->len - aead->authsize))
|
||||
goto free_skb;
|
||||
|
||||
/* Validate TIPCv2 message */
|
||||
if (unlikely(!tipc_msg_validate(skb))) {
|
||||
|
Loading…
Reference in New Issue
Block a user