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  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]
Date:   Tue, 19 Oct 2021 13:54:59 -0300
From:   Gabriel Krisman Bertazi <>
To:     Jan Kara <>
Subject: Re: [PATCH v8 30/32] ext4: Send notifications on error

Jan Kara <> writes:

> On Tue 19-10-21 17:44:26, Jan Kara wrote:
>> On Mon 18-10-21 21:00:13, Gabriel Krisman Bertazi wrote:
>> > Send a FS_ERROR message via fsnotify to a userspace monitoring tool
>> > whenever a ext4 error condition is triggered.  This follows the existing
>> > error conditions in ext4, so it is hooked to the ext4_error* functions.
>> > 
>> > It also follows the current dmesg reporting in the format.  The
>> > filesystem message is composed mostly by the string that would be
>> > otherwise printed in dmesg.
>> > 
>> > A new ext4 specific record format is exposed in the uapi, such that a
>> > monitoring tool knows what to expect when listening errors of an ext4
>> > filesystem.
>> > 
>> > Reviewed-by: Amir Goldstein <>
>> > Reviewed-by: Theodore Ts'o <>
>> > Signed-off-by: Gabriel Krisman Bertazi <>
>> Looks good to me. Feel free to add:
>> Reviewed-by: Jan Kara <>
> Hum, I actually retract this because the code doesn't match what is written
> in the documentation and I'm not 100% sure what is correct. In particular:
>> > @@ -759,6 +760,8 @@ void __ext4_error(struct super_block *sb, const char *function,
>> >  		       sb->s_id, function, line, current->comm, &vaf);
>> >  		va_end(args);
>> >  	}
>> > +	fsnotify_sb_error(sb, NULL, error);
>> > +
> E.g. here you pass the 'error' to fsnotify. This will be just standard
> 'errno' number, not ext4 error code as described in the documentation. Also
> note that frequently 'error' will be 0 which gets magically transformed to
> EFSCORRUPTED in save_error_info() in the ext4 error handling below. So
> there's clearly some more work to do...

Nice catch.

The many 0 returns were discussed before, around v3.  You can notice one
of my LTP tests is designed to catch that.  We agreed ext4 shouldn't be
returning 0, and that we would write a patch to fix it, but I didn't
think it belonged as part of this series.

You are also right about the EXT4_ vs. errno.  the documentation is
buggy, since it was brought from the fs-specific descriptor days, which
no longer exists.  Nevertheless, I think there is a case for always
returning file system specific errors here, since they are more

Should we agree to follow the documentation and return FS specific
errors instead of errno, then?

Either way, I'm dropping all r-by flags here.

Gabriel Krisman Bertazi

Powered by blists - more mailing lists