From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: "Christian Brauner" <brauner@kernel.org>,
"Ard Biesheuvel" <ardb@kernel.org>,
"Ryan Lee" <ryan.lee@canonical.com>,
"Malte Schröder" <malte.schroeder@tnxip.de>,
linux-security-module@vger.kernel.org,
apparmor <apparmor@lists.ubuntu.com>,
linux-efi@vger.kernel.org,
"John Johansen" <john.johansen@canonical.com>,
"jk@ozlabs.org" <jk@ozlabs.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: apparmor NULL pointer dereference on resume [efivarfs]
Date: Tue, 11 Mar 2025 13:46:23 -0400 [thread overview]
Message-ID: <4ac2a24c748c974609b19d810a797e4a3dce3e6a.camel@HansenPartnership.com> (raw)
In-Reply-To: <20250311171534.GQ2023217@ZenIV>
On Tue, 2025-03-11 at 17:15 +0000, Al Viro wrote:
> On Tue, Mar 11, 2025 at 12:20:05PM -0400, James Bottomley wrote:
>
> > That's the way it's supposed to work, yes. However, if we move to
> > an always persistent superblock and mnt, I was thinking there'd
> > have to be an indicator in the sfi about whether the variables were
> > reflected or not.
>
> Just have a pointer to superblock set at ->get_tree() and cleared at
> the very beginning of ->kill_sb(), then have notifier bugger off if
> that thing's NULL or if atomic_inc_not_zero(sb->s_active) fails
> (rcu_read_lock() is sufficient for memory safety of that). And
> do deactivate_super() when you are done.
OK that works, thanks!
> That'll give you exclusion with umount. As for the rest of that...
> fuck it, just have kern_mount()/kern_unmount() inside that.
> How hot do you expect that notifier chain to be?
The notifier chain itself is somewhat active, but the notifications we
care about occur once on resume from hibernate (so very few, if any).
> Or screw playing with open/iterate_dir, but that'll need some
> thinking -
> theoretically everything you need is already accessible, but direct
> access to ->d_lock/->d_sib in there is almost certainly not the right
> level of abstraction. We already have similar bits and pieces
> in autofs and ceph, and it's just a matter of figuring out a good
> set of primitives.
I'll probably stick to getting it to work for now ... the refactoring
can come later.
Regards,
James
next prev parent reply other threads:[~2025-03-11 17:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 19:04 apparmor NULL pointer dereference on resume Malte Schröder
2025-03-05 19:22 ` Ryan Lee
2025-03-05 21:47 ` Malte Schröder
2025-03-10 19:57 ` Ryan Lee
2025-03-10 21:49 ` apparmor NULL pointer dereference on resume [efivarfs] James Bottomley
2025-03-11 7:16 ` Ard Biesheuvel
2025-03-11 8:45 ` Christian Brauner
2025-03-11 13:01 ` James Bottomley
2025-03-11 15:55 ` Christian Brauner
2025-03-11 16:19 ` Christian Brauner
2025-03-11 16:20 ` James Bottomley
2025-03-11 17:15 ` Al Viro
2025-03-11 17:46 ` James Bottomley [this message]
2025-03-14 14:59 ` [RFC 1/1] fix NULL mnt [was Re: apparmor NULL pointer dereference on resume [efivarfs]] James Bottomley
2025-03-15 10:04 ` Christian Brauner
2025-03-15 18:41 ` James Bottomley
2025-03-16 6:46 ` Christian Brauner
2025-03-16 14:26 ` James Bottomley
2025-03-16 19:19 ` Ard Biesheuvel
2025-03-17 8:56 ` Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ac2a24c748c974609b19d810a797e4a3dce3e6a.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=apparmor@lists.ubuntu.com \
--cc=ardb@kernel.org \
--cc=brauner@kernel.org \
--cc=jk@ozlabs.org \
--cc=john.johansen@canonical.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=malte.schroeder@tnxip.de \
--cc=ryan.lee@canonical.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox