From: "Alexander Ivanov" <amivanov@fastmail.com>
To: "James Morris" <jmorris@namei.org>
Cc: linux-security-module@vger.kernel.org
Subject: Re: Denying access from sb_umount issue
Date: Mon, 27 Jan 2020 13:10:04 -0800 [thread overview]
Message-ID: <e9ef81ce-d115-46d1-9e18-c2a39371415e@www.fastmail.com> (raw)
In-Reply-To: <alpine.LRH.2.21.2001280754180.22715@namei.org>
On Mon, 27 Jan 2020 12:58 -08:00, James Morris <jmorris@namei.org> wrote:
> On Mon, 27 Jan 2020, Alexander Ivanov wrote:
>
> > The lsm module implementes sb_umount() hook to disable lazy umounts. When access is denied, all consecutive umounts fail. It looks like mount reference count is messed up when sb_umount() return -EPERM. Is it possible that umount syscall assumes do_umount() touches those references and it calls
> >
> > dput(path.dentry);
> > mntput_no_expire(mnt);
> >
> > regardless of what do_mount() returns?
>
> You mean do_umount()?
>
yes, typo, sorry.
> There are several other do_umount() error cases which would have the same
> behavior, right after security_sb_umount().
>
We do umount with MNT_DETACH, thus those early returns seem not applicable?
> What error codes are you seeing for the consecutive failures?
>
We got EBUSY.
Thanks,
--Alex
prev parent reply other threads:[~2020-01-27 21:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-27 20:34 Denying access from sb_umount issue Alexander Ivanov
2020-01-27 20:58 ` James Morris
2020-01-27 21:10 ` Alexander Ivanov [this message]
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=e9ef81ce-d115-46d1-9e18-c2a39371415e@www.fastmail.com \
--to=amivanov@fastmail.com \
--cc=jmorris@namei.org \
--cc=linux-security-module@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).