aboutsummaryrefslogtreecommitdiff
path: root/src/tcp_subr.c
diff options
context:
space:
mode:
authorAkihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>2019-08-01 19:18:16 +0900
committerAkihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>2019-08-01 19:31:20 +0900
commit07c2a44b67e219ac14207f7a1b33704e1312cf91 (patch)
tree3e33e600fa3e9a824942149077d2104eed23da61 /src/tcp_subr.c
parent5367fa1524065edc05b0d1f80fca1d547024b98a (diff)
downloadslirp-07c2a44b67e219ac14207f7a1b33704e1312cf91.zip
slirp-07c2a44b67e219ac14207f7a1b33704e1312cf91.tar.gz
slirp-07c2a44b67e219ac14207f7a1b33704e1312cf91.tar.bz2
emu: disable by default
tcp_emu() is known to have caused several CVEs, and not useful today in most cases. https://nvd.nist.gov/vuln/detail/CVE-2019-6778 https://nvd.nist.gov/vuln/detail/CVE-2019-9824 The feature can be still enabled by setting SlirpConfig.enable_emu to true. Closes https://gitlab.freedesktop.org/slirp/libslirp/issues/11 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Diffstat (limited to 'src/tcp_subr.c')
-rw-r--r--src/tcp_subr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tcp_subr.c b/src/tcp_subr.c
index 1f6ef1a..2e32cb6 100644
--- a/src/tcp_subr.c
+++ b/src/tcp_subr.c
@@ -566,7 +566,8 @@ uint8_t tcp_tos(struct socket *so)
while (tcptos[i].tos) {
if ((tcptos[i].fport && (ntohs(so->so_fport) == tcptos[i].fport)) ||
(tcptos[i].lport && (ntohs(so->so_lport) == tcptos[i].lport))) {
- so->so_emu = tcptos[i].emu;
+ if (so->slirp->enable_emu)
+ so->so_emu = tcptos[i].emu;
return tcptos[i].tos;
}
i++;