linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
To: Dave Chinner <david@fromorbit.com>
Cc: TongZhang <ztong@vt.edu>,
	darrick.wong@oracle.com, linux-xfs@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	linux-security-module@vger.kernel.org,
	Wenbo Shen <shenwenbosmile@gmail.com>
Subject: Re: Leaking Path in XFS's ioctl interface(missing LSM check)
Date: Sun, 30 Sep 2018 15:16:52 +0100	[thread overview]
Message-ID: <20180930151652.6975610c@alans-desktop> (raw)
In-Reply-To: <20180927013812.GF31060@dastard>

> > CAP_SYS_ADMIN is also a bit weird because low level access usually
> > implies you can bypass access controls so you should also check
> > CAP_SYS_DAC ?  
> 
> Do you mean CAP_DAC_READ_SEARCH as per the newer handle syscalls?
> But that only allows bypassing directory search operations, so maybe
> you mean CAP_DAC_OVERRIDE?

It depends what the ioctl allows you to do. If it allows me to bypass
DAC and manipulate the file system to move objects around then it's a
serious issue.

The underlying problem is if CAP_SYS_ADMIN is able to move objects around
then I can move modules around. We already have a problem with
CAP_DAC_OVERRIDE giving you CAP_SYS_RAWIO (ie totally owning the machine)
unless the modules are signed, if xfs allows ADMIN as well then
CAP_SYS_ADMIN is much easier to obtain and you'd get total system
ownership from it.

Not good.

> Regardless, this horse bolted long before those syscalls were
> introduced.  The time to address this issue was when XFS was merged
> into linux all those years ago, back when the apps that run in
> highly secure restricted environments that use these interfaces were
> being ported to linux. We can't change this now without breaking
> userspace....

That's what people said about setuid shell scripts.

I'd like to understand better what can be done. We can argue afterwards
about what if anything to do about it and if it is possible to abuse it.

Alan

  parent reply	other threads:[~2018-09-30 14:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26  0:51 Leaking Path in XFS's ioctl interface(missing LSM check) TongZhang
2018-09-26  1:33 ` Dave Chinner
2018-09-26 13:23   ` Stephen Smalley
2018-09-27  2:08     ` Dave Chinner
2018-09-26 18:24   ` Alan Cox
2018-09-27  1:38     ` Dave Chinner
2018-09-27 21:23       ` James Morris
2018-09-27 22:19         ` Dave Chinner
2018-09-27 23:12           ` Tetsuo Handa
2018-09-30 14:16       ` Alan Cox [this message]
2018-10-01  0:25         ` Dave Chinner
2018-10-01 15:04           ` Alan Cox
2018-10-01 15:25             ` Theodore Y. Ts'o
2018-10-01 22:53               ` Dave Chinner
2018-10-01 15:44             ` Darrick J. Wong
2018-10-01 20:08               ` James Morris
2018-10-01 22:45                 ` Dave Chinner
2018-10-02 19:20                   ` James Morris
2018-10-02 22:42                     ` Dave Chinner

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=20180930151652.6975610c@alans-desktop \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=shenwenbosmile@gmail.com \
    --cc=ztong@vt.edu \
    /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).