Re: [BUG] x86: 32-bit uprobes are broken

From: Oleg Nesterov

Date: Wed Jan 07 2026 - 10:52:44 EST


On 01/07, Peter Zijlstra wrote:
>
> On Wed, Jan 07, 2026 at 03:32:53PM +0100, Oleg Nesterov wrote:
> > This patch
> >
> > --- a/kernel/events/uprobes.c
> > +++ b/kernel/events/uprobes.c
> > @@ -1710,8 +1710,11 @@ static int xol_add_vma(struct mm_struct *mm, struct xol_area *area)
> >
> > if (!area->vaddr) {
> > /* Try to map as high as possible, this is only a hint. */
> > + if (test_thread_flag(TIF_ADDR32))
> > + current_thread_info()->status |= TS_COMPAT;
> > area->vaddr = get_unmapped_area(NULL, TASK_SIZE - PAGE_SIZE,
> > PAGE_SIZE, 0, 0);
> > + current_thread_info()->status &= ~TS_COMPAT;
> > if (IS_ERR_VALUE(area->vaddr)) {
> > ret = area->vaddr;
> > goto fail;
>
> Urgh. Also I'm a little bit confused; set_personality_ia32(), which is
> what sets TIF_ADDR32 (afaict) would also set TS_COMPAT, no?

Yep. But TS_COMPAT is per syscall, not per task. It is cleared in
arch_exit_to_user_mode_prepare(), in this case after sys_execve() syscall.

Oleg.