Patch "net/smc: add missing error check in smc_clc_prfx_set()" has been added to the 4.19-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

    net/smc: add missing error check in smc_clc_prfx_set()

to the 4.19-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:
     net-smc-add-missing-error-check-in-smc_clc_prfx_set.patch
and it can be found in the queue-4.19 subdirectory.

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



commit fd6565b2db12796cebe5ff5d24a09b6e62ba8037
Author: Karsten Graul <kgraul@xxxxxxxxxxxxx>
Date:   Mon Sep 20 21:18:14 2021 +0200

    net/smc: add missing error check in smc_clc_prfx_set()
    
    [ Upstream commit 6c90731980655280ea07ce4b21eb97457bf86286 ]
    
    Coverity stumbled over a missing error check in smc_clc_prfx_set():
    
    *** CID 1475954:  Error handling issues  (CHECKED_RETURN)
    /net/smc/smc_clc.c: 233 in smc_clc_prfx_set()
    >>>     CID 1475954:  Error handling issues  (CHECKED_RETURN)
    >>>     Calling "kernel_getsockname" without checking return value (as is done elsewhere 8 out of 10 times).
    233             kernel_getsockname(clcsock, (struct sockaddr *)&addrs);
    
    Add the return code check in smc_clc_prfx_set().
    
    Fixes: c246d942eabc ("net/smc: restructure netinfo for CLC proposal msgs")
    Reported-by: Julian Wiedmann <jwi@xxxxxxxxxxxxx>
    Signed-off-by: Karsten Graul <kgraul@xxxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c
index aa9a17ac1f7b..063acfbdcd89 100644
--- a/net/smc/smc_clc.c
+++ b/net/smc/smc_clc.c
@@ -162,7 +162,8 @@ static int smc_clc_prfx_set(struct socket *clcsock,
 		goto out_rel;
 	}
 	/* get address to which the internal TCP socket is bound */
-	kernel_getsockname(clcsock, (struct sockaddr *)&addrs);
+	if (kernel_getsockname(clcsock, (struct sockaddr *)&addrs) < 0)
+		goto out_rel;
 	/* analyze IP specific data of net_device belonging to TCP socket */
 	addr6 = (struct sockaddr_in6 *)&addrs;
 	rcu_read_lock();



[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