Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-19 Thread Joseph Myers
On Fri, 19 May 2023, Sergey Bugaev via Libc-alpha wrote: > 'foo' is a public symbol, to be used by the user, and also > interposable by the user. Always called via PLT (except from inside > the user's code when redefined inside the executable, in which case > the compiler/linker will see that no P

Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-19 Thread Florian Weimer
* Sergey Bugaev: > On Thu, May 18, 2023 at 11:16 PM Joseph Myers wrote: >> Strictly there are two separate issues: (a) calling an exported symbol >> should be done via a hidden alias, to avoid going via the PLT, and (b) >> functions in a standard namespace should not call names in the user's >> n

Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-19 Thread Sergey Bugaev
On Thu, May 18, 2023 at 11:16 PM Joseph Myers wrote: > Strictly there are two separate issues: (a) calling an exported symbol > should be done via a hidden alias, to avoid going via the PLT, and (b) > functions in a standard namespace should not call names in the user's > namespace, which requires

Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-18 Thread Samuel Thibault
Joseph Myers, le jeu. 18 mai 2023 20:16:03 +, a ecrit: > The C++ type check failure was already present before this patch. > > --- sysdeps/mach/hurd/x86_64/c++-types.data 2023-05-02 09:14:30.246903708 > + > +++ - 2023-05-18 02:08:06.184068438 + > @@ -1 +1 @@ > -blkcnt64_t:x > +b

Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-18 Thread Joseph Myers
On Thu, 18 May 2023, Sergey Bugaev via Libc-alpha wrote: > Hello, > > On Thu, May 18, 2023 at 9:55 PM Joseph Myers wrote: > > > > I suspect this of causing linknamespace test failures: > > > > Contents of conform/POSIX2008/pthread.h/linknamespace.out: > > > > [initial] pthread_create -> [libpthr

Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-18 Thread Sergey Bugaev
Hello, On Thu, May 18, 2023 at 9:55 PM Joseph Myers wrote: > > I suspect this of causing linknamespace test failures: > > Contents of conform/POSIX2008/pthread.h/linknamespace.out: > > [initial] pthread_create -> [libpthread.a(pt-create.o)] __pthread_setup -> > [libpthread.a(pt-setup.o)] hurd_th

Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-18 Thread Joseph Myers
I suspect this of causing linknamespace test failures: Contents of conform/POSIX2008/pthread.h/linknamespace.out: [initial] pthread_create -> [libpthread.a(pt-create.o)] __pthread_setup -> [libpthread.a(pt-setup.o)] hurd_thread_self (On x86_64 there's also a localplt test failure: "Extra PLT re

Re: [RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-17 Thread Samuel Thibault
Applied, thanks! Sergey Bugaev, le mer. 17 mai 2023 22:14:32 +0300, a ecrit: > Unlike sigstate->thread, tcb->self did not hold a Mach port reference on > the thread port it names. This means that the port can be deallocated, > and the name reused for something else, without anyone noticing. Using

[RFC PATCH 06/10] hurd: Make sure to not use tcb->self

2023-05-17 Thread Sergey Bugaev
Unlike sigstate->thread, tcb->self did not hold a Mach port reference on the thread port it names. This means that the port can be deallocated, and the name reused for something else, without anyone noticing. Using tcb->self will then lead to port use-after-free. Fortunately nothing was accessing