Patch "ipv4: Fix error return code in fib_table_insert()" 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

    ipv4: Fix error return code in fib_table_insert()

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:
     ipv4-fix-error-return-code-in-fib_table_insert.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 65bff21f6d4e5a134969c86de522b2cc800a169e
Author: Ziyang Xuan <william.xuanziyang@xxxxxxxxxx>
Date:   Sun Nov 20 15:28:38 2022 +0800

    ipv4: Fix error return code in fib_table_insert()
    
    [ Upstream commit 568fe84940ac0e4e0b2cd7751b8b4911f7b9c215 ]
    
    In fib_table_insert(), if the alias was already inserted, but node not
    exist, the error code should be set before return from error handling path.
    
    Fixes: a6c76c17df02 ("ipv4: Notify route after insertion to the routing table")
    Signed-off-by: Ziyang Xuan <william.xuanziyang@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221120072838.2167047-1-william.xuanziyang@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 19c6e7b93d3d..52f9f69f57b3 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1375,8 +1375,10 @@ int fib_table_insert(struct net *net, struct fib_table *tb,
 
 	/* The alias was already inserted, so the node must exist. */
 	l = l ? l : fib_find_node(t, &tp, key);
-	if (WARN_ON_ONCE(!l))
+	if (WARN_ON_ONCE(!l)) {
+		err = -ENOENT;
 		goto out_free_new_fa;
+	}
 
 	if (fib_find_alias(&l->leaf, new_fa->fa_slen, 0, 0, tb->tb_id, true) ==
 	    new_fa) {



[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