Re: [PATCH] ecryptfs: Add missing gotos in ecryptfs_read_metadata

Thorsten Blum <[email protected]>
Newsgroups org.kernel.vger.ecryptfs,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
On 11. Jan 2026, at 02:08, Al Viro wrote:
> On Sun, Jan 11, 2026 at 01:36:52AM +0100, Thorsten Blum wrote:
>> Add two missing goto statements to exit ecryptfs_read_metadata() when an
>> error occurs.
>> 
>> The first goto is required; otherwise ECRYPTFS_METADATA_IN_XATTR may be
>> set when xattr metadata is enabled even though parsing the metadata
>> failed. The second goto is not strictly necessary, but it makes the
>> error path explicit instead of relying on falling through to 'out'.
> 
> Ugh...  IMO the whole thing from the point we'd successfully allocated
> the page to the point where we start to clear it ought to be in a separate
> helper.  Something like this, perhaps?

I wanted to keep the fix simple, but I'm happy to refactor the function
if that's preferred. Any preferences, Tyler?

Thanks,
Thorsten
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.