Re: [PATCH 3.19 3/3] x86, mpx: Change the MPX enable/disable API to arch_prctl

From: Andy Lutomirski
Date: Tue Jan 06 2015 - 00:59:55 EST


On Mon, Jan 5, 2015 at 8:04 PM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
>> We should avoid arch_prctl because glibc won't add a syscall stub that
>> libgcc or whatever would want? My mind boggles.
>
> Please turn brain on before posting.

Brain was on.

>
> Of course they would add it. But only in the next version. Which means
> everyone using older glibc would be out of luck. So all the users
> would be stuck using syscall(). Anything you may gain in the kernel
> would be totally made up by that.
>

ISTM libmpx shouldn't link against glibc at all -- what if libmpx
users want to use an alternate runtime (musl, Go, etc.)?

But I decided to check whether libmpx links against glibc, and I can't
find sources for it at all. Do they exist? Is there any code with
source available that invokes this prctl?

If not, I personally have very little sympathy for the argument that a
binary buried in the depths of the Intel SDE would need to change if
we switched to using arch_prctl. And I think that it should issue the
syscall itself without using glibc, in which case the syscall wrapper
issue is moot.

--Andy

> BTW I added arch_prctl, but in hindsight it wasn't good idea.
>
> -Andi



--
Andy Lutomirski
AMA Capital Management, LLC
--
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/