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 5F18B435A9E for ; Wed, 29 Jul 2026 16:02:51 +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=1785340972; cv=none; b=USSwZRkUw/fbSTGz6tn9ghlGml0BMlR859ObMnkrlMAeGEGFUoyrV9M305IoNv6HTpEr65XJIkf+Qa2YftLFO29Ku0DQ9vvuhvMX30CxGKTmU7C0nK+wXQuRJEHf9/glOuXlfiQ16X08mkHu6gLqVHk94nIw2DtdKQHhR/IbiTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785340972; c=relaxed/simple; bh=HBo82KCSUGdmfLmw+XjkjGQ3vVLAwAp/lLnwHsyPBn0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: In-Reply-To:Content-Type:Content-Disposition; b=ErlsnPvG6gcCwAMqphKDcP5y3Ai+ngAX/faJBwT4Hxa/pvU/m43+nToJ7dR0sPfuZ8SLBcaUYNE349VxQ/lFpXIesroM3b4lxXU15dV+hZDKtKC+TTyDKm3pFGzyJLKFbxYRxXsEUSUp6xRI32Po2py3azxz0rBya8TUxSNDC7o= 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=Gp3TXKOU; 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="Gp3TXKOU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785340970; 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=j+wsHGBgw5K19naIhGYr3W/foVErV3j2PeWPVr+UF1c=; b=Gp3TXKOUxemCDy5x/ohndWfUWGX+2K2dDtvwu7NucjdDZQgh5ZWEP2nFCO+iGWhyXCoLon EmBwmHOvv2NFYTDOyM9zZaVb1vYxaYii86mBj6UcsNPBCGoGLLn2BVk8gKRXRtx0BJLC2K Sxx7/wIapCWDT7P8vCzlexkM33oDBOQ= Received: from mx-prod-mc-01.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-442-ZZiDhcJDM1ieTJmFYB9W_g-1; Wed, 29 Jul 2026 12:02:46 -0400 X-MC-Unique: ZZiDhcJDM1ieTJmFYB9W_g-1 X-Mimecast-MFC-AGG-ID: ZZiDhcJDM1ieTJmFYB9W_g_1785340963 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 87BA319560A6; Wed, 29 Jul 2026 16:02:42 +0000 (UTC) Received: from fedora (unknown [10.44.33.21]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id CAA26180044F; Wed, 29 Jul 2026 16:02:36 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 29 Jul 2026 18:02:42 +0200 (CEST) Date: Wed, 29 Jul 2026 18:02:35 +0200 From: Oleg Nesterov To: Breno Leitao Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Masami Hiramatsu , Andrii Nakryiko , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kernel-team@meta.com, stable@vger.kernel.org Subject: Re: [PATCH] uprobes: Fix NULL pointer dereference in hprobe_expire() Message-ID: References: <20260729-uprobe-v1-1-61896b87c867@debian.org> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20260729-uprobe-v1-1-61896b87c867@debian.org> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-MFC-PROC-ID: gB8FNzkhQH6iOTtnqN1616KlTdeXRqHZR4YSDVLPOWo_1785340963 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 07/29, Breno Leitao wrote: > > --- a/kernel/events/uprobes.c > +++ b/kernel/events/uprobes.c > @@ -832,7 +832,7 @@ static struct uprobe *hprobe_expire(struct hprobe *hprobe, bool get) > if (try_cmpxchg(&hprobe->state, &hstate, uprobe ? HPROBE_STABLE : HPROBE_GONE)) { > /* We won the race, we are the ones to unlock SRCU */ > __srcu_read_unlock(&uretprobes_srcu, hprobe->srcu_idx); > - return get ? get_uprobe(uprobe) : uprobe; > + return get && uprobe ? get_uprobe(uprobe) : uprobe; Well, looks "obviously correct". At least the current code is obviously wrong, it even checks uprobe != NULL 3 lines above. Andrii ? Acked-by: Oleg Nesterov