linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: robert.foss@collabora.com
Cc: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com,
	vbabka@suse.cz, mhocko@suse.com, mingo@kernel.org,
	dave.hansen@linux.intel.com, hannes@cmpxchg.org,
	dan.j.williams@intel.com, iamjoonsoo.kim@lge.com,
	acme@redhat.com, keescook@chromium.org,
	mgorman@techsingularity.net, atomlin@redhat.com,
	hughd@google.com, dyoung@redhat.com, viro@zeniv.linux.org.uk,
	dcashman@google.com, w@1wt.eu, idryomov@gmail.com,
	yang.shi@linaro.org, wad@chromium.org, vkuznets@redhat.com,
	vdavydov@virtuozzo.com, vitalywool@gmail.com, oleg@redhat.com,
	gang.chen.5i5j@gmail.com, koct9i@gmail.com, aarcange@redhat.com,
	aryabinin@virtuozzo.com, kuleshovmail@gmail.com,
	minchan@kernel.org, mguzik@redhat.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, krasin@google.com,
	Roland McGrath <mcgrathr@chromium.org>,
	Mandeep Singh Baines <msb@chromium.org>,
	Ben Zhang <benzh@chromium.org>,
	Filipe Brandenburger <filbranden@chromium.org>
Subject: Re: [PATCH v1] mm, sysctl: Add sysctl for controlling VM_MAYEXEC taint
Date: Sat, 27 Aug 2016 00:32:27 +0300	[thread overview]
Message-ID: <20160826213227.GA11393@node.shutemov.name> (raw)
In-Reply-To: <1472229004-9658-1-git-send-email-robert.foss@collabora.com>

On Fri, Aug 26, 2016 at 12:30:04PM -0400, robert.foss@collabora.com wrote:
> From: Will Drewry <wad@chromium.org>
> 
> This patch proposes a sysctl knob that allows a privileged user to
> disable ~VM_MAYEXEC tainting when mapping in a vma from a MNT_NOEXEC
> mountpoint.  It does not alter the normal behavior resulting from
> attempting to directly mmap(PROT_EXEC) a vma (-EPERM) nor the behavior
> of any other subsystems checking MNT_NOEXEC.

Wouldn't it be equal to remounting all filesystems without noexec from
attacker POV? It's hardly a fence to make additional mprotect(PROT_EXEC)
call, before starting executing code from such filesystems.

If administrator of the system wants this, he can just mount filesystem
without noexec, no new kernel code required. And it's more fine-grained
than this.

So, no, I don't think we should add knob like this. Unless I miss
something.

NAK.

> It is motivated by a common /dev/shm, /tmp usecase. There are few
> facilities for creating a shared memory segment that can be remapped in
> the same process address space with different permissions.

What about using memfd_create(2) for such cases? You'll get a file
descriptor from in-kernel tmpfs (shm_mnt) which is not exposed to
userspace for remount as noexec.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2016-08-26 21:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 16:30 [PATCH v1] mm, sysctl: Add sysctl for controlling VM_MAYEXEC taint robert.foss
2016-08-26 17:17 ` kbuild test robot
2016-08-26 21:32 ` Kirill A. Shutemov [this message]
2016-08-29 15:25   ` Will Drewry
2016-08-29 15:31     ` Robert Foss

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=20160826213227.GA11393@node.shutemov.name \
    --to=kirill@shutemov.name \
    --cc=aarcange@redhat.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=atomlin@redhat.com \
    --cc=benzh@chromium.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dcashman@google.com \
    --cc=dyoung@redhat.com \
    --cc=filbranden@chromium.org \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=idryomov@gmail.com \
    --cc=keescook@chromium.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=koct9i@gmail.com \
    --cc=krasin@google.com \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrathr@chromium.org \
    --cc=mgorman@techsingularity.net \
    --cc=mguzik@redhat.com \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=mingo@kernel.org \
    --cc=msb@chromium.org \
    --cc=oleg@redhat.com \
    --cc=robert.foss@collabora.com \
    --cc=vbabka@suse.cz \
    --cc=vdavydov@virtuozzo.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=vitalywool@gmail.com \
    --cc=vkuznets@redhat.com \
    --cc=w@1wt.eu \
    --cc=wad@chromium.org \
    --cc=yang.shi@linaro.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).