Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1135277pxb; Wed, 10 Feb 2021 00:30:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmQH7iZsMD7LxybNrPtdh41cfesYiJgkVaI1a21mjiGFbbGZmT1UHyZmBIrHpd/BYZ1RIz X-Received: by 2002:aa7:cc18:: with SMTP id q24mr2112290edt.82.1612945817304; Wed, 10 Feb 2021 00:30:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612945817; cv=none; d=google.com; s=arc-20160816; b=dknhbp4VyTDjXk6W/3glZKzeJoAYVrgrjGCBGHQ/JPolzgOcheY40o/W86C7i4jZYC 4MpeucNVF198CbaBBDb/KK5VPW9v0hDOR/wo4A66NmCHkeuOz8avb/ExOWJ7brXR+32p yIZNrpGXfBF2kZJKPnVhK1xGmMV51DptMz78LlSZrOStB1RaDq+SlfgwOBhaj/sR5MA+ xgGHOU8KGdWiJ1glalxaTt8fWHLz84izr3xgMtrfC9kj56UrBu5waP1FxiPy9QI3FzDC +ePdOwZWBjLcGgpOxIQgKeKxhiRV3XRh3faYceQd2a6W8pF+NczZ9Jlv+Zap8fywSSmM YZFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=XogBkdyBYNnsPgb8O5lpSxrAmm+YqRAreRdEUUxEYQU=; b=cVmv5wlYF1Q5Lq2WV17vS98/P7h3q6jZqLqb/qVIsfsYnNB6kk15lYAf5yNBs0BhhC fd6Us0t/pIAdrCmU+OEYkZD4p5HSvXR5KQ5RHiTAWD1Aoxc8bMQxT7nbFnKntkAxRudO +L+gfgKBbW1athEHA1TpLkN0Mq9VsLN3GdzAYjv86HjP8kDUb4gxiVNLtERHGxPvdcY8 9R7+xlX97t1MA1OnKlUkD2YwkdYg7akydx9YbH7DGYYemOKaivGB1KLXNbfAZ8tElSgN tdpUUUd3cYeco2JQv/L9xEZ5qfEZlL0xD0iJLgonzPb4WxloC8e/qZzMVMY4n6OUAnJL +VqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P2E9fjzh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si852796ejm.573.2021.02.10.00.29.54; Wed, 10 Feb 2021 00:30:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P2E9fjzh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbhBJES5 (ORCPT + 99 others); Tue, 9 Feb 2021 23:18:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25040 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbhBJES4 (ORCPT ); Tue, 9 Feb 2021 23:18:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612930650; 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=XogBkdyBYNnsPgb8O5lpSxrAmm+YqRAreRdEUUxEYQU=; b=P2E9fjzhnglo7hkI6CbXBoJdcxazXaQAoQOEIEipaKDZC7AZUP+Q3ErTiUU0DDJVIaDKMc hjC+SF0V5nfUQH/dUpjeYU2dX5kF8XaKvi0Z6GpAqEG18Q91CjlYteNpE28Tk0BjWDgmwH yG55LXwcy0yifutVRd5NNdS4x/ZG17k= 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-282-_S6FvGMlO3GKG8vrmWID7g-1; Tue, 09 Feb 2021 23:17:28 -0500 X-MC-Unique: _S6FvGMlO3GKG8vrmWID7g-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 2BD30192AB78; Wed, 10 Feb 2021 04:17:27 +0000 (UTC) Received: from [10.72.12.223] (ovpn-12-223.pek2.redhat.com [10.72.12.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EC7519C66; Wed, 10 Feb 2021 04:17:20 +0000 (UTC) Subject: Re: [PATCH] vdpa/mlx5: fix param validation in mlx5_vdpa_get_config() To: Stefano Garzarella , Eli Cohen Cc: virtualization@lists.linux-foundation.org, "Michael S. Tsirkin" , Parav Pandit , linux-kernel@vger.kernel.org References: <20210208161741.104939-1-sgarzare@redhat.com> <20210209054302.GA210455@mtl-vdi-166.wap.labs.mlnx> <20210209090014.xolf5kxri3xdmacz@steredhat> From: Jason Wang Message-ID: Date: Wed, 10 Feb 2021 12:17:19 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210209090014.xolf5kxri3xdmacz@steredhat> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/9 下午5:00, Stefano Garzarella wrote: > On Tue, Feb 09, 2021 at 07:43:02AM +0200, Eli Cohen wrote: >> On Mon, Feb 08, 2021 at 05:17:41PM +0100, Stefano Garzarella wrote: >>> It's legal to have 'offset + len' equal to >>> sizeof(struct virtio_net_config), since 'ndev->config' is a >>> 'struct virtio_net_config', so we can safely copy its content under >>> this condition. >>> >>> Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 >>> devices") >>> Cc: stable@vger.kernel.org >>> Signed-off-by: Stefano Garzarella >> >> Acked-by: Eli Cohen >> >> BTW, same error in vdpa_sim you may want to fix. >> > > Commit 65b709586e22 ("vdpa_sim: add get_config callback in > vdpasim_dev_attr") unintentionally solved it. > > Since it's a simulator, maybe we can avoid solving it in the stable > branches. Or does it matter? I think not, since the module depends on RUNTIME_TESTING_MENU. Thanks > > Thanks, > Stefano