]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipv6: check for validity before dereferencing cfg->fc_nlinfo.nlh
authorMuhammad Usama Anjum <musamaanjum@gmail.com>
Thu, 8 Apr 2021 22:01:29 +0000 (03:01 +0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Apr 2021 23:41:46 +0000 (16:41 -0700)
commit5db9785d6d12d18645e23aa8a17ad2396821350d
treedc7d062aa31dd41d2dde3653442a412fec116fef
parent7ec63b105495cdb7fd6384e69942a992fb9bc076
net: ipv6: check for validity before dereferencing cfg->fc_nlinfo.nlh

nlh is being checked for validtity two times when it is dereferenced in
this function. Check for validity again when updating the flags through
nlh pointer to make the dereferencing safe.

CC: <stable@vger.kernel.org>
Addresses-Coverity: ("NULL pointer dereference")
Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c