From owner-svn-src-stable-11@freebsd.org Mon Jun 19 14:45:21 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70B96D9E02C; Mon, 19 Jun 2017 14:45:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4092376BA2; Mon, 19 Jun 2017 14:45:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5JEjKVS082983; Mon, 19 Jun 2017 14:45:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5JEjKHE082982; Mon, 19 Jun 2017 14:45:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201706191445.v5JEjKHE082982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 19 Jun 2017 14:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320099 - stable/11/sys/dev/vmware/vmxnet3 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jun 2017 14:45:21 -0000 Author: avg Date: Mon Jun 19 14:45:20 2017 New Revision: 320099 URL: https://svnweb.freebsd.org/changeset/base/320099 Log: MFC r318867: fix vmxnet3 crash when LRO is enabled The crash can occur when all of the following conditions are true: - a packet consists of multiple segments (requires LRO enabled) - there has been a failure to allocate an mbuf for the packet and the packet has to be dropped - a host (vmware) still owned at least one segment of the packet, so the driver had to wait for another interrupt to proceed to discarding the remaining segment(s) Reviewed by: rstone Approved by: re (gjb) Sponsored by: Panzura Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jun 19 14:30:01 2017 (r320098) +++ stable/11/sys/dev/vmware/vmxnet3/if_vmx.c Mon Jun 19 14:45:20 2017 (r320099) @@ -2194,6 +2194,20 @@ vmxnet3_rxq_eof(struct vmxnet3_rxqueue *rxq) } else { KASSERT(rxd->btype == VMXNET3_BTYPE_BODY, ("%s: non start of frame w/o body buffer", __func__)); + + if (m_head == NULL && m_tail == NULL) { + /* + * This is a continuation of a packet that we + * started to drop, but could not drop entirely + * because this segment was still owned by the + * host. So, drop the remainder now. + */ + vmxnet3_rxq_eof_discard(rxq, rxr, idx); + if (!rxcd->eop) + vmxnet3_rxq_discard_chain(rxq); + goto nextp; + } + KASSERT(m_head != NULL, ("%s: frame not started?", __func__));