Patch "tipc: check return value of pskb_trim()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tipc: check return value of pskb_trim()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tipc-check-return-value-of-pskb_trim.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6f89f5d4aeebe8d835617cce702421aed5f84df0
Author: Yuanjun Gong <ruc_gongyuanjun@xxxxxxx>
Date:   Tue Jul 25 14:48:10 2023 +0800

    tipc: check return value of pskb_trim()
    
    [ Upstream commit e46e06ffc6d667a89b979701288e2264f45e6a7b ]
    
    goto free_skb if an unexpected result is returned by pskb_tirm()
    in tipc_crypto_rcv_complete().
    
    Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication")
    Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@xxxxxxx>
    Reviewed-by: Tung Nguyen <tung.q.nguyen@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230725064810.5820-1-ruc_gongyuanjun@xxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c
index 4243d2ab8adfb..32447e8d94ac9 100644
--- a/net/tipc/crypto.c
+++ b/net/tipc/crypto.c
@@ -1971,7 +1971,8 @@ static void tipc_crypto_rcv_complete(struct net *net, struct tipc_aead *aead,
 
 	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))) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux