lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211011114041.GB16138@lst.de>
Date:   Mon, 11 Oct 2021 13:40:41 +0200
From:   Christoph Hellwig <hch@....de>
To:     "Michael S. Tsirkin" <mst@...hat.com>
Cc:     Xie Yongji <xieyongji@...edance.com>, jasowang@...hat.com,
        stefanha@...hat.com, virtualization@...ts.linux-foundation.org,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        Kevin Wolf <kwolf@...hat.com>, Christoph Hellwig <hch@....de>,
        Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH v5] virtio-blk: Add validation for block size in config
 space

On Tue, Oct 05, 2021 at 06:42:43AM -0400, Michael S. Tsirkin wrote:
> Stefan also pointed out this duplicates the logic from 
> 
>         if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize))
>                 return -EINVAL;
> 
> 
> and a bunch of other places.
> 
> 
> Would it be acceptable for blk layer to validate the input
> instead of having each driver do it's own thing?
> Maybe inside blk_queue_logical_block_size?

I'm pretty sure we want down that before.  Let's just add a helper
just for that check for now as part of this series.  Actually validating
in in blk_queue_logical_block_size seems like a good idea, but returning
errors from that has a long tail.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ