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: <20250407-ziegen-heilfroh-f9033bcd8e2f@brauner>
Date: Mon, 7 Apr 2025 13:22:22 +0200
From: Christian Brauner <brauner@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Christoph Hellwig <hch@...radead.org>, 
	Mateusz Guzik <mjguzik@...il.com>, James Bottomley <James.Bottomley@...senpartnership.com>, 
	Leon Romanovsky <leon@...nel.org>, pr-tracker-bot@...nel.org, linux-fsdevel@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [GIT PULL] vfs mount

On Fri, Apr 04, 2025 at 07:19:27AM -0700, Linus Torvalds wrote:
> On Fri, 4 Apr 2025 at 01:28, Christoph Hellwig <hch@...radead.org> wrote:
> >
> > Or just kill the non-scoped guard because it simply is an insane API.
> 
> The scoped guard may be odd, but it's actually rather a common
> situation. And when used with the proper indentation, it also ends up
> being pretty visually clear about what part of a function is under the
> lock.
> 
> But yeah, if you don't end up using it right, it ends up very very wrong.
> 
> Not that that is any different from "if ()" or any other similar
> construct, but obviously people are much more *used* to 'if ()' and
> friends.
> 
> An 'if ()" without the nested statement looks very wrong - although
> it's certainly not unheard of - while a 'scoped_guard()' without the
> nested statement might visually pass just because it doesn't trigger
> the same visceral "that's not right" reaction.
> 
> So I don't think it's an insane API, I think it's mostly that it's a
> _newish_ API.

Both the scoped and non-scoped guards are very useful. I initially used
a scoped variant but then reworked the code to use a non-scoped one and
fscked it up.

I agree with Linus here it was just me not having the same "Oh right,
that's odd reaction.".

I love the guard infrastructure. It's a massive improvement. Thanks to
Peter for finally bringing this into the kernel after I've worked with
this for years in userspace already. It literally helped obliterate
nearly all memory safety bugs in systemd and I'm confident it will have
positive effects in the kernel long-term as well.

And please, can we (collective we) for once all decide to not turn yet
another issue into a two week thread of New York Times Opinion pieces on
how Things Really Are and Should Have Been Done. :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ