[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/65] slirp: remove unused EMU_RSH
From: |
Samuel Thibault |
Subject: |
[Qemu-devel] [PULL 05/65] slirp: remove unused EMU_RSH |
Date: |
Mon, 14 Jan 2019 01:02:26 +0100 |
From: Marc-André Lureau <address@hidden>
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 <address@hidden>
Signed-off-by: Samuel Thibault <address@hidden>
---
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 */
--
2.20.1
- [Qemu-devel] [PULL 03/65] slirp: replace ex_pty with ex_chardev, (continued)
- [Qemu-devel] [PULL 03/65] slirp: replace ex_pty with ex_chardev, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 06/65] slirp: rename /extra/chardev, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 10/65] slirp: replace the poor-man string split with g_strsplit(), Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 17/65] slirp: remove FULL_BOLT, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 21/65] slirp: remove NO_UNIX_SOCKETS, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 18/65] slirp: remove the disabled readv()/writev() code path, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 01/65] slirp: associate slirp_output callback with the Slirp context, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 02/65] slirp: remove do_pty from fork_exec(), Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 07/65] slirp: move internal function declarations, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 09/65] slirp: fix slirp_add_exec() leaks, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 05/65] slirp: remove unused EMU_RSH,
Samuel Thibault <=
- [Qemu-devel] [PULL 11/65] slirp: remove dead declarations, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 14/65] slirp: remove unused M_TRAILINGSPACE, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 12/65] slirp: add tftp tracing, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 15/65] slirp: use a callback structure to interface with qemu, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 24/65] slirp: remove unused HAVE_SYS_WAIT_H, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 22/65] slirp: remove unused HAVE_SYS_STROPTS_H, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 32/65] slirp: replace compile time DO_KEEPALIVE, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 08/65] slirp: remove Monitor dependency, return a string for info, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 04/65] slirp: use a dedicated field for chardev pointer, Samuel Thibault, 2019/01/13
- [Qemu-devel] [PULL 13/65] slirp: move socket pair creation in helper function, Samuel Thibault, 2019/01/13