This is a note to let you know that I've just added the patch titled net: tipc: prevent possible null deref of link to the 5.9-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-tipc-prevent-possible-null-deref-of-link.patch and it can be found in the queue-5.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Sat Dec 19 11:38:44 AM CET 2020 From: Cengiz Can <cengiz@xxxxxxxxxx> Date: Mon, 7 Dec 2020 11:14:24 +0300 Subject: net: tipc: prevent possible null deref of link From: Cengiz Can <cengiz@xxxxxxxxxx> [ Upstream commit 0398ba9e5a4b5675aa571e0445689d3c2e499c2d ] `tipc_node_apply_property` does a null check on a `tipc_link_entry` pointer but also accesses the same pointer out of the null check block. This triggers a warning on Coverity Static Analyzer because we're implying that `e->link` can BE null. Move "Update MTU for node link entry" line into if block to make sure that we're not in a state that `e->link` is null. Signed-off-by: Cengiz Can <cengiz@xxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/tipc/node.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -2170,9 +2170,11 @@ void tipc_node_apply_property(struct net &xmitq); else if (prop == TIPC_NLA_PROP_MTU) tipc_link_set_mtu(e->link, b->mtu); + + /* Update MTU for node link entry */ + e->mtu = tipc_link_mss(e->link); } - /* Update MTU for node link entry */ - e->mtu = tipc_link_mss(e->link); + tipc_node_write_unlock(n); tipc_bearer_xmit(net, bearer_id, &xmitq, &e->maddr, NULL); } Patches currently in stable-queue which might be from cengiz@xxxxxxxxxx are queue-5.9/net-tipc-prevent-possible-null-deref-of-link.patch