]> git.proxmox.com Git - mirror_frr.git/commit
zebra: Check for netlink message next fault
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 26 Jul 2018 20:12:05 +0000 (16:12 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Thu, 26 Jul 2018 20:46:57 +0000 (16:46 -0400)
commite6a0e0d1413a2cfb17be8374d82a1db555fd5ec2
treedb51b97daf5b53f3cc67f058dca21321c39cd23e
parent4b22e6bc053fe6349960b279c5bfa47bbba04b56
zebra: Check for netlink message next fault

NLMSG_NEXT decrements the buffer length (status) by
the header msg length (nlmsg_len) everytime its called.
If nlmsg_len isn't accurate and set to be larger than
what it should represent, it will cause status to
decrement passed 0. This makes NLMSG_NEXT return a
pointer that references an inaccessible address.
When that is passed to NLMSG_OK, it segfaults.

Add a check to verify that there is still something to read
before we try to.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/kernel_netlink.c