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>] [day] [month] [year] [list]
Date:	Thu, 21 Sep 2006 22:48:30 +0400
From:	Stas Sergeev <stsp@...et.ru>
To:	Linux kernel <linux-kernel@...r.kernel.org>
Subject: question about MNT_NOEXEC and PROT_EXEC relation

Hi.

My question is inspired by the recent change in debian
scripts that resulted tmpfs to be mounted with "noexec".
That broke a few packages, namely UML and dosemu, see here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=386945

Right now the kernel checks the MNT_NOEXEC flag and if it
is set, it rejects the PROT_EXEC file-based mappings.
My question is simple: why?

I have googled for an answer but failed to find any.
I have only found the related commit:
http://linux.bkbits.net:8080/linux-2.6/patch@...371.76.3
and some "post-factum" discussion:
http://lists.grok.org.uk/pipermail/full-disclosure/2004-January/015871.html
but the original discussion that preceeded the patch, I
was not able to find.

I can see the following problems with that approach:
1. It rejects both the MAP_SHARED and MAP_PRIVATE mappings.
How can it be usefull to reject the MAP_PRIVATE mapping, if
the one can just do the MAP_ANONYMOUS mapping with PROT_EXEC
set, and then simply read() the binary in?
2. It doesn't prevent mprotect() to be used to set PROT_EXEC
later on.
3. It doesn't check the file mode for the execute permission,
yet it checks MNT_NOEXEC - is this consistent?
4. It prevents tmpfs from being mounted with "noexec", and so,
in my eyes, doesn't add to security at all, and now also makes
some problems for debian.

Can someone please give a brief explanation of why such a
check is usefull? Or, in other words, why the attached patch
cannot be applied?


View attachment "mapx.diff" of type "text/plain" (1256 bytes)

Powered by blists - more mailing lists