Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:Update
qemu-testsuite.28156
0114-slirp-use-correct-size-while-emulat.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0114-slirp-use-correct-size-while-emulat.patch of Package qemu-testsuite.28156
From: Prasad J Pandit <pjp@fedoraproject.org> Date: Thu, 9 Jan 2020 15:12:27 +0530 Subject: slirp: use correct size while emulating IRC commands Git-commit: ce131029d6d4a405cb7d3ac6716d03e58fb4a5d9 References: bsc#1161066, CVE-2020-7039, bsc#1163018, CVE-2020-8608 While emulating IRC DCC commands, tcp_emu() uses 'mbuf' size 'm->m_size' to write DCC commands via snprintf(3). This may lead to OOB write access, because 'bptr' points somewhere in the middle of 'mbuf' buffer, not at the start. Use M_FREEROOM(m) size to avoid OOB access. Reported-by: Vishnu Dev TJ <vishnudevtj@gmail.com> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Message-Id: <20200109094228.79764-2-ppandit@redhat.com> [Since porting from a quite different now libslirp, quite a bit changed] Signed-off-by: Bruce Rogers <brogers@suse.com> --- slirp/tcp_subr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index 624ec008ba7943cbf6eacf7b23d2..1429f27d716db2d8bac454cc3ea3 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -779,7 +779,7 @@ tcp_emu(struct socket *so, struct mbuf *m) return 1; } m->m_len = bptr - m->m_data; /* Adjust length */ - m->m_len += snprintf(bptr, m->m_size, + m->m_len += snprintf(bptr, M_FREEROOM(m), "DCC CHAT chat %lu %u%c\n", (unsigned long)ntohl(so->so_faddr.s_addr), ntohs(so->so_fport), 1); @@ -790,7 +790,7 @@ tcp_emu(struct socket *so, struct mbuf *m) return 1; } m->m_len = bptr - m->m_data; /* Adjust length */ - m->m_len += snprintf(bptr, m->m_size, + m->m_len += snprintf(bptr, M_FREEROOM(m), "DCC SEND %s %lu %u %u%c\n", buff, (unsigned long)ntohl(so->so_faddr.s_addr), ntohs(so->so_fport), n1, 1); @@ -801,7 +801,7 @@ tcp_emu(struct socket *so, struct mbuf *m) return 1; } m->m_len = bptr - m->m_data; /* Adjust length */ - m->m_len += snprintf(bptr, m->m_size, + m->m_len += snprintf(bptr, M_FREEROOM(m), "DCC MOVE %s %lu %u %u%c\n", buff, (unsigned long)ntohl(so->so_faddr.s_addr), ntohs(so->so_fport), n1, 1);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor