From patchwork Mon Jan 14 00:02:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10761465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB4B8159A for ; Mon, 14 Jan 2019 00:12:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA04D288D0 for ; Mon, 14 Jan 2019 00:12:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD567288D4; Mon, 14 Jan 2019 00:12:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 514B5288E0 for ; Mon, 14 Jan 2019 00:12:54 +0000 (UTC) Received: from localhost ([127.0.0.1]:39531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gips5-0000oD-Gy for patchwork-qemu-devel@patchwork.kernel.org; Sun, 13 Jan 2019 19:12:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gipk4-0002x8-4a for qemu-devel@nongnu.org; Sun, 13 Jan 2019 19:04:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gipk2-0006Ks-6b for qemu-devel@nongnu.org; Sun, 13 Jan 2019 19:04:35 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:60036) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gipk1-0006A1-Tp for qemu-devel@nongnu.org; Sun, 13 Jan 2019 19:04:34 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 806351B87; Mon, 14 Jan 2019 01:04:12 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O4xXiRgM2W-s; Mon, 14 Jan 2019 01:04:12 +0100 (CET) Received: from function.home (lfbn-1-11161-124.w86-213.abo.wanadoo.fr [86.213.235.124]) by hera.aquilenet.fr (Postfix) with ESMTPSA id D250F1B8B; Mon, 14 Jan 2019 01:04:06 +0100 (CET) Received: from samy by function.home with local (Exim 4.92-RC4) (envelope-from ) id 1gipjY-0007nJ-OO; Mon, 14 Jan 2019 01:04:04 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 01:02:26 +0100 Message-Id: <20190114000326.29847-6-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114000326.29847-1-samuel.thibault@ens-lyon.org> References: <20190114000326.29847-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PULL 05/65] slirp: remove unused EMU_RSH X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Samuel Thibault , stefanha@redhat.com, jan.kiszka@siemens.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André Lureau EMU_RSH handling was dropped in commit 0d62c4cfe21752df4c1d6e2c2398f15d5eaa794a. The assignment, and subsequent free() of ex_ptr->ex_exec to so->extra looks unsafe (double free is likely to occur). Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- slirp/misc.h | 1 - slirp/slirp.c | 2 -- slirp/socket.c | 4 ---- slirp/tcp_subr.c | 1 - 4 files changed, 8 deletions(-) diff --git a/slirp/misc.h b/slirp/misc.h index 64ca88c3b7..94829722cd 100644 --- a/slirp/misc.h +++ b/slirp/misc.h @@ -26,7 +26,6 @@ struct ex_list { #define EMU_REALAUDIO 0x5 #define EMU_RLOGIN 0x6 #define EMU_IDENT 0x7 -#define EMU_RSH 0x8 #define EMU_NOCONNECT 0x10 /* Don't connect */ diff --git a/slirp/slirp.c b/slirp/slirp.c index 0de46084c0..fac7849195 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -1499,8 +1499,6 @@ static int slirp_state_load(QEMUFile *f, void *opaque, int version_id) } if (!ex_ptr) return -EINVAL; - - so->extra = (void *)ex_ptr->ex_exec; } return vmstate_load_state(f, &vmstate_slirp, slirp, version_id); diff --git a/slirp/socket.c b/slirp/socket.c index c01d8696af..041ec5061a 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -89,10 +89,6 @@ sofree(struct socket *so) soqfree(so, &slirp->if_fastq); soqfree(so, &slirp->if_batchq); - if (so->so_emu==EMU_RSH && so->extra) { - sofree(so->extra); - so->extra=NULL; - } if (so == slirp->tcp_last_so) { slirp->tcp_last_so = &slirp->tcb; } else if (so == slirp->udp_last_so) { diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index e7b2baa087..fd7521854e 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -541,7 +541,6 @@ static const struct tos_t tcptos[] = { {0, 23, IPTOS_LOWDELAY, 0}, /* telnet */ {0, 80, IPTOS_THROUGHPUT, 0}, /* WWW */ {0, 513, IPTOS_LOWDELAY, EMU_RLOGIN|EMU_NOCONNECT}, /* rlogin */ - {0, 514, IPTOS_LOWDELAY, EMU_RSH|EMU_NOCONNECT}, /* shell */ {0, 544, IPTOS_LOWDELAY, EMU_KSH}, /* kshell */ {0, 543, IPTOS_LOWDELAY, 0}, /* klogin */ {0, 6667, IPTOS_THROUGHPUT, EMU_IRC}, /* IRC */