From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08B38223322 for ; Sat, 10 Jan 2026 15:37:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768059462; cv=none; b=Ubt20gtW9JEdOQB/eKwGFC/fyj2ET0gt20HjjplbbaqZ0nTFfHPBRH3pXRVDEiRSnDYFyPiESvaYqLld1AYyY9+3E+Yz594+gnT8uJ+fp3AhIvC+l5J42lwKENqxldMHGThQnSLsaJEmt+4FLzk0D4So3q+xpqDX2PE6HqPqvBE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768059462; c=relaxed/simple; bh=3nd6HWxFmBi+sf3VZmqQascKGwLtD00ToqGDcBLHcCI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jl79QpR3vvnnZjf7MuT0j7pfe/dA4IjdpnuPkIbWxd+y/5Kv2cb2nTKttwUblZ6VqdPHlcdlhQylqph9KQrxsekBN1Hb2T0k5Hw641fY4fqFaHYFRloOVNCqPi5IRsMAwJYKkrbkem+ip6qGlv2PYoS7WPlK/FGUQMVPNT12M0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=O+iNFuag; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O+iNFuag" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768059459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nvphlbg2O3ov+ooy6CdEQKs//E1jdepXEPumHpDE2SI=; b=O+iNFuag/BgJvunMT5bx/qZ0aRJR4m4hXbtmVaddujAyGhuudXnQc+sHguOrbKGm9vhQaj qyoW8a3uADx5deqOuMzfTCh69RJmqZkO8AL3UVEYdEwRGf0GJWkGCijtOUnzuF4jGhVMy/ 5rvx9IutN5Z7raL0l3LOVXG0EzEqDpQ= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-178-Ve9vKoIIOM2qBcotcYAocw-1; Sat, 10 Jan 2026 10:37:38 -0500 X-MC-Unique: Ve9vKoIIOM2qBcotcYAocw-1 X-Mimecast-MFC-AGG-ID: Ve9vKoIIOM2qBcotcYAocw_1768059456 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C0AC31956088; Sat, 10 Jan 2026 15:37:33 +0000 (UTC) Received: from fedora (unknown [10.44.33.200]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id A43EB1800980; Sat, 10 Jan 2026 15:37:27 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sat, 10 Jan 2026 16:37:33 +0100 (CET) Date: Sat, 10 Jan 2026 16:37:26 +0100 From: Oleg Nesterov To: Peter Zijlstra Cc: Andrii Nakryiko , Borislav Petkov , Dave Hansen , David Hildenbrand , "H. Peter Anvin" , Ingo Molnar , Jiri Olsa , Masami Hiramatsu , Paulo Andrade , Thomas Gleixner , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [BUG] x86: 32-bit uprobes are broken Message-ID: References: <20260107152716.GG2393663@noisy.programming.kicks-ass.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260107152716.GG2393663@noisy.programming.kicks-ass.net> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 On 01/07, Peter Zijlstra wrote: > > On Wed, Jan 07, 2026 at 03:32:53PM +0100, Oleg Nesterov wrote: > > > or this one > > > > --- a/arch/x86/kernel/sys_x86_64.c > > +++ b/arch/x86/kernel/sys_x86_64.c > > @@ -205,6 +205,8 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr0, > > info.low_limit = PAGE_SIZE; > > > > info.high_limit = get_mmap_base(0); > > + if (test_thread_flag(TIF_ADDR32)) > > + info.high_limit = current->mm->mmap_compat_base; > > if (!(filp && is_file_hugepages(filp))) { > > info.start_gap = stack_guard_placement(vm_flags); > > info.align_offset = pgoff << PAGE_SHIFT; > > This one would be broken if there is ever a case where > get_unmapped_area() is called for mm != current->mm. > > Ah, but get_mmap_base() seems to already rely on that. What a mess :/ Yes, mm_get_unmapped_area_vmflags() paths assume mm == current->mm > Why can't get_mmap_base() rely on TIF_ADDR32 rather than TS_COMPAT? What > funny games are being played here? Mixed mode mm where some threads are > 32bit and others are not? Exactly. I don't understand this. And again, __get_unmapped_area() will use TIF_ADDR32 in the "if (addr > TASK_SIZE - len)" check and return ENOMEM anyway. I don't see the point in using in_32bit_syscall(). And. I just noticed another problem. What if CONFIG_X86_X32_ABI=y ? In this case ->orig_ax = -1 and this makes in_x32_syscall() and thus in_32bit_syscall() true. OK, we need a simple fix for stable, I'll make a patch based on TS_COMPAT hack for now. Oleg.