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 8FDBA437117 for ; Wed, 8 Jul 2026 16:43:36 +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=1783529020; cv=none; b=Sboq7grYOmJIjUvVFFyGbHCbokxapg286s6hax4UtDQMLnZcckyUGkuaVT+dQjA21JxZ3h//LQiwfMr2wyZOPe6zv+wX0ukycCIFb/tl/k+kpBcJgY+dv9K1op8/rnC9pcIc0H+oU3BfH35vpV524VLqZsN6nbKRJyeF/QRF/ZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783529020; c=relaxed/simple; bh=rrsy5rZcgZYTt6KNgG39NW9tODSHtlZTRAi63zGagz4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jjF06Jl0OwpmohvYZMfeKzxjKHr0t9c/LWRdbukY4pGHx/B7Lujfeuy6MMdbB6RJdTmerrGp9NAdGD6PvM6wCQ2VmmzsjK7EoSx/5GLxw/YvZxlNukN4tDmC/fL22dl4NspQWkRxGP1kLWPv34UNQXg5ftKZ+421Ue+LQ273fG8= 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=BRjfRqu7; 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="BRjfRqu7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1783529015; 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=rrsy5rZcgZYTt6KNgG39NW9tODSHtlZTRAi63zGagz4=; b=BRjfRqu7jqBkSQ4zLQszpBtuwAAk0J20ArLq6M5Bm/CKA0N/VIaKeD6cLZOHWW1RydvzPT yEapPNEBCnttyvCLK5rhWdv84d2imPGvnupW/udSp2wKEbt8P3Cv5qo7EpszwGWh20FW9c AgStiXrYnzA/NuZWbzxZzvAlJwPFXsk= Received: from mx-prod-mc-03.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-454-gsy3nbAHNmGURkpLqZwUnQ-1; Wed, 08 Jul 2026 12:43:34 -0400 X-MC-Unique: gsy3nbAHNmGURkpLqZwUnQ-1 X-Mimecast-MFC-AGG-ID: gsy3nbAHNmGURkpLqZwUnQ_1783529012 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B63621955DD4; Wed, 8 Jul 2026 16:43:32 +0000 (UTC) Received: from fedora (unknown [10.44.33.83]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id B7C9B195604C; Wed, 8 Jul 2026 16:43:29 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 8 Jul 2026 18:43:32 +0200 (CEST) Date: Wed, 8 Jul 2026 18:43:27 +0200 From: Oleg Nesterov To: Frederic Weisbecker Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Wongi Lee , Jungwoo Lee , Thomas Gleixner , stable@vger.kernel.org, x86@kernel.org Subject: Re: [tip: timers/urgent] posix-cpu-timers: Prevent UAF caused by non-leader exec() race Message-ID: References: <178324479651.744054.11944477307374142373.tip-bot2@tip-bot2> 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: X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 On 07/08, Frederic Weisbecker wrote: > > > There is a similar problem vs. posix_cpu_timer_set(). For regular posix > > timers it just transiently returns -ESRCH to user space, but for the use > > case in do_cpu_nanosleep() it's the same UAF just that the k_itimer is > > allocated on the stack. > > do_cpu_nanosleep() only targets current and since it's on the stack, no > other task can access it. And the current task can't be exiting/exec'ing > while calling posix_cpu_timer_set() on that stack timer. I thought the same initially, but it seems that this is not true... I can never understand this API, but it seems that sys_clock_nanosleep() can target the !current processes/threads ? Or why else we have clock_getcpuclockid() ? Oleg.