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>] [day] [month] [year] [list]
Message-ID: <20250925020621.1268714-1-kartikey406@gmail.com>
Date: Thu, 25 Sep 2025 07:36:21 +0530
From: Deepanshu Kartikey <kartikey406@...il.com>
To: adilger.kernel@...ger.ca,
	tytso@....edu
Cc: linux-ext4@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ext4: fix allocation failure in ext4_mb_load_buddy_gfp


Hi Andreas,

Thank you for pointing out the fundamental issue with my approach. You're right that removing __GFP_NOFAIL creates a worse problem by potentially triggering filesystem errors.

I understand your suggestion about allowing the function to return errors so the caller can retry, but I need more specific guidance on the implementation approach.

Questions:

1. **Function signature change**: Should ext4_discard_preallocations() be changed from void to int to return error codes? This would require updating all 13+ callers I found.

2. **Caller modifications**: How should the various callers (ext4_truncate, ext4_clear_inode, ext4_release_file, etc.) handle allocation failures during memory pressure? Should they:
   - Retry the operation later?
   - Skip preallocation cleanup temporarily?
   - Handle it differently based on the calling context?

3. **Memory pressure detection**: Is checking (current->flags & PF_MEMALLOC) the right approach to detect when we're in memory reclaim context?

4. **Scope of changes**: Would you prefer:
   - A minimal fix that just handles the allocation failure gracefully?
   - A more comprehensive rework of the error handling throughout the preallocation discard path?

I want to make sure I understand the preferred approach before submitting v2, especially since this affects multiple call sites throughout the ext4 codebase.

Best regards,
Deepanshu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ