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: <20250812042539.GT222315@ZenIV>
Date: Tue, 12 Aug 2025 05:25:39 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Rajeev Mishra <rajeevm@....com>
Cc: axboe@...nel.dk, yukuai1@...weicloud.com, linux-block@...r.kernel.org,
	linux-kernel@...r.kernel.org, dlemoal@...nel.org
Subject: Re: [PATCH v2] loop: use vfs_getattr_nosec() for accurate file size

On Tue, Aug 12, 2025 at 03:32:01AM +0000, Rajeev Mishra wrote:
> Hi Kuai,
> 
> Thank you for the feedback on the v2 patch regarding error handling.
> 
> Yu mentioned:
> > return 0 here is odd. Why not "return ret;" to propagate the error if any ?
> 
> I understand the concern about proper error propagation. However, there's a 
> type compatibility issue I'd like to discuss before implementing v3:
> 
> 1. Current function signature: `static loff_t get_size(...)` 
>    - Returns size as positive loff_t (unsigned 64-bit)  
>    - All callers expect non-negative size values
> 
> 2. vfs_getattr_nosec() error codes are negative integers (-ENOENT, -EIO, etc.)
>    - Returning `ret` would cast negative errors to huge positive numbers

Huh? loff_t is signed; had always been that way...

> 3. Current callers like loop_set_size() don't handle error checking

If you start returning errors, they ought to.  Incidentally, it might make
sense to return the size in bytes - just move the shift into loop_set_size()...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ