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: <aJr9UKtIJ74XExf-@infradead.org>
Date: Tue, 12 Aug 2025 01:37:36 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Damien Le Moal <dlemoal@...nel.org>
Cc: Al Viro <viro@...iv.linux.org.uk>, Rajeev Mishra <rajeevm@....com>,
	axboe@...nel.dk, yukuai1@...weicloud.com,
	linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] loop: use vfs_getattr_nosec() for accurate file size

On Tue, Aug 12, 2025 at 02:17:01PM +0900, Damien Le Moal wrote:
> And indeed, that:
> 
> 	/* size of the new backing store needs to be the same */
>         if (get_loop_size(lo, file) != get_loop_size(lo, old_file))
>                 goto out_err;
> 
> Will need some massaging.

Why?  get_loop_size just derives the first arguments to get_size
from the passed in loop device in the same way the only other caller
to get_size does.  So we can just:

  1) convert loop_set_status to use get_loop_size
  2) Fold get_size into get_loop_size
  3) Maye rename get_size to lo_calculate_size to have a descriptive
     name while we're touching it?
  4) switch to vfs_getattr


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ