From nobody Wed Oct 8 02:17:13 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 06EB32D3A86; Thu, 3 Jul 2025 08:45:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751532317; cv=none; b=ghcc6ma8Cd3B8uMwvsX6puc1EcPGNhCouHiQhhVglQIdNmZSUet4sQ4G/TBlN/9BiWC2ES3R5hLZvF+G7vAoAoVDzR0WYivejWr8U9mCLgz/YeoqNjXUK8YTaTbTH0aCwwctXXHplPOiup2TasIEkvues5JQv8vL+fbpwSx3eqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751532317; c=relaxed/simple; bh=fACPwdKa9I+gICnB9XJcGx1Obt64T2jRw8e7fPeXt0k=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=FCyrO9yP/gYNdHtYkhTGGldXpzu+jIGIubYRllCJz3EWuVoWiQx/by2wvm1lSnvDQpFOfST/mLueef0wE5v3+OUGoxerdVZpVYr7dUWZcGr3OXYaSW/6Sz/Yy30E0ALZIUSEEgK8+9tTpw8Azvn0DZoMJP3YaKVafP7cX6erw84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YHO0dAD9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/VWYGn7X; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YHO0dAD9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/VWYGn7X" Date: Thu, 03 Jul 2025 08:45:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751532314; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c+L67L7e2SGYbC7kdFozrW8IzHhFOq27DJdOXABdcBQ=; b=YHO0dAD94f5CeGeGW9D2sKY2SCjRx3HVxTeMJCfOZIEbxgqt6aWs3vDAPhc8Ntu8Ly27qp PgV4Nu/pqzDt6JzChzxDxBiqIyMIaQr0boqhkLc8sqRP0uWOd870UteB0wP4u0mKwgu0hc Dth9PBYE74/XCoe/XRgbGseRyLa2MZGrnpgXxQvFqGP11WK6q+A/ov5cZKpEXxGfPlgH2h yI3a52D9zY8y9jAUig4pMg80WSr5k+BTeH2rxpdrEpxKxa4XVsWww1+WxfAvJQg+dFdj3q QcZijM/2DM94cT39suaUPLsXPiyPRTPzxq+WAE3u4BgprTiqDmtUkEQB701fQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751532314; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c+L67L7e2SGYbC7kdFozrW8IzHhFOq27DJdOXABdcBQ=; b=/VWYGn7Xq/ESJ6xHGWbbWWB3+NnldQTuL8TLAfw48WYp7L34EPmDqgCeYAAjuxfOH0KrtZ WdItPjO+vkh2gYAA== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf: Revert to requiring CAP_SYS_ADMIN for uprobes Cc: Jann Horn , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175153231306.406.639427734132565496.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the perf/urgent branch of tip: Commit-ID: ba677dbe77af5ffe6204e0f3f547f3ba059c6302 Gitweb: https://git.kernel.org/tip/ba677dbe77af5ffe6204e0f3f547f3ba0= 59c6302 Author: Peter Zijlstra AuthorDate: Wed, 02 Jul 2025 18:21:44 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 03 Jul 2025 10:33:55 +02:00 perf: Revert to requiring CAP_SYS_ADMIN for uprobes Jann reports that uprobes can be used destructively when used in the middle of an instruction. The kernel only verifies there is a valid instruction at the requested offset, but due to variable instruction length cannot determine if this is an instruction as seen by the intended execution stream. Additionally, Mark Rutland notes that on architectures that mix data in the text segment (like arm64), a similar things can be done if the data word is 'mistaken' for an instruction. As such, require CAP_SYS_ADMIN for uprobes. Fixes: c9e0924e5c2b ("perf/core: open access to probes for CAP_PERFMON priv= ileged process") Reported-by: Jann Horn Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/CAG48ez1n4520sq0XrWYDHKiKxE_+WCfAK+qt9qkY4Z= iBGmL-5g@mail.gmail.com --- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index bf2118c..0db36b2 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -11116,7 +11116,7 @@ static int perf_uprobe_event_init(struct perf_event= *event) if (event->attr.type !=3D perf_uprobe.type) return -ENOENT; =20 - if (!perfmon_capable()) + if (!capable(CAP_SYS_ADMIN)) return -EACCES; =20 /*