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: <Zl6cHI48ye7Tp1-C@infradead.org>
Date: Mon, 3 Jun 2024 21:46:20 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Keith Busch <kbusch@...nel.org>
Cc: Andreas Hindborg <nmi@...aspace.dk>, Jens Axboe <axboe@...nel.dk>,
	Andreas Hindborg <a.hindborg@...sung.com>,
	Bart Van Assche <bvanassche@....org>,
	John Garry <john.g.garry@...cle.com>,
	Damien Le Moal <dlemoal@...nel.org>, linux-block@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] null_blk: fix validation of block size

On Mon, Jun 03, 2024 at 01:47:17PM -0600, Keith Busch wrote:
> On Mon, Jun 03, 2024 at 09:26:45PM +0200, Andreas Hindborg wrote:
> > -	dev->blocksize = round_down(dev->blocksize, 512);
> > -	dev->blocksize = clamp_t(unsigned int, dev->blocksize, 512, 4096);
> > +	if (blk_validate_block_size(dev->blocksize) != 0) {
> > +		return -EINVAL;
> > +	}
> 
> No need for the { } brackets for a one-line if.

or the != 0.

> 
> It also looks like a good idea if this check was just done in
> blk_validate_limits() so that each driver doesn't have to do their own
> checks. That block function is kind of recent though.

Yes.  We already discussed this in another thread a few days ago.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ