From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7A91A305A0 for ; Sat, 1 Jun 2019 20:00:27 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MKmPQMFN0AGx for ; Sat, 1 Jun 2019 20:00:27 -0400 (EDT) Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 23CB93059A for ; Sat, 1 Jun 2019 20:00:27 -0400 (EDT) From: Vladislav Shpilevoy Subject: [tarantool-patches] [PATCH 2/5] swim: fix a 'use after free' in SWIM tests Date: Sun, 2 Jun 2019 02:00:18 +0200 Message-Id: <4cefb872a2caa773601da067ff3dd4fb872967c5.1559433539.git.v.shpilevoy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: kostja@tarantool.org It is a miracle, but somehow it worked until I changed a couple of places. Here objects stored in an rlist are freed, but not deleted from the list. The list is reused after that. --- test/unit/swim_test_transport.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unit/swim_test_transport.c b/test/unit/swim_test_transport.c index c4a1dd774..334ac926e 100644 --- a/test/unit/swim_test_transport.c +++ b/test/unit/swim_test_transport.c @@ -85,6 +85,7 @@ swim_test_packet_new(const char *data, int size, const struct sockaddr_in *src, static inline void swim_test_packet_delete(struct swim_test_packet *p) { + rlist_del_entry(p, in_queue); free(p); } -- 2.20.1 (Apple Git-117)