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 5696946128; Fri, 24 Jan 2025 15:14:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E23E40E48; Fri, 24 Jan 2025 15:14:38 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 7DD00402A3 for ; Fri, 24 Jan 2025 15:14:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737728075; 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; bh=U0hCcG0ZLlVe2pHh4hyDqjcOlUgvDx730YWXmZPUSyo=; b=LXcnQSAM4s2qh7MUl9cXuC490/zRve/tY/hP3A8qd/uDs2AW4D7rzmbda+cl+pt8hCo56/ E3ixXELVzwQmWiPURKtdX8JcRlQeMAw0oPfiNx25/L56d6eLgIcAT1scN2RSLIWZbN46dk Aksj6lYlaV7J3HwHj2gMlBCHleEU5aM= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-56-ZE4yTxcGMru3O9RGSrPE2w-1; Fri, 24 Jan 2025 09:14:24 -0500 X-MC-Unique: ZE4yTxcGMru3O9RGSrPE2w-1 X-Mimecast-MFC-AGG-ID: ZE4yTxcGMru3O9RGSrPE2w Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4189C1956048 for ; Fri, 24 Jan 2025 14:14:20 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.25]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 96E1B195608E; Fri, 24 Jan 2025 14:14:18 +0000 (UTC) From: Kevin Traynor To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, Kevin Traynor Subject: [PATCH 0/1] vhost: NULL callback checks Date: Fri, 24 Jan 2025 14:14:06 +0000 Message-ID: <20250124141408.419674-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _fv7-uWKf_azFf589269oBCM7rorOtqzWjC33-Ga2dE_1737728060 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Not a normal case, but noticed that setting some callbacks to NULL in rte_vhost_driver_callback_register() causes a seg fault e.g. [0]. Added missing checks before calling. Alternative fix is to make some callbacks mandatory and check during register - is that an API change? maybe, so took simpler approach. A bit hard to find fixed commit due to the time and amount of development in vhost code. [0] 3302│ if (!(dev->flags & VIRTIO_DEV_RUNNING)) { 3303├> if (dev->notify_ops->new_device(dev->vid) == 0) 3304│ dev->flags |= VIRTIO_DEV_RUNNING; 3305│ } (gdb) frame 1 at ../lib/vhost/vhost_user.c:3303 (gdb) p dev->notify_ops->new_device $3 = (int (*)(int)) 0x0 Kevin Traynor (1): vhost: add NULL callback checks lib/vhost/vduse.c | 3 ++- lib/vhost/vhost.c | 5 +++-- lib/vhost/vhost_user.c | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) -- 2.48.1