From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664968; cv=none; d=zohomail.com; s=zohoarc; b=PX7YnYlL8/1Hnc2A5WDwTBvL9nHh35FXOgvaPvraSNwDlsMJdcrhGlrne1ln660LbZloUijNZS5WFnFr5EYt3X3MBRobcYQ6z0zM+8iZHUhfta5qTm2Y+xvUttMT2fesU5FuFp19SaV3rM+gLZKuOfZJb0gfqubz0oWwhd6R5kA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664968; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ih3kaCK/VLLvUHS8edejH6aGnYBwdT+I+/+y8udnXBk=; b=QIZeRwOjERPKpwtxIeOKW0GVIDdE5HQXPVs4IIPc+q1Dv8e2YDyq/MSLz3IceCTiTOyD9FQFlzZ6kEwiSAwDVx2qwIryq7GRm6gYQuMvA5rNZqlsyo4A0wFuPJonruUH9BTPiVjkIHckbfFAjiseW83cS5jtxISrU/aROQke2kM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664968444145.5726063061536; Mon, 1 Mar 2021 22:02:48 -0800 (PST) Received: from localhost ([::1]:38438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy7K-0003BJ-MR for importer@patchew.org; Tue, 02 Mar 2021 01:02:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy08-0002lv-FO for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy02-0001cm-1p for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:20 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-8Pd7IHzpP0CiC-mWTArxpw-1; Tue, 02 Mar 2021 00:55:11 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B697B1E561; Tue, 2 Mar 2021 05:55:10 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4FC185C224; Tue, 2 Mar 2021 05:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ih3kaCK/VLLvUHS8edejH6aGnYBwdT+I+/+y8udnXBk=; b=CTW3/LWQy+aWPIKyjhoZSGJ6HHPyA/2L7mgwMK832Sju4jFzgnnlqYC+/6vlJBXj5oGhiY if8SIZOdKdA1ZKfSv1BelxlvOWESqazy/Jw5Yk6dWPr85B6Ogu4rhEfCPbUf5icrJSOU3Y Z44NZHiqfw6WPMqXTzFGYxcF7TH//KI= X-MC-Unique: 8Pd7IHzpP0CiC-mWTArxpw-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 01/10] net: introduce qemu_receive_packet() Date: Tue, 2 Mar 2021 13:54:50 +0800 Message-Id: <20210302055500.51954-2-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, Jason Wang , philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Some NIC supports loopback mode and this is done by calling nc->info->receive() directly which in fact suppresses the effort of reentrancy check that is done in qemu_net_queue_send(). Unfortunately we can't use qemu_net_queue_send() here since for loopback there's no sender as peer, so this patch introduce a qemu_receive_packet() which is used for implementing loopback mode for a NIC with this check. NIC that supports loopback mode will be converted to this helper. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Jason Wang --- include/net/net.h | 5 +++++ include/net/queue.h | 8 ++++++++ net/net.c | 38 +++++++++++++++++++++++++++++++------- net/queue.c | 22 ++++++++++++++++++++++ 4 files changed, 66 insertions(+), 7 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 919facaad2..4f56cae0fa 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -144,12 +144,17 @@ void *qemu_get_nic_opaque(NetClientState *nc); void qemu_del_net_client(NetClientState *nc); typedef void (*qemu_nic_foreach)(NICState *nic, void *opaque); void qemu_foreach_nic(qemu_nic_foreach func, void *opaque); +int qemu_can_receive_packet(NetClientState *nc); int qemu_can_send_packet(NetClientState *nc); ssize_t qemu_sendv_packet(NetClientState *nc, const struct iovec *iov, int iovcnt); ssize_t qemu_sendv_packet_async(NetClientState *nc, const struct iovec *io= v, int iovcnt, NetPacketSent *sent_cb); ssize_t qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size); +ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int si= ze); +ssize_t qemu_receive_packet_iov(NetClientState *nc, + const struct iovec *iov, + int iovcnt); ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int s= ize); ssize_t qemu_send_packet_async(NetClientState *nc, const uint8_t *buf, int size, NetPacketSent *sent_cb); diff --git a/include/net/queue.h b/include/net/queue.h index c0269bb1dc..9f2f289d77 100644 --- a/include/net/queue.h +++ b/include/net/queue.h @@ -55,6 +55,14 @@ void qemu_net_queue_append_iov(NetQueue *queue, =20 void qemu_del_net_queue(NetQueue *queue); =20 +ssize_t qemu_net_queue_receive(NetQueue *queue, + const uint8_t *data, + size_t size); + +ssize_t qemu_net_queue_receive_iov(NetQueue *queue, + const struct iovec *iov, + int iovcnt); + ssize_t qemu_net_queue_send(NetQueue *queue, NetClientState *sender, unsigned flags, diff --git a/net/net.c b/net/net.c index e1035f21d1..6e470133ad 100644 --- a/net/net.c +++ b/net/net.c @@ -528,6 +528,17 @@ int qemu_set_vnet_be(NetClientState *nc, bool is_be) #endif } =20 +int qemu_can_receive_packet(NetClientState *nc) +{ + if (nc->receive_disabled) { + return 0; + } else if (nc->info->can_receive && + !nc->info->can_receive(nc)) { + return 0; + } + return 1; +} + int qemu_can_send_packet(NetClientState *sender) { int vm_running =3D runstate_is_running(); @@ -540,13 +551,7 @@ int qemu_can_send_packet(NetClientState *sender) return 1; } =20 - if (sender->peer->receive_disabled) { - return 0; - } else if (sender->peer->info->can_receive && - !sender->peer->info->can_receive(sender->peer)) { - return 0; - } - return 1; + return qemu_can_receive_packet(sender->peer); } =20 static ssize_t filter_receive_iov(NetClientState *nc, @@ -679,6 +684,25 @@ ssize_t qemu_send_packet(NetClientState *nc, const uin= t8_t *buf, int size) return qemu_send_packet_async(nc, buf, size, NULL); } =20 +ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int si= ze) +{ + if (!qemu_can_receive_packet(nc)) { + return 0; + } + + return qemu_net_queue_receive(nc->incoming_queue, buf, size); +} + +ssize_t qemu_receive_packet_iov(NetClientState *nc, const struct iovec *io= v, + int iovcnt) +{ + if (!qemu_can_receive_packet(nc)) { + return 0; + } + + return qemu_net_queue_receive_iov(nc->incoming_queue, iov, iovcnt); +} + ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int s= ize) { return qemu_send_packet_async_with_flags(nc, QEMU_NET_PACKET_FLAG_RAW, diff --git a/net/queue.c b/net/queue.c index 19e32c80fd..c872d51df8 100644 --- a/net/queue.c +++ b/net/queue.c @@ -182,6 +182,28 @@ static ssize_t qemu_net_queue_deliver_iov(NetQueue *qu= eue, return ret; } =20 +ssize_t qemu_net_queue_receive(NetQueue *queue, + const uint8_t *data, + size_t size) +{ + if (queue->delivering) { + return 0; + } + + return qemu_net_queue_deliver(queue, NULL, 0, data, size); +} + +ssize_t qemu_net_queue_receive_iov(NetQueue *queue, + const struct iovec *iov, + int iovcnt) +{ + if (queue->delivering) { + return 0; + } + + return qemu_net_queue_deliver_iov(queue, NULL, 0, iov, iovcnt); +} + ssize_t qemu_net_queue_send(NetQueue *queue, NetClientState *sender, unsigned flags, --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664798; cv=none; d=zohomail.com; s=zohoarc; b=elWYmMBOiwIfWkcOTzKabDi0voLw/B1LAU1Gw+gVIZFahlIa4VHjLei1sVpOWkgz/gJaoy/bZJbzxNEtzAPBAz1/doiMe6Sd9KmiGsb3IWZyRTQ6bI6Az1mUnMe/uu7R2oSMRKqT3OsMUl7GgpFWDKVKQAkyvUQiUKU4mGLBwWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664798; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=U4CRBlfVuQHCbwFFAXrOVfIHYMgM9YWdMJg4zwvFi48=; b=Mf7uqThi9CBEtlRVyS7BPV5k18JTLQlfjg5exxTYiXHV014SzjmG09Q3c8ia+LeKllWs3rX/CYIJBbPvFNcu4J5ex2HnZxnRe2LsE3qBGYjiQebgZhrKnCLLRDlTYtbP/wYhv3s+39WAqLM0G7TLcqdkEraPJd7VYJn9qjzNfts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664798149651.8125506850944; Mon, 1 Mar 2021 21:59:58 -0800 (PST) Received: from localhost ([::1]:58016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy4Z-0007wn-1b for importer@patchew.org; Tue, 02 Mar 2021 00:59:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy07-0002l6-7K for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22435) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy05-0001fA-H4 for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-Uz6EReZ7N82e6twLqhco5g-1; Tue, 02 Mar 2021 00:55:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 860D01005501; Tue, 2 Mar 2021 05:55:13 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4528B5C224; Tue, 2 Mar 2021 05:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U4CRBlfVuQHCbwFFAXrOVfIHYMgM9YWdMJg4zwvFi48=; b=ejfLXHFMwUQBxOPQckK0MyhksLvPEFyuv/3WkTvRzTozwQBrE8xECHH5f15OarhZvUQh57 hqLvUj8N939rtFH04DlLnsM5k6xriMTbGPiWn0EgawY21Zbxv3fAbBMaW0c+LHRaAxxRI+ vh3rEExhpOOrLaXZHsQrMe/elAgDZ/c= X-MC-Unique: Uz6EReZ7N82e6twLqhco5g-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 02/10] e1000: switch to use qemu_receive_packet() for loopback Date: Tue, 2 Mar 2021 13:54:51 +0800 Message-Id: <20210302055500.51954-3-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, Jason Wang , philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Jason Wang --- hw/net/e1000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index d8da2f6528..39141d2764 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -546,7 +546,7 @@ e1000_send_packet(E1000State *s, const uint8_t *buf, in= t size) =20 NetClientState *nc =3D qemu_get_queue(s->nic); if (s->phy_reg[PHY_CTRL] & MII_CR_LOOPBACK) { - nc->info->receive(nc, buf, size); + qemu_receive_packet(nc, buf, size); } else { qemu_send_packet(nc, buf, size); } --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664658; cv=none; d=zohomail.com; s=zohoarc; b=AnPFhPmF/KSVpfsa+mzg+CIv8JuqVlFk53NuKxstG1EcyKT3XvP/LhRainkAh0hdND/1HrOMDcVSlNtKvk+h3UMH/tTU66D+nvcX8YRVjlH3Wzg1mC5NHSRJaAryAsIeUfF6ntmQe3gnnozWyz30lvJFUT/Icwt2yPOT6PdYcig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664658; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/cUxLGUoKj6Lbqhz8wsH65nYE+U3vOuWo94q4m97tW4=; b=YwgYNh7y+DomE9I7O6d3dkJXEFKGU4H7ZOCpVk9IvHEIJ3QLhUIyv2f+FWmP/Pggi8cn96Mx1VToKwcxnIuj+5tDkH9vpdZwNIj/mVs87hIgNNzBmb1wE9X6iyKiJ6/db7gLZkT1LN9p5sDUJrcH5oqMArZOGEMASCxBgkjz8sY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664658684933.3709974134921; Mon, 1 Mar 2021 21:57:38 -0800 (PST) Received: from localhost ([::1]:49756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy2L-0004Yq-KN for importer@patchew.org; Tue, 02 Mar 2021 00:57:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0C-0002ot-EG for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0B-0001lC-66 for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-603-JkIP5uyqMKyDp5ynrpvstQ-1; Tue, 02 Mar 2021 00:55:17 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 805BC1E561; Tue, 2 Mar 2021 05:55:16 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AD195C8A7; Tue, 2 Mar 2021 05:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/cUxLGUoKj6Lbqhz8wsH65nYE+U3vOuWo94q4m97tW4=; b=Bar3v3Gw6ULg/2ycLdXjOEtmF+OHX+/BCJ6Dd7yMRDpREupe1ztiPlxg9DbOg5mvraQ6eg P2tsU55LziJZlW1Lmr+rpdlnqeGdJ37eA9Jlx52jNF6vdMfYas+ZbbGovggaHoz2gSvDkM GDoSzTtjYXUbuv1KJ2MEoiRiwyWxWm8= X-MC-Unique: JkIP5uyqMKyDp5ynrpvstQ-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 03/10] dp8393x: switch to use qemu_receive_packet() for loopback packet Date: Tue, 2 Mar 2021 13:54:52 +0800 Message-Id: <20210302055500.51954-4-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, Jason Wang , philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Signed-off-by: Jason Wang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/dp8393x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 205c0decc5..533a8304d0 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -506,7 +506,7 @@ static void dp8393x_do_transmit_packets(dp8393xState *s) s->regs[SONIC_TCR] |=3D SONIC_TCR_CRSL; if (nc->info->can_receive(nc)) { s->loopback_packet =3D 1; - nc->info->receive(nc, s->tx_buffer, tx_len); + qemu_receive_packet(nc, s->tx_buffer, tx_len); } } else { /* Transmit packet */ --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664799; cv=none; d=zohomail.com; s=zohoarc; b=bdSZE7hi5xvhbeuaMU9rkZE0btOazhdmNWtjyzSK/J/AxUgJ3prVIaVQL/4DjuYxuHfFs/zy82J1oMPPy+7JKq468EpwfQoRKJPW4wLPLd5bp9ntmR9E+qXj6591X7XkxmVBpDZVE8g36vnbMDi/QkWElGpu8EfsJZWTzpmscW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664799; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s8Xkbq7RoFam4jC5zxlFDuQYtlmmoeKu4Dhi/8D2ZS0=; b=Q1bOmsBw53vsVaIJZp2xlNTQbpMoL+NUfdLC1sFCcFauWWKougC52ZIVmpmA0URAytSFIUq2wtboqaPLs7ii7Ub46O/uaEUrS5uyk/mfpGkphZL9I661G0DNlvEULlXKPknvpGgk89i/t6pLvLSsv0vCV1n9KpVASQdS+XlP7VE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664799554787.8476649895166; Mon, 1 Mar 2021 21:59:59 -0800 (PST) Received: from localhost ([::1]:58330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy4c-00084V-Ej for importer@patchew.org; Tue, 02 Mar 2021 00:59:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0D-0002pJ-Ib for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0B-0001lw-7J for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:25 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-2uLWdFnDPziQAbHi5uMH2g-1; Tue, 02 Mar 2021 00:55:20 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75DFE10066EE; Tue, 2 Mar 2021 05:55:19 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DE395C8A7; Tue, 2 Mar 2021 05:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s8Xkbq7RoFam4jC5zxlFDuQYtlmmoeKu4Dhi/8D2ZS0=; b=cMFrtTYzK5lSfDMsBeG7t/tWxMNdRYJEzr18buvvZvpB/1XTX7o3osndGx2ZqWGKqyLrT0 RlQ5PG+wEIxnQM8zKZvMzi0birmLbj8bXDl1UEDZvAQ9RrAA3Iq0X1eUF5B38SNuivxSzC oT8C5XK3RcID0Zyuh9qBn68AT/0eQAo= X-MC-Unique: 2uLWdFnDPziQAbHi5uMH2g-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 04/10] msf2-mac: switch to use qemu_receive_packet() for loopback Date: Tue, 2 Mar 2021 13:54:53 +0800 Message-Id: <20210302055500.51954-5-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, Jason Wang , philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Jason Wang --- hw/net/msf2-emac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/msf2-emac.c b/hw/net/msf2-emac.c index 32ba9e8412..3e6206044f 100644 --- a/hw/net/msf2-emac.c +++ b/hw/net/msf2-emac.c @@ -158,7 +158,7 @@ static void msf2_dma_tx(MSF2EmacState *s) * R_CFG1 bit 0 is set. */ if (s->regs[R_CFG1] & R_CFG1_LB_EN_MASK) { - nc->info->receive(nc, buf, size); + qemu_receive_packet(nc, buf, size); } else { qemu_send_packet(nc, buf, size); } --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664660; cv=none; d=zohomail.com; s=zohoarc; b=ES9J7URIa8CcH41s7+ft1sfBSIYwUSU/I2rtRbyb7FYm2qfwmju2JZ4Donuqu/6cFgt0/qF3+JOYgCT8Tk5/8h+YnLrnB4EWZoQtUF7yXqMQOUm5hcP8Mg4PmfIP/uxIfAzepJDegYQ98ob2U1bicw3AQ53u8ofTayekPCDuG5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664660; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QX+mQfwy6DlqfYIx0RjcR0Gh87/+E3A5w/f93mTV07I=; b=T6NJHXii1Of7LPUyqZYeHPE15hBu1DekvPFq/TnRfenDK2Q/gg30aN1yFkDtabYQjRO/xRD8HWxEswGsnQo2FsWnbdqiC2wDdUOBhq5ySDsE9fq++gi330tOTKZtUjOY50JOYyKgGQobr+bPu/jACjM8Q15L7oZ3OuWaDOmxvgQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664660494226.67553207048707; Mon, 1 Mar 2021 21:57:40 -0800 (PST) Received: from localhost ([::1]:49914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy2N-0004ci-7L for importer@patchew.org; Tue, 02 Mar 2021 00:57:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0H-0002qT-1J for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0E-0001oA-OD for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:28 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-CGAeTG4uMZ-02iL8i4tgEg-1; Tue, 02 Mar 2021 00:55:23 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C546801975; Tue, 2 Mar 2021 05:55:22 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 016A25C224; Tue, 2 Mar 2021 05:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QX+mQfwy6DlqfYIx0RjcR0Gh87/+E3A5w/f93mTV07I=; b=DnwvJH6bNMK0Td0qQ/0eKeMA5aP1hjL+HeViKNq7ETRRjv4b4tj/C5ODEyDFSs7gZIwHHA bK+Yjo/9y/+irTTsGOVqeOeitYeJ6sFDwgSSbV3F9iTT4fJpIKODX4KmZgcRdLy60ZsycO vSBBFzMpgP5rVUx4gHaQfvSTDwJlAtc= X-MC-Unique: CGAeTG4uMZ-02iL8i4tgEg-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 05/10] sungem: switch to use qemu_receive_packet() for loopback Date: Tue, 2 Mar 2021 13:54:54 +0800 Message-Id: <20210302055500.51954-6-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, Jason Wang , philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Jason Wang Reviewed-by: Mark Cave-Ayland --- hw/net/sungem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/sungem.c b/hw/net/sungem.c index 33c3722df6..3684a4d733 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -306,7 +306,7 @@ static void sungem_send_packet(SunGEMState *s, const ui= nt8_t *buf, NetClientState *nc =3D qemu_get_queue(s->nic); =20 if (s->macregs[MAC_XIFCFG >> 2] & MAC_XIFCFG_LBCK) { - nc->info->receive(nc, buf, size); + qemu_receive_packet(nc, buf, size); } else { qemu_send_packet(nc, buf, size); } --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664661; cv=none; d=zohomail.com; s=zohoarc; b=jj2AVT3YBZoZ6cJe1oDscfc4O7kOLV0jxb7pcEpuNuk4Hplr11iQcYCcBiKLmTeB7Z5oQaBLVnpHWY139u0VGfqIUAAFwTlSUSkVJdvr6FbhxugmsNKghN4lb2TqzRoZlKtyRboe2oVJIAg0xtKSEO8aqNf+sLkooS6k5CB06J0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664661; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oax0aoSN00a/9Pm8PjZSonttvRXFbGbuygAO1LpJMCQ=; b=ZXn6w8SCASwG2/UuH4LgGgKUWvJ2ILUjlrct8W3lf4cR+yAzVAVR7nHoOfPfL/mtnL4jJL190Fdgrah8lpUP/g9aTfXlLdcB4LNNlnUR2OyjCrgGFGen82J1g5eD2kzPAcH5Bz5hZ1SkeJUqQlrIRe9cb7ZZHyt051qfYcFjL3I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664661928841.9563866297623; Mon, 1 Mar 2021 21:57:41 -0800 (PST) Received: from localhost ([::1]:50108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy2O-0004hI-OG for importer@patchew.org; Tue, 02 Mar 2021 00:57:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0N-0002vM-16 for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0L-0001sJ-LK for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:34 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-351-ClKHsJg5O6y7aAmk3b0ZCA-1; Tue, 02 Mar 2021 00:55:29 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2BDC510066EE; Tue, 2 Mar 2021 05:55:28 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6B2E5C224; Tue, 2 Mar 2021 05:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oax0aoSN00a/9Pm8PjZSonttvRXFbGbuygAO1LpJMCQ=; b=DRMjbPZloPREO8HpiSOnGkrnYM+8UEPZPuUwwV/qulgMCEC9M+/5KRupqFBCIvcvelzSdx CJFt8X42W082a5zaleMWU9aJNjDG2acTY8ll1JGjbCDwoaO+SFt98+EhSRKzH8l1sc/PQN 09TbAZjchsQe9ZLS3vlTbxUTb0Ck6MI= X-MC-Unique: ClKHsJg5O6y7aAmk3b0ZCA-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 06/10] tx_pkt: switch to use qemu_receive_packet_iov() for loopback Date: Tue, 2 Mar 2021 13:54:55 +0800 Message-Id: <20210302055500.51954-7-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, Jason Wang , philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This patch switches to use qemu_receive_receive_iov() which can detect reentrancy and return early. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Jason Wang --- hw/net/net_tx_pkt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index da262edc3e..1f9aa59eca 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -553,7 +553,7 @@ static inline void net_tx_pkt_sendv(struct NetTxPkt *pk= t, NetClientState *nc, const struct iovec *iov, int iov_cnt) { if (pkt->is_loopback) { - nc->info->receive_iov(nc, iov, iov_cnt); + qemu_receive_packet_iov(nc, iov, iov_cnt); } else { qemu_sendv_packet(nc, iov, iov_cnt); } --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664801; cv=none; d=zohomail.com; s=zohoarc; b=g8Y8ZjJmV9paEJwl9uQrpNYOpCFYoByAV+WRg9zkM3PV+QJ5xL34upA7W7l6p4qz/cOmOFozahvjKqh5FPG1pgeyV1O4UBZ14c8OWTCNkcBJwqPq8Ll6h6kriEgV8a3OuGrS/pNmv2Lcc/qapVYESelxb5Q1gnlWhmN5CoE6Wc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664801; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F/ZGH8rGZUzI+taIsaRThWDpMQrp5KZI0dsoKB2RGns=; b=W7+RLe+OTg/XgOWrm/fcs1mUAfURTOnKBiHJImCiXOL3e/PNIaQcTTzG+A2XuU7PTGwAw9+j04t0MYFawg9vB5p2QdEOwncQgHcnK01Gy8UczonwLzd70mVvrvoWoSaytabNAMHFU3G1y8jpl5yUEtuUn9gCId7v/cYCTmpSFXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664801300349.8686849512886; Mon, 1 Mar 2021 22:00:01 -0800 (PST) Received: from localhost ([::1]:58586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy4e-0008At-8c for importer@patchew.org; Tue, 02 Mar 2021 01:00:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0S-00032r-Ho for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0P-0001w3-Rd for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:40 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-9-4Z4SV_ahMIiF5NNvnxP98Q-1; Tue, 02 Mar 2021 00:55:35 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4942D803F48; Tue, 2 Mar 2021 05:55:34 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2B335C224; Tue, 2 Mar 2021 05:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F/ZGH8rGZUzI+taIsaRThWDpMQrp5KZI0dsoKB2RGns=; b=LyKzf/PLiJR4uvfRyG+Ny78w3nIsF5qYml+wZ4iAyS8TO0u/jvzXbqaUYOQAlNKXfOVEun M3Z+tDr3S0UHE4t2E2btEId02GaUW7jT0BVFuaNpnDNM42cV9wy/hAbz8ZhdqKupyAAusq UrJw2qgTcW1hSB8vyIHS7TawvcvUeoo= X-MC-Unique: 4Z4SV_ahMIiF5NNvnxP98Q-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 07/10] rtl8139: switch to use qemu_receive_packet() for loopback Date: Tue, 2 Mar 2021 13:54:56 +0800 Message-Id: <20210302055500.51954-8-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Buglink: https://bugs.launchpad.net/qemu/+bug/1910826 Signed-off-by: Alexander Bulekov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/rtl8139.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 4675ac878e..90b4fc63ce 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -1795,7 +1795,7 @@ static void rtl8139_transfer_frame(RTL8139State *s, u= int8_t *buf, int size, } =20 DPRINTF("+++ transmit loopback mode\n"); - rtl8139_do_receive(qemu_get_queue(s->nic), buf, size, do_interrupt= ); + qemu_receive_packet(qemu_get_queue(s->nic), buf, size); =20 if (iov) { g_free(buf2); --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664800; cv=none; d=zohomail.com; s=zohoarc; b=KMJ+8nIqgfW03ykvwi4gK/rO3PCHe/lC86128fqN97RJfPyb5IyKsSzpFplMswW17drvHMi9k4Xay+W7sU34k4DbswYkFzPCfjsZdcky9D4+5ZJzZUrDiIpM+WgGSADz9gJ7MdKEjv9k+sJbRProONXpbYrfOm+JcGBYZDyPfE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664800; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=F/ZGH8rGZUzI+taIsaRThWDpMQrp5KZI0dsoKB2RGns=; b=VMwiwpjHC8i9C9bQpetYDt1gQFbadeMXQZH+Bq5PIaa0CA/ikeKvqDY7lJuCBZweJzqWRUD/eXIakMZG6kh7Ff0JBBvvaTaBIFojufygKQ62ZF7WH8nzppOll9aO7JiMJW3m0XeX+aLGuSYLPNuhwtwIfTwLDwVaQJ9vsFJBRuA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664800642296.121964273305; Mon, 1 Mar 2021 22:00:00 -0800 (PST) Received: from localhost ([::1]:58474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy4d-00087x-HK for importer@patchew.org; Tue, 02 Mar 2021 00:59:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0U-00037K-0H for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:42 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0S-0001x8-65 for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:41 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-Bb0_qt20N9ahqoap0MksjQ-1; Tue, 02 Mar 2021 00:55:37 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDAEC18B9ECC; Tue, 2 Mar 2021 05:55:36 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF89C5C737; Tue, 2 Mar 2021 05:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F/ZGH8rGZUzI+taIsaRThWDpMQrp5KZI0dsoKB2RGns=; b=c5VSL/EFiIVQYyUvro2qeLBqW+IhwH8TWAuFSRgwOasJaGWzk67A3/4VCmPefx2hYN9nO6 oB7WcMNTxdLMMuNZXH75QIaWNkdwfubUWtLIz4PzdOnMAbfM/vr1gHFB3Rm5hErHbUJpZ7 Xp5kQL0orOfNBG8g7/2uPrxEHzxg2Jk= X-MC-Unique: Bb0_qt20N9ahqoap0MksjQ-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V2 7/7] rtl8193: switch to use qemu_receive_packet() for loopback Date: Tue, 2 Mar 2021 13:54:57 +0800 Message-Id: <20210302055500.51954-9-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Buglink: https://bugs.launchpad.net/qemu/+bug/1910826 Signed-off-by: Alexander Bulekov --- hw/net/rtl8139.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 4675ac878e..90b4fc63ce 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -1795,7 +1795,7 @@ static void rtl8139_transfer_frame(RTL8139State *s, u= int8_t *buf, int size, } =20 DPRINTF("+++ transmit loopback mode\n"); - rtl8139_do_receive(qemu_get_queue(s->nic), buf, size, do_interrupt= ); + qemu_receive_packet(qemu_get_queue(s->nic), buf, size); =20 if (iov) { g_free(buf2); --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614664969; cv=none; d=zohomail.com; s=zohoarc; b=PZu/x2hXDerd5P99nomphy+fmfFkGvOVrT5MosbjQkCofNQ2Ej+LlotnUrNAV6P1tv3waE7xxifM+iCZQ0Szo+DEmsk6r1cVVcOPPrXrqD18jBfcC8m6PQ6Hq5Ilk2ffPQeZSnnUJgP9bPlry7RI/GIZ4+/XJhNIvx3Gqk23OH0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614664969; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=publ5REQehQtX9O1B36SCXaRF8mM0EtxrmugTAnNW/0=; b=UfWrDgmwm6B4IOR6qIn/yjEp4qEFwGELQZEJiA0VlYim+WO4fhkqKlb/hXfGYaIiuphahHEHlkz38nQFgwEAPdAxQzcnlV7aZYnDd6fqPYsiC5a9JvzKi8rLYLzHGuDQwUSy/jZsq4gHIkM/rVY2T2sdU3OtJ6W3/XqhGSW01bA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614664969679934.3106453311192; Mon, 1 Mar 2021 22:02:49 -0800 (PST) Received: from localhost ([::1]:38632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGy7M-0003GD-Kn for importer@patchew.org; Tue, 02 Mar 2021 01:02:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0c-0003L3-BD for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26213) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0W-00020T-Vy for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:48 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-58-ReGjmWeZNUa7pjPBgF9W8A-1; Tue, 02 Mar 2021 00:55:40 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7A7BE10066EF; Tue, 2 Mar 2021 05:55:39 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A6FB5C224; Tue, 2 Mar 2021 05:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=publ5REQehQtX9O1B36SCXaRF8mM0EtxrmugTAnNW/0=; b=e0Ezhyc/1A1wsYGm9193H0U2gymwqVIpgRFDxewA4pSX9VJ4H3YTjxxU3/uCUgqCM7qNEb 3AGlrkHcP6/nH9qsHQvL8xDEJS+GxuBvudw3/De4qkNZaZ4fr0bqbfWvXezLvYDLJcReNU ZUTnaP08XqlCBtgbuSMqoA2oph/DymM= X-MC-Unique: ReGjmWeZNUa7pjPBgF9W8A-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 08/10] pcnet: switch to use qemu_receive_packet() for loopback Date: Tue, 2 Mar 2021 13:54:58 +0800 Message-Id: <20210302055500.51954-10-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Alexander Bulekov This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Buglink: https://bugs.launchpad.net/qemu/+bug/1917085 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/pcnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c index f3f18d8598..dcd3fc4948 100644 --- a/hw/net/pcnet.c +++ b/hw/net/pcnet.c @@ -1250,7 +1250,7 @@ txagain: if (BCR_SWSTYLE(s) =3D=3D 1) add_crc =3D !GET_FIELD(tmd.status, TMDS, NOFCS); s->looptest =3D add_crc ? PCNET_LOOPTEST_CRC : PCNET_LOOPTEST_= NOCRC; - pcnet_receive(qemu_get_queue(s->nic), s->buffer, s->xmit_pos); + qemu_receive_packet(qemu_get_queue(s->nic), s->buffer, s->xmit= _pos); s->looptest =3D 0; } else { if (s->nic) { --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614665149; cv=none; d=zohomail.com; s=zohoarc; b=PtDLN+69qnOaRc2TShB+4k8h6np5U3TY59IMudyhvWj0b3NJhLhEx3dkklHRt/8yFDJbz9ALEKaLACuoS5/eLwRVEdqoPai+YEFszTWwLmD7wdGMmCZ+JyNq4lKfAK8W03HZNtNXVsejTEehFex3Flv+MOV0Ic9Iv8luCbmy/fo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614665149; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SpkThKrYJEf3nNo7jb0IbOx6pzaCQXrfW3UMnParnfk=; b=fE8Rk7izB+88VsRHcMJgH7ttGA9TrPvGKl5dZlMZ7z8Rpg9VZBR8X18lEciNkHNxS5PF8WZyP6ubL1ouByrwE1iuOow4SP8kTYx0uMJv7J7fCYPlJqCQaPhaB5XVL68eAQvvMJq/5jIip3++xu+WaiOdY+57XXj/55j+fPO8+OY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614665149486739.517503443419; Mon, 1 Mar 2021 22:05:49 -0800 (PST) Received: from localhost ([::1]:46998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGyAG-0006dl-9c for importer@patchew.org; Tue, 02 Mar 2021 01:05:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0c-0003Ll-KW for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0Z-00022r-VA for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:50 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-571-s2k4Bp9ZMiatCrA5u5g9Qg-1; Tue, 02 Mar 2021 00:55:43 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0E06418B9EC3; Tue, 2 Mar 2021 05:55:42 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 111815C224; Tue, 2 Mar 2021 05:55:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SpkThKrYJEf3nNo7jb0IbOx6pzaCQXrfW3UMnParnfk=; b=GTkQ7H08K89BBDboRAPwaxuCm0WNDJszQk8Bw9q3/pLisQQENYwOPc+vGSal9cPn7vd9Su 1dIyaN9wbro0khcyFK2RsH0XqgiGwyKcNtWHFikJczKnsjwabc+/CUs3vZFRJ0I5arwIDa VAWPw39A5Gk0UaxywdxnNqCG0pwxy4g= X-MC-Unique: s2k4Bp9ZMiatCrA5u5g9Qg-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 09/10] cadence_gem: switch to use qemu_receive_packet() for loopback Date: Tue, 2 Mar 2021 13:54:59 +0800 Message-Id: <20210302055500.51954-11-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Signed-off-by: Alexander Bulekov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/cadence_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 7a534691f1..6032395388 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -1275,7 +1275,7 @@ static void gem_transmit(CadenceGEMState *s) /* Send the packet somewhere */ if (s->phy_loop || (s->regs[GEM_NWCTRL] & GEM_NWCTRL_LOCALLOOP)) { - gem_receive(qemu_get_queue(s->nic), s->tx_packet, + qemu_receive_packet(qemu_get_queue(s->nic), s->tx_pack= et, total_bytes); } else { qemu_send_packet(qemu_get_queue(s->nic), s->tx_packet, --=20 2.24.3 (Apple Git-128) From nobody Sun Feb 8 23:57:47 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614665149; cv=none; d=zohomail.com; s=zohoarc; b=ceeixj9Anu4kZnUmP9cba4YhVSXLaQCZqqzRRlyequga2hYH/n1sQgauQN865ZkJx58UfNsYLgAmhU1t/zz3aTVMVKmF4hOakPztbgPrfGUWlCWifj1iQp4nXIL5HrEikqK99gtKq5RDU2WrrwoyNO0Eamwc8iLjH0qobQAJBvM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614665149; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Dp+hFhivLC9f+zzc8EthEtkNF5jM3b0FZS7RQRIqQ9c=; b=mwMX0ggb/cQGRUFDsz+xzqSVxRN8xjx9nqD5OpW1xxQf411P3if2JtV6vTOp4PBkWE4KuTuOdA0tuqgKH0dwUH6dQuGV3iNvEPjxyfu4qBKXibdJDwkb6CLIMz2GmHepCpHEvD51rjz0DPo+728k6IcsCkoT4WGu2RzEohG3lpY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614665149915162.52034410600663; Mon, 1 Mar 2021 22:05:49 -0800 (PST) Received: from localhost ([::1]:47000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGyAG-0006ds-RA for importer@patchew.org; Tue, 02 Mar 2021 01:05:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGy0f-0003N6-9z for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lGy0c-00023m-3U for qemu-devel@nongnu.org; Tue, 02 Mar 2021 00:55:53 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-150-G03VVL-bPBixuzU7XuE4NA-1; Tue, 02 Mar 2021 00:55:45 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9598D801976; Tue, 2 Mar 2021 05:55:44 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-133.pek2.redhat.com [10.72.12.133]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FF675C224; Tue, 2 Mar 2021 05:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614664547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dp+hFhivLC9f+zzc8EthEtkNF5jM3b0FZS7RQRIqQ9c=; b=bu87TfFhu7CZw5HaPAhMFiGdj4y2mXcS8GYs21SeqY2abDYU0r3x/6PRX9bmU0vPF0sw6H TnuOUkOnoxGYmgqrs8uqFYXzauhx3xERbaHmtD/2nHovHtqTyWiTdm1TU44wNnXpv+qJyI 3m6Oj4S6RvSJ+4qjmMxBrV7Ks/iHoUU= X-MC-Unique: G03VVL-bPBixuzU7XuE4NA-1 From: Jason Wang To: qemu-devel@nongnu.org Subject: [PATCH V3 10/10] lan9118: switch to use qemu_receive_packet() for loopback Date: Tue, 2 Mar 2021 13:55:00 +0800 Message-Id: <20210302055500.51954-12-jasowang@redhat.com> In-Reply-To: <20210302055500.51954-1-jasowang@redhat.com> References: <20210302055500.51954-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alxndr@bu.edu, philmd@redhat.com, qemu-security@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Signed-off-by: Alexander Bulekov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/lan9118.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index abc796285a..6aff424cbe 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -680,7 +680,7 @@ static void do_tx_packet(lan9118_state *s) /* FIXME: Honor TX disable, and allow queueing of packets. */ if (s->phy_control & 0x4000) { /* This assumes the receive routine doesn't touch the VLANClient. = */ - lan9118_receive(qemu_get_queue(s->nic), s->txp->data, s->txp->len); + qemu_receive_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->= len); } else { qemu_send_packet(qemu_get_queue(s->nic), s->txp->data, s->txp->len= ); } --=20 2.24.3 (Apple Git-128)