[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/vpci: initialize msix->next


  • To: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Apr 2023 11:09:18 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pQF2NIVT3ZVhFqyJdWLcRXA3OYkqXWxqwG77hoStKwU=; b=ma1D9kaSgTm8BjGD5FxbuG2Q9bKP3xSBJvZLzCvVRxv9q5mjwmIaiDGuUC3eL/QyZ47gFm/9tK5Xu7PPeureF+xdLFaN0tcXO1CCtAW2NUtt3UjmQw5Pw9Ix/haDCy5/bXKv27eiYn2Kx6AvSycJfE2FCPuqcROXsS3paEeB7eML3F9Eog2+muICTE8u3laum9EELJM2UoDwIZD44V8JoZEC4D5zLFeGQT3nFPzWUdIFfHuRMZZpmQ3SyHZA1j75hAo5rVDBfxUtAVXPp9J0f8gA/QcbT4w6h/oJ3xwHUsFc36AhkL4nh/mEnTgW37R0JZt4XzpR+ZsuooOjQhb/zw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QN+v1WEiHTmgqBMkeCjOw4MzXrrsXsRuRXnHMyOUF6+Zx2C7Cxs/lSAisA7TkhB8L00Pe8cK9Ok/ePz1zWciON97psO7sObjR1la7VV5d7BNYAilR9cKZMcjf7YlsEwllp0yqhI+/WRYRodaLcPlqBy43A59bYtoC1NFwqx8AKQqlZ6+ubuptcSMcifaK0Il7Pgi5bFHFsFIYmfFPE7rnXugBo5iKwwt90dg3gQlJvFwqGNtiTDYgjrumu91BY0JLCjBuQCY8O06UTqSnRp7PQIXkojbQ5J9x9bjylNPjcYhU1WaWnlsPDrIwDy1LIRgMn2f2pGHjPcWTXHXxYZQJA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 17 Apr 2023 09:10:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.04.2023 22:29, Stewart Hildebrand wrote:
> The list was not being initialized, which could result in a crash in
> vpci_remove_device if no list items were added.

Can you please point out the code path which may lead to such a crash?

> --- a/xen/drivers/vpci/msix.c
> +++ b/xen/drivers/vpci/msix.c
> @@ -678,6 +678,8 @@ static int cf_check init_msix(struct pci_dev *pdev)
>      if ( !msix )
>          return -ENOMEM;
>  
> +    INIT_LIST_HEAD(&msix->next);
> +
>      rc = vpci_add_register(pdev->vpci, control_read, control_write,
>                             msix_control_reg(msix_offset), 2, msix);
>      if ( rc )

The error path below here frees msix again, so can't be a problem. The
only other return path from the function is after a suitable list_add().

"... if no list items were added" is misleading too - this isn't a list
head, but a list element. The list head is d->arch.hvm.msix_tables.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.