Compare commits

..

4 Commits

Author SHA1 Message Date
Michael Roth
920019e0e0 Update version for 3.1.1.1 release
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2019-10-01 17:27:10 -05:00
Michael Roth
9efdbc0224 slrip: ip_reass: Fix use after free
Using ip_deq after m_free might read pointers from an allocation reuse.

This would be difficult to exploit, but that is still related with
CVE-2019-14378 which generates fragmented IP packets that would trigger this
issue and at least produce a DoS.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
(from libslirp.git commit c59279437eda91841b9d26079c70b8a540d41204)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2019-10-01 17:00:56 -05:00
Michael Roth
28c1dde9aa slirp: Fix heap overflow in ip_reass on big packet input
When the first fragment does not fit in the preallocated buffer, q will
already be pointing to the ext buffer, so we mustn't try to update it.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
(from libslirp.git commit 126c04acbabd7ad32c2b018fe10dfac2a3bc1210)
(from libslirp.git commit e0be80430c390bce181ea04dfcdd6ea3dfa97de1)
*squash in e0be80 (clarifying comments)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2019-10-01 17:00:56 -05:00
Cole Robinson
ab630a065a pvrdma: Fix compilation error
In function ‘create_qp’:
  hw/rdma/vmw/pvrdma_cmd.c:517:16: error: ‘rc’ undeclared

The backport of 509f57c98 in 41dd30ff6 mishandled the conflict

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2019-09-19 11:20:17 -05:00
3 changed files with 13 additions and 10 deletions

View File

@@ -1 +1 @@
3.1.1 3.1.1.1

View File

@@ -514,7 +514,7 @@ static int create_qp(PVRDMADev *dev, union pvrdma_cmd_req *req,
cmd->recv_cq_handle, rings, &resp->qpn); cmd->recv_cq_handle, rings, &resp->qpn);
if (resp->hdr.err) { if (resp->hdr.err) {
destroy_qp_rings(rings); destroy_qp_rings(rings);
return rc; goto out;
} }
resp->max_send_wr = cmd->max_send_wr; resp->max_send_wr = cmd->max_send_wr;

View File

@@ -300,6 +300,7 @@ ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp)
*/ */
while (q != (struct ipasfrag*)&fp->frag_link && while (q != (struct ipasfrag*)&fp->frag_link &&
ip->ip_off + ip->ip_len > q->ipf_off) { ip->ip_off + ip->ip_len > q->ipf_off) {
struct ipasfrag *prev;
i = (ip->ip_off + ip->ip_len) - q->ipf_off; i = (ip->ip_off + ip->ip_len) - q->ipf_off;
if (i < q->ipf_len) { if (i < q->ipf_len) {
q->ipf_len -= i; q->ipf_len -= i;
@@ -307,9 +308,10 @@ ip_reass(Slirp *slirp, struct ip *ip, struct ipq *fp)
m_adj(dtom(slirp, q), i); m_adj(dtom(slirp, q), i);
break; break;
} }
prev = q;
q = q->ipf_next; q = q->ipf_next;
m_free(dtom(slirp, q->ipf_prev)); ip_deq(prev);
ip_deq(q->ipf_prev); m_free(dtom(slirp, prev));
} }
insert: insert:
@@ -334,6 +336,8 @@ insert:
q = fp->frag_link.next; q = fp->frag_link.next;
m = dtom(slirp, q); m = dtom(slirp, q);
int was_ext = m->m_flags & M_EXT;
q = (struct ipasfrag *) q->ipf_next; q = (struct ipasfrag *) q->ipf_next;
while (q != (struct ipasfrag*)&fp->frag_link) { while (q != (struct ipasfrag*)&fp->frag_link) {
struct mbuf *t = dtom(slirp, q); struct mbuf *t = dtom(slirp, q);
@@ -350,13 +354,12 @@ insert:
q = fp->frag_link.next; q = fp->frag_link.next;
/* /*
* If the fragments concatenated to an mbuf that's * If the fragments concatenated to an mbuf that's bigger than the total
* bigger than the total size of the fragment, then and * size of the fragment and the mbuf was not already using an m_ext buffer,
* m_ext buffer was alloced. But fp->ipq_next points to * then an m_ext buffer was alloced. But fp->ipq_next points to the old
* the old buffer (in the mbuf), so we must point ip * buffer (in the mbuf), so we must point ip into the new buffer.
* into the new buffer.
*/ */
if (m->m_flags & M_EXT) { if (!was_ext && m->m_flags & M_EXT) {
int delta = (char *)q - m->m_dat; int delta = (char *)q - m->m_dat;
q = (struct ipasfrag *)(m->m_ext + delta); q = (struct ipasfrag *)(m->m_ext + delta);
} }