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: <20190422125138.GB21588@ziepe.ca>
Date:   Mon, 22 Apr 2019 09:51:38 -0300
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     Kees Cook <keescook@...omium.org>
Cc:     "Ruhl, Michael J" <michael.j.ruhl@...el.com>,
        Leon Romanovsky <leon@...nel.org>,
        Doug Ledford <dledford@...hat.com>,
        Leon Romanovsky <leonro@...lanox.com>,
        RDMA mailing list <linux-rdma@...r.kernel.org>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Feras Daoud <ferasda@...lanox.com>,
        Haggai Eran <haggaie@...lanox.com>,
        Saeed Mahameed <saeedm@...lanox.com>,
        linux-netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH rdma-next 3/6] RDMA/ucontext: Do not allow BAR mappings
 to be executable

On Thu, Apr 18, 2019 at 02:23:26AM -0500, Kees Cook wrote:
> On Thu, Apr 18, 2019 at 2:01 AM Jason Gunthorpe <jgg@...pe.ca> wrote:
> >
> > On Thu, Apr 18, 2019 at 01:30:07AM -0500, Kees Cook wrote:
> >
> > > Anything running with READ_IMPLIES_EXEC (i.e. a gnu stack marked WITH
> > > execute) should be considered broken. Now, the trouble is that this
> > > personality flag is carried across execve(), so if you have a launcher
> > > that doesn't fix up the personality for children, you'll see this
> > > spread all over your process tree. What is doing rdma mmap calls with
> > > an executable stack? That really feels to me like the real source of
> > > the problem.
> >
> > Apparently the Fortran runtime forces the READ_IMPLIES_EXEC and
> > requires it for some real reason or another - Fortran and RDMA go
> > together in alot of cases.
> 
> That's pretty unfortunate for the security of the resulting proceses. :(

I think it probably arises from a need for exec stacks in the
runtime... That Linux escalates that to full READ_IMPLIES_EXEC seems
quite unfortunate. Hopefully your patch will get accepted as it makes
a lot of sense.

> I wonder if we could simply make devtmpfs ignore READ_IMPLIES_EXEC
> entirely, though? And I wonder if we could defang READ_IMPLIES_EXEC a
> bit in general. It was _supposed_ to be for the cases where binaries
> were missing exec bits and a processor was just gaining NX ability. I
> know this has been discussed before... ah-ha, here it is:
> http://lkml.kernel.org/r/1462963502-11636-1-git-send-email-hecmargi@upv.es

Globally banning VM_EXEC from char device nodes also sounds very
appealing to me (particularly from a W^X sense)... There are not very
many grep hits on VM_EXEC in drivers/*, and none of the ones I looked
at seemed problematic.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ