summaryrefslogtreecommitdiff
path: root/net/sctp/offload.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-04-17 22:25:42 +0300
committerDavid S. Miller <davem@davemloft.net>2018-04-18 20:48:43 +0300
commitbe47e41d77fba5bc17e9fb5f1c99217bb6691989 (patch)
tree721fdcebea9f57a945c6b9caeed564b39d1d97a7 /net/sctp/offload.c
parent9c438d7a3a52dcc2b9ed095cb87d3a5e83cf7e60 (diff)
downloadlinux-be47e41d77fba5bc17e9fb5f1c99217bb6691989.tar.xz
tipc: fix use-after-free in tipc_nametbl_stop
When we delete a service item in tipc_nametbl_stop() we loop over all service ranges in the service's RB tree, and for each service range we loop over its pertaining publications while calling tipc_service_remove_publ() for each of them. However, tipc_service_remove_publ() has the side effect that it also removes the comprising service range item when there are no publications left. This leads to a "use-after-free" access when the inner loop continues to the next iteration, since the range item holding the list we are looping no longer exists. We fix this by moving the delete of the service range item outside the said function. Instead, we now let the two functions calling it test if the list is empty and perform the removal when that is the case. Reported-by: syzbot+d64b64afc55660106556@syzkaller.appspotmail.com Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/offload.c')
0 files changed, 0 insertions, 0 deletions