From patchwork Thu Jun 1 03:18:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13262962 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A068BC77B7A for ; Thu, 1 Jun 2023 03:19:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.542204.845791 (Exim 4.92) (envelope-from ) id 1q4YqL-0002X5-29; Thu, 01 Jun 2023 03:19:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 542204.845791; Thu, 01 Jun 2023 03:19:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q4YqK-0002Wy-Vn; Thu, 01 Jun 2023 03:19:16 +0000 Received: by outflank-mailman (input) for mailman id 542204; Thu, 01 Jun 2023 03:19:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q4YqJ-0002Ws-V6 for xen-devel@lists.xenproject.org; Thu, 01 Jun 2023 03:19:16 +0000 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [2607:f8b0:4864:20::531]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 14caff70-002b-11ee-b231-6b7b168915f2; Thu, 01 Jun 2023 05:19:13 +0200 (CEST) Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-53487355877so151114a12.1 for ; Wed, 31 May 2023 20:19:13 -0700 (PDT) Received: from alarm.flets-east.jp ([2400:4050:a840:1e00:78d2:b862:10a7:d486]) by smtp.gmail.com with ESMTPSA id jd5-20020a170903260500b001a245b49731sm2146753plb.128.2023.05.31.20.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 20:19:11 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 14caff70-002b-11ee-b231-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20221208.gappssmtp.com; s=20221208; t=1685589552; x=1688181552; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FrfFhcpCDB+Tgl6xUiFVZLlSppgb/hsoX/FxVOIbZUk=; b=z1bUqRtFniqO+bDSlNVkZdAPV7g6hOQkUnZEIvrkOpa1HB1WNNSeN+5GTor/T6EdBn 9rZ1e3RoJk8fMmy0+yMVpIgUAJZC3kR34QzL4JKGdEQQw+wZgt/ELbpHmVqTt+ZreuIu +nP5HB9cjZCnC7Cvfx9CdY8c7kEdx7r0R0fVVhuLS2Wl50qjZqIfWWlbubifFz9rqisq qcxXFv9ln2tNzelTaAIHYnEoyHXwi4+5m8yk8EMC/8YQ+Q8GeAyqjLYt4NQMb4h0N97f hoF95xvRgTZpKgNF4BGKaeuQDDq5lxnX8MCA6TPZHsURpnSVbvHzPJzKgiDxCd8Rg29I huRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685589552; x=1688181552; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FrfFhcpCDB+Tgl6xUiFVZLlSppgb/hsoX/FxVOIbZUk=; b=EXNmLjzJspQhfCpXiyLwoxUp8sKIhvwL33LnL6T8QZ64LYin0vWn5j0G18Xd5pxfLm aDnxkSBY6tz+CiFBsRnRZXMKHxfjHb+2QXHYN0AcPPdtyW+5YYnJ9928HEHDIYJdhbU1 YVe6tAu0kBIX6EVg6V3bHl3S7wQQbjB/UKoEHDRFTqMhhjB2O//bi0V1RsEF1yEq4+A5 KKlbsm8TCGgX+Sv83CIofIYx7+OgYRRaiylm8XTQMG1eIybzPtrU8DHiNtngMqQcTNj3 xLrGq079YHxu9zxDdxKxPnF5BHnLWRwcL0QFWc/LzLzwEuaUV/uzmG6yKZfBTSOTqL/x xQkA== X-Gm-Message-State: AC+VfDx0426Yls/gC5MDoczXfwDXWALTN80VonQyo4Nb7xxt+PQZEqhI mO1aEgtmaAFBVXXvUdEhzL6d/w== X-Google-Smtp-Source: ACHHUZ4MZp29o+MFds/2GU+jNfvYE9Eyik8T0K+uVPXBV8iQEJ2uPuzNs2Z4+TUkzOA+GoV0RyHdvA== X-Received: by 2002:a05:6a20:2326:b0:10b:bf3d:bc5d with SMTP id n38-20020a056a20232600b0010bbf3dbc5dmr4805679pzc.47.1685589552099; Wed, 31 May 2023 20:19:12 -0700 (PDT) From: Akihiko Odaki To: Cc: Mauro Matteo Cascella , P J P , Alexander Bulekov , Dmitry Fleytman , Beniamino Galvani , Peter Maydell , Strahinja Jankovic , Jason Wang , "Edgar E. Iglesias" , Alistair Francis , Stefan Weil , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Andrew Jeffery , Joel Stanley , Richard Henderson , Helge Deller , Sriram Yagnaraman , Thomas Huth , Aleksandar Rikalo , Subbaraya Sundeep , Jan Kiszka , Tyrone Ting , Hao Wu , Max Filippov , Jiri Pirko , Daniel Henrique Barboza , David Gibson , Greg Kurz , Harsh Prateek Bora , Sven Schnelle , "Michael S. Tsirkin" , Stefano Stabellini , Anthony Perard , Paul Durrant , Rob Herring , Gerd Hoffmann , qemu-arm@nongnu.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, xen-devel@lists.xenproject.org, Akihiko Odaki Subject: [PATCH v2 0/2] net: Update MemReentrancyGuard for NIC Date: Thu, 1 Jun 2023 12:18:57 +0900 Message-Id: <20230601031859.7115-1-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Recently MemReentrancyGuard was added to DeviceState to record that the device is engaging in I/O. The network device backend needs to update it when delivering a packet to a device. This implementation follows what bottom half does, but it does not add a tracepoint for the case that the network device backend started delivering a packet to a device which is already engaging in I/O. This is because such reentrancy frequently happens for qemu_flush_queued_packets() and is insignificant. This series consists of two patches. The first patch makes a bulk change to add a new parameter to qemu_new_nic() and does not contain behavioral changes. The second patch actually implements MemReentrancyGuard update. V1 -> V2: Added the 'Fixes: CVE-2023-3019' tag Akihiko Odaki (2): net: Provide MemReentrancyGuard * to qemu_new_nic() net: Update MemReentrancyGuard for NIC include/net/net.h | 2 ++ hw/net/allwinner-sun8i-emac.c | 3 ++- hw/net/allwinner_emac.c | 3 ++- hw/net/cadence_gem.c | 3 ++- hw/net/dp8393x.c | 3 ++- hw/net/e1000.c | 3 ++- hw/net/e1000e.c | 2 +- hw/net/eepro100.c | 4 +++- hw/net/etraxfs_eth.c | 3 ++- hw/net/fsl_etsec/etsec.c | 3 ++- hw/net/ftgmac100.c | 3 ++- hw/net/i82596.c | 2 +- hw/net/igb.c | 2 +- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 3 ++- hw/net/mcf_fec.c | 3 ++- hw/net/mipsnet.c | 3 ++- hw/net/msf2-emac.c | 3 ++- hw/net/mv88w8618_eth.c | 3 ++- hw/net/ne2000-isa.c | 3 ++- hw/net/ne2000-pci.c | 3 ++- hw/net/npcm7xx_emc.c | 3 ++- hw/net/opencores_eth.c | 3 ++- hw/net/pcnet.c | 3 ++- hw/net/rocker/rocker_fp.c | 4 ++-- hw/net/rtl8139.c | 3 ++- hw/net/smc91c111.c | 3 ++- hw/net/spapr_llan.c | 3 ++- hw/net/stellaris_enet.c | 3 ++- hw/net/sungem.c | 2 +- hw/net/sunhme.c | 3 ++- hw/net/tulip.c | 3 ++- hw/net/virtio-net.c | 6 ++++-- hw/net/vmxnet3.c | 2 +- hw/net/xen_nic.c | 4 ++-- hw/net/xgmac.c | 3 ++- hw/net/xilinx_axienet.c | 3 ++- hw/net/xilinx_ethlite.c | 3 ++- hw/usb/dev-network.c | 3 ++- net/net.c | 15 +++++++++++++++ 40 files changed, 90 insertions(+), 41 deletions(-)