Userspace helpers at static addresses on ARM [was: Re: [PATCH] fix the "unknown" case]

Previous thread: [PATCH] mempolicy: fix dangling reference to tmpfs superblock mpol by Lee Schermerhorn on Tuesday, June 15, 2010 - 10:47 am. (2 messages)

Next thread: [PATCH 00/38] Union mounts - union stack as linked list by Valerie Aurora on Tuesday, June 15, 2010 - 11:39 am. (93 messages)
From: Mathieu Desnoyers
Date: Tuesday, June 15, 2010 - 11:29 am

Hrm, statically addressed shared objects. The security guys should be freaking
out here. This can sadly make stack overflow exploitation much, much, easier
because of lack of randomization of addresses where the code is located. :-/

About the original topic of our discussion:
Thanks for the explanation below. I think making urcu test for the kernel
feature at library load seems like the best portable solution so far. We can
directly use the specific memory barriers when armv7+ is specified, and check
at runtime if the kernel feature is there for "generic" arm build. For generic
ARM build where we discover that the kernel lacks the proper features, we could
rely on Paul's double-fake-mutex scheme (assuming we audit glibc pthreads to
ensure the proper memory barriers are there). If we find out that even pthreads
mutexes got the barriers wrong there, then we should refuse to load the library
altogether.

Thanks,


-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--

From: Paul E. McKenney
Date: Tuesday, June 15, 2010 - 12:02 pm

OK.  The gcc patches were for __sync_sychronize(), which I have replaced
with a "dmb" asm, and for __sync_lock_release(), which I do not use.
If I understand Paolo and Uli correctly (a dubious assumption, to be
sure), then the memory barriers and atomicity should be supplied by
the libraries and/or kernel for the other __sync_ primitives.

So for ARMv7, my prior patch should suffice.  (Or am I still missing
something?)

Additional patches are no doubt required for other ARM flavors, and
perhaps also for older compilers and kernels.

--

Previous thread: [PATCH] mempolicy: fix dangling reference to tmpfs superblock mpol by Lee Schermerhorn on Tuesday, June 15, 2010 - 10:47 am. (2 messages)

Next thread: [PATCH 00/38] Union mounts - union stack as linked list by Valerie Aurora on Tuesday, June 15, 2010 - 11:39 am. (93 messages)