From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F4AA4624E for ; Mon, 17 Feb 2025 18:06:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A73F400D6; Mon, 17 Feb 2025 18:06:23 +0100 (CET) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mails.dpdk.org (Postfix) with ESMTP id 5F5AB400D6 for ; Mon, 17 Feb 2025 18:06:22 +0100 (CET) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-38f2cb1ba55so2525557f8f.3 for ; Mon, 17 Feb 2025 09:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739811982; x=1740416782; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8n8snvHqrhU9AprApa8WNf7aUhhmGKoS+xtf/KlhQeo=; b=a+A70Ry16TcOeFAHoKEOv/kEwIFWKh63EEjUHXtMxpTpWJkAeHX1jCTZrfuapUwteb 8UPyTTMYjzbm/hnl7RWxfElZ82IfkoFHMuCdYLPDx6XcKz8oFpjo/cCnJNg82MnW2a5D dFflndyrzRmZwlPmq+zmlAiJcacecZKrlksCjxl3tkJDkmEIAoAi5B0HYsCr75x768FW B/Ev4LfL37p+BoLT4KDgKCtUMyuu1kViU9CnbQ0WrKrVc7FmLX7/1ccHbZhZo31RpQwB Cz2Shb9q2x2wjyS5FqKdvOoyi5P2W4+cY+Zxkl8ffWbQnVTtF9MENfYxtkW+nYvJTrNJ dOmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739811982; x=1740416782; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8n8snvHqrhU9AprApa8WNf7aUhhmGKoS+xtf/KlhQeo=; b=ZcCeM6OKZaMIh7H2wQbtQ1Qdxde6OeCRehU/6OQdVxJaTO7Ol/eYKpgsxPRf4/E/jP YFMg0lfktitBinS/vhlnZ/tPLPklsRp0ek6/6MQQF1pF5OtMMNj7ZyT24+hnmqBNmas0 h3dhrUuAtsbJavv+Lx8xCmGU1rcGhh6zBPxx8DyAnucyV4i857Tl41fHZqcoudBwELfF t2b7akW0pSPtmdC7jZSc0PnHew9TFK8M9/qw4tCZ2v4rm8swIJ5mDhngo15q/tCFc6Je NDJSyAIQaJGUks+5/P4zEsljSruHH3yjxaBZTPPAnq9plblIeyv2VAL0+b4UoPyzUvfq HKfw== X-Forwarded-Encrypted: i=1; AJvYcCX8pxSwN1pwYUF5yGd0sFWxcmWb+Eoxb6cfoFEP98Z0PiP0mvyJ6/dFVqg6VLoaptj/y0tH094=@dpdk.org X-Gm-Message-State: AOJu0YxeX/mEgdPFkZumaVDXY/lsU+cDd6Kl5rSg+rECLvGyzX6qHZP0 bv6KJ+RFR5y4AjxYcWBzd+rts2ureVYBG+RTJQGfVcDK0P9PKEo5Lpkx7F4P4mjYOQ== X-Gm-Gg: ASbGncs7DzQE7hHwmSHGENilvdq3bGtu7/1S8B4HEog4fVzHbM2RhfjPfy2Ytr/J/Fh 0Mc/+VyqfEHWtGjNb1poMbajT0Emd87JukpkS/K/FAboopJXV+SiXEyB2LW+xXAOoJ8eTHiW8s7 bpwpNWTsdbK4nwjk8dO6szFVK1AyL4QDngmQcZoPVVQUhbZhysGVrddrSkNZI9srUHjb8T96+5z AM5gynfNJ6Xm+LVpLeLSUNrZWmCIBAxZ7t8rJuKPJv6Bk5kBgpKHhYp6tREOfXuy2A88dZcHZrE A4rI5GsakHKmsa4mxri6TA== X-Google-Smtp-Source: AGHT+IEAXA8IbtbcqSPmz2pPeZ2HgEVXHMmJUWbjJMeA3qfT/jrKdsxyUj6PwG9Xei5KJN98uAh2YA== X-Received: by 2002:adf:f9c6:0:b0:38f:276a:1662 with SMTP id ffacd0b85a97d-38f33f1b3a3mr9006559f8f.13.1739811981853; Mon, 17 Feb 2025 09:06:21 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:f83c:95e7:29fd:a997]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-38f258dcf08sm12950199f8f.36.2025.02.17.09.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 09:06:21 -0800 (PST) From: luca.boccassi@gmail.com To: Kevin Traynor Cc: Maxime Coquelin , dpdk stable Subject: patch 'vhost: add null callback checks' has been queued to stable release 22.11.8 Date: Mon, 17 Feb 2025 17:03:59 +0000 Message-ID: <20250217170456.1068278-26-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250217170456.1068278-1-luca.boccassi@gmail.com> References: <20250217170456.1068278-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/19/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/7a8aeea3366b7366b13d4827a6c57ade4791f2bd Thanks. Luca Boccassi --- >From 7a8aeea3366b7366b13d4827a6c57ade4791f2bd Mon Sep 17 00:00:00 2001 From: Kevin Traynor Date: Fri, 24 Jan 2025 14:14:07 +0000 Subject: [PATCH] vhost: add null callback checks [ upstream commit 66be1a05a480a0484b02c1a0194126763f4dbb99 ] rte_vhost_driver_callback_register() does not specify any mandatory callbacks in struct rte_vhost_device_ops. Add some missing NULL checks before calling rte_vhost_device_ops callbacks. Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application") Signed-off-by: Kevin Traynor Reviewed-by: Maxime Coquelin --- lib/vhost/vhost.c | 5 +++-- lib/vhost/vhost_user.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 9e28198528..662f7f3f11 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -716,10 +716,11 @@ vhost_destroy_device_notify(struct virtio_net *dev) if (dev->flags & VIRTIO_DEV_RUNNING) { vdpa_dev = dev->vdpa_dev; - if (vdpa_dev) + if (vdpa_dev && vdpa_dev->ops->dev_close) vdpa_dev->ops->dev_close(dev->vid); dev->flags &= ~VIRTIO_DEV_RUNNING; - dev->notify_ops->destroy_device(dev->vid); + if (dev->notify_ops->destroy_device) + dev->notify_ops->destroy_device(dev->vid); } } diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index 6657355c2a..0c4accfc08 100644 --- a/lib/vhost/vhost_user.c +++ b/lib/vhost/vhost_user.c @@ -3190,7 +3190,8 @@ unlock: */ if (!(dev->flags & VIRTIO_DEV_RUNNING)) { - if (dev->notify_ops->new_device(dev->vid) == 0) + if (!dev->notify_ops->new_device || + dev->notify_ops->new_device(dev->vid) == 0) dev->flags |= VIRTIO_DEV_RUNNING; } -- 2.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-02-17 16:13:17.790473321 +0000 +++ 0026-vhost-add-null-callback-checks.patch 2025-02-17 16:13:16.814441593 +0000 @@ -1 +1 @@ -From 66be1a05a480a0484b02c1a0194126763f4dbb99 Mon Sep 17 00:00:00 2001 +From 7a8aeea3366b7366b13d4827a6c57ade4791f2bd Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 66be1a05a480a0484b02c1a0194126763f4dbb99 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -18 +18,0 @@ - lib/vhost/vduse.c | 3 ++- @@ -21 +21 @@ - 3 files changed, 7 insertions(+), 4 deletions(-) + 2 files changed, 5 insertions(+), 3 deletions(-) @@ -23,14 +22,0 @@ -diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c -index 8ba58555f9..be548f051e 100644 ---- a/lib/vhost/vduse.c -+++ b/lib/vhost/vduse.c -@@ -318,7 +318,8 @@ vduse_device_start(struct virtio_net *dev, bool reconnect) - - dev->flags |= VIRTIO_DEV_READY; - -- if (dev->notify_ops->new_device(dev->vid) == 0) -+ if (!dev->notify_ops->new_device || -+ dev->notify_ops->new_device(dev->vid) == 0) - dev->flags |= VIRTIO_DEV_RUNNING; - - for (i = 0; i < dev->nr_vring; i++) { @@ -38 +24 @@ -index 2f34d3500e..f01ae6130e 100644 +index 9e28198528..662f7f3f11 100644 @@ -41 +27 @@ -@@ -751,10 +751,11 @@ vhost_destroy_device_notify(struct virtio_net *dev) +@@ -716,10 +716,11 @@ vhost_destroy_device_notify(struct virtio_net *dev) @@ -56 +42 @@ -index 52d8078d7c..26dc0bde97 100644 +index 6657355c2a..0c4accfc08 100644 @@ -59 +45 @@ -@@ -3301,7 +3301,8 @@ unlock: +@@ -3190,7 +3190,8 @@ unlock: