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: <20250403035040.GM2023217@ZenIV>
Date: Thu, 3 Apr 2025 04:50:40 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Xiaole He <hexiaole1994@....com>
Cc: James Bottomley <James.Bottomley@...senpartnership.com>,
	"brauner@...nel.org" <brauner@...nel.org>,
	"jack@...e.cz" <jack@...e.cz>,
	"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] fs/super.c: Add NULL check for type in
 iterate_supers_type

On Thu, Apr 03, 2025 at 11:10:02AM +0800, Xiaole He wrote:
> Thank you for your thoughtfully feedback.
> I think you are right, and I'm sorry for my pedantic anxiety.
> So if we just ignore this patch for now, or I should submit a bug
> report to kernel community in order to invite more thorough fix?
> Thanks for your patient again.

I don't believe that adding random checks would make any sense -
same as for any library function, really.

Having the documentation slightly more clear would make sense,
though; currently it's

 *      iterate_supers_type - call function for superblocks of given type
 *      @type: fs type
 *      @f: function to call
 *      @arg: argument to pass to it
 *
 *      Scans the superblock list and calls given function, passing it
 *      locked superblock and given argument.

and description could've been better.  The weakest part in there is,
IMO, "the superblock list" - there is a global list of all superblocks
(inventively called 'super_blocks'), but that's not what gets scanned;
the list of superblocks of given type (type->fs_supers) we iterate
through.

Something along the lines of "Call given callback @f for all superblocks
of given type.  The first argument passed to @f points to a locked superblock
that belongs to @type; the second is a caller-supplied opaque pointer @arg.
The caller is responsible for passing @arg that would make a valid second
argument for @f - compiler can't help here" might be a starting point,
but I'm not up to turning that into proper English.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ