Re: [patch] remove MNT_NOEXEC check for PROT_EXEC mmaps

From: David Wagner
Date: Wed Oct 04 2006 - 00:07:23 EST


Stas Sergeev wrote:
>Arjan van de Ven wrote:
>> no what bothers me that on the one hand you want no execute from the
>> partition, and AT THE SAME TIME want stuff to execute from there (being
>> libraries or binaries, same thing to me).
>
>The original problem came from "noexec" on /dev/shm
>mount. There is no library and no binary there, but
>the programs do shm_open(), ftruncate() and
>mmap(MAP_SHARED, PROT_EXEC) to get some shared memory
>with an exec perm. That fails.

To be honest, I still don't think you've answered Arjan's question. Ok,
so you say it is not a library and not a binary. So what is it that you
are maping in as executable, and why do you think it is reasonable to
ask the Linux kernel to allow you to execute it, if it lives on a noexec
partition? Whatever it is, you are executing it, and the goal of noexec
is to prevent execution of code that lives on a noexec partition, so
what you want to do seems in direct opposition to the goal of noexec.

Arjan's point is that what you want to do is take code that lives on a
noexec partition and execute it. Isn't that exactly against the whole
point of noexec?

Or, to put it another way, if you want to execute code off of some
partition, why do you want to be able to mark it as noexec? What is
the point of marking it noexec, when you're going to be executing code
off of it? Why not just mark it exec and be done with it? What are
your goals here? Or, to put it yet another way, what problem are you
trying to solve (and why isn't marking the partition exec a satisfactory
solution to that problem)?

I think Arjan's question is a fair one and I think he deserves a straight
answer to his question. I don't think he should have to ask it three
times.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/