From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C715BA04DD; Wed, 28 Oct 2020 10:46:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 26AF9C846; Wed, 28 Oct 2020 10:39:43 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 80B27C7EE for ; Wed, 28 Oct 2020 10:39:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603877980; 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=gTyVnxCqactMpJaiNqwYVXYQ0y+WyWhkhQBSDHlkH2c=; b=hL8We8PJOlDUaYK3jebjwrHm5SH1imU7KmrGiIvbPMPt6HHUYt4fEUX2rO+MtUP9o2JTaR BGkJZZuJK8GWRGKmOjJlOnY5xeCwUmQRVGiRHd3EEyU6nxg3yjNgpRD+AgtYjEw72MjxVI hq7773/f6lTV6kOlTDp2Og91+/2cvlE= 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-14--YA253J8P3mbpdSCk2De_A-1; Wed, 28 Oct 2020 05:39:36 -0400 X-MC-Unique: -YA253J8P3mbpdSCk2De_A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 18EF210E2184; Wed, 28 Oct 2020 09:39:35 +0000 (UTC) Received: from [10.36.110.54] (unknown [10.36.110.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6AC11975F; Wed, 28 Oct 2020 09:39:32 +0000 (UTC) To: Adrian Moreno , dev@dpdk.org Cc: yinan.wang@intel.com, patrick.fu@intel.com, chenbo.xia@intel.com, zhihong.wang@intel.com References: <20201026163930.94032-1-amorenoz@redhat.com> <20201026163930.94032-4-amorenoz@redhat.com> From: Maxime Coquelin Message-ID: <49cedde9-4f40-0fb0-e32b-7284dcbfc8f9@redhat.com> Date: Wed, 28 Oct 2020 10:39:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201026163930.94032-4-amorenoz@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 3/6] net/virtio-user: ignore result if STATUS is unsupported X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/26/20 5:39 PM, Adrian Moreno wrote: > GET/SET STATUS is an optional feature, so it may not be negotiated. In > that case, the VIRTIO_GET_STATUS call will not update the status (given > as a pointer argument). Failing to identify this case would lead to > undefined behavior as the device status will be updated with the value > of a stack-allocated variable. > > To fix this, return ENOTSUP if the feature is not supported and, in that > case, don't update device status. > > Fixes: 44102e6298e7 ("net/virtio: check protocol feature in user backend") > Cc: maxime.coquelin@redhat.com > Cc stable@dpdk.org > > Signed-off-by: Adrian Moreno > --- > drivers/net/virtio/virtio_user/vhost_user.c | 4 +-- > .../net/virtio/virtio_user/virtio_user_dev.c | 28 +++++++++---------- > 2 files changed, 15 insertions(+), 17 deletions(-) > Reviewed-by: Maxime Coquelin Thanks, Maxime