Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp403538ybg; Tue, 28 Jul 2020 08:48:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXIQ0/o7fKuNfMUARgguZPSCCKiKJCVn/wfMfCI83nDPPW2bcgHSRmhs6Ifxm2ifFRUAVK X-Received: by 2002:a17:906:1914:: with SMTP id a20mr25305410eje.233.1595951337151; Tue, 28 Jul 2020 08:48:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595951337; cv=none; d=google.com; s=arc-20160816; b=O271u7hQ+AhbwVM98xxPm/JKdG1aXm59ZpO57+tLDh0N9Y1pC1/Tnd7lM+jK8/e274 zQOnFwY6p9QTbk5Znok1dlOKHeTHe3cajCCzqpCZ8zqfPV/L9+pkfsQBS9C+8U6wLktb fqLj82U+1Zew+hgQYmg/U2is3elU0padUdN9aSUaZXbw0xzynkTEd/8lvFsPie1xkRm3 +DxxNkcut6OpgxLY5H1PX217+L3OEFJE5RyfXgL+tviG9nfPa74u7Gox4lfmH1tfmfOE weoGXMian5iLH038QD3lRYCb1b6poScl14k6fxLge0g69FXLUeyRJlWKKncDMtjBH8cB 4Tdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:in-reply-to :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0umpA98IwRGx6/MPdjALwMgb7oXwSSsk+mQbCZoe0MU=; b=AhhCVGwoiAaTAwMTYJdFZ9OigeEYu5JO2xiPnoC5RUu+3njqeDYo4Yy/kfQugn77j7 eXWTPlju9oKn5AUpld8ezO02y19/vG//eH58jyRt5C5Dx3A1d3pwj6hsRICCWzp4XzJ1 XCHWGw77zvydU1nyzLZoiQejbjR3gn1f4Ykk4jwvi/2ca0JPQpvJhqIO7Yyc/B64xHB5 dxCf2aAieEIlXz8WvqtPBF/aVwhlzUW02R1uA6vdgt0QwxCtGpo0TUcCm/I38yB9WF4h RtbOPGDMoo19EZfPZWmQg2MCA6jQxAa6wIQaCMaYF/Ovo2pzLaUQ6J5hAA7poVe7uPdA wPtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=go3OUaBv; 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 h5si7361743ejj.464.2020.07.28.08.48.35; Tue, 28 Jul 2020 08:48:57 -0700 (PDT) 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=go3OUaBv; 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 S1731075AbgG1PpP (ORCPT + 99 others); Tue, 28 Jul 2020 11:45:15 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:43706 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730842AbgG1PpO (ORCPT ); Tue, 28 Jul 2020 11:45:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595951113; 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: in-reply-to:in-reply-to:references:references; bh=0umpA98IwRGx6/MPdjALwMgb7oXwSSsk+mQbCZoe0MU=; b=go3OUaBvbCu1xa6uDnHvREtzkmpwv5fUJ9OJboVSeBIq2pNhAR2d0JJlckZeuDBsGEP+8i N55g20350BhlJb8diTHZe39F1Q4yr7lzNVdQ6tIBtgG9aopblFU+QXCx/rb07Qp8lgOMnx uZo2KW52wxkjnQdzca5QLO93AQwbtes= 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-460-nZeArAQfM2eHGtGOwT-JDA-1; Tue, 28 Jul 2020 11:45:10 -0400 X-MC-Unique: nZeArAQfM2eHGtGOwT-JDA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C96A2106B246; Tue, 28 Jul 2020 15:44:42 +0000 (UTC) Received: from localhost (ovpn-115-19.ams2.redhat.com [10.36.115.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BFD6712E8; Tue, 28 Jul 2020 15:44:41 +0000 (UTC) Date: Tue, 28 Jul 2020 16:44:40 +0100 From: Stefan Hajnoczi To: Maxim Levitsky Cc: linux-kernel@vger.kernel.org, Keith Busch , Josef Bacik , "open list:BLOCK LAYER" , Sagi Grimberg , Jens Axboe , "open list:NVM EXPRESS DRIVER" , "open list:SCSI CDROM DRIVER" , Tejun Heo , Bart Van Assche , "Martin K. Petersen" , Damien Le Moal , Jason Wang , Maxim Levitsky , Colin Ian King , "Michael S. Tsirkin" , Paolo Bonzini , Ulf Hansson , Ajay Joshi , Ming Lei , "open list:SONY MEMORYSTICK SUBSYSTEM" , Christoph Hellwig , Satya Tangirala , "open list:NETWORK BLOCK DEVICE (NBD)" , Hou Tao , Jens Axboe , "open list:VIRTIO CORE AND NET DRIVERS" , "James E.J. Bottomley" , Alex Dubov Subject: Re: [PATCH 02/10] block: virtio-blk: check logical block size Message-ID: <20200728154440.GD21660@stefanha-x1.localdomain> References: <20200721105239.8270-1-mlevitsk@redhat.com> <20200721105239.8270-3-mlevitsk@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200721105239.8270-3-mlevitsk@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IMjqdzrDRly81ofr" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --IMjqdzrDRly81ofr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 21, 2020 at 01:52:31PM +0300, Maxim Levitsky wrote: > Linux kernel only supports logical block sizes which are power of two, > at least 512 bytes and no more that PAGE_SIZE. >=20 > Check this instead of crashing later on. >=20 > Note that there is no need to check physical block size since it is > only a hint, and virtio-blk already only supports power of two values. >=20 > Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=3D1664619 >=20 > Signed-off-by: Maxim Levitsky > --- > drivers/block/virtio_blk.c | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi --IMjqdzrDRly81ofr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAl8gR+gACgkQnKSrs4Gr c8jH9gf9EntnBlm/IA+XQjmYVE6AzhflC6xpD5M+QOMtx8Gej8rEDnfv7e+8O5qL wr7XyrYfjofwgT61Li9+QV7z8mw4hKwMUGpqUDULEHY/X6u0yegtZJiBgwAViSHw shlmEyXroq4nlwvLOveuIj85c/56JUHpAIAUh0zhj9ZYvhyoaf6mWs5C6jz6Pp1z wVqPpFhPNq1slTBQM9usXil/ToMZvt5FlHhFeF2KaKruugDnF5NeYg4bvOYZohNp 1zFxVPsHL2QKJQ5mhGBNoyvu4Z3XxgT093CydyLsxOoS+fgPV9l0p5hsl53VELL0 wORoNRxEjSgis0Ixkvc7AK42GUfpow== =aToL -----END PGP SIGNATURE----- --IMjqdzrDRly81ofr--